From ae249037d7ec887ad0c08cb2268c096be9e0c7bb Mon Sep 17 00:00:00 2001 From: duanshuai Date: Wed, 6 Mar 2019 12:42:43 +0800 Subject: [PATCH] =?UTF-8?q?bugfix-=E4=BF=AE=E5=A4=8DColomn=E9=9D=9E?= =?UTF-8?q?=E5=B8=B8=E8=A7=84=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E8=8E=B7=E5=8F=96=E8=A1=A8=E5=90=8D=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=BE=93=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biao/apijson/server/AbstractSQLExecutor.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/AbstractSQLExecutor.java b/APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/AbstractSQLExecutor.java index 6dca53959..95ad96f83 100755 --- a/APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/AbstractSQLExecutor.java +++ b/APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/AbstractSQLExecutor.java @@ -214,8 +214,20 @@ public JSONObject execute(SQLConfig config) throws Exception { for (int i = 1; i <= length; i++) { - if (hasJoin && viceColumnStart > length && config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) { - viceColumnStart = i; + // if (hasJoin && viceColumnStart > length && config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) { + // viceColumnStart = i; + // } + + // FIXME bugfix-修复非常规数据库字段,获取表名失败导致输出异常 + if (hasJoin && viceColumnStart > length) { + List column = config.getColumn(); + + if (column != null && column.isEmpty() == false) { + viceColumnStart = column.size() + 1; + } + else if (config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) { + viceColumnStart = i; + } } result = onPutColumn(config, rs, rsmd, index, result, i, hasJoin && i >= viceColumnStart ? childMap : null);