Skip to content

Commit fba2231

Browse files
authored
Merge pull request #74 from redcatmiss/master
bugfix-修复Colomn非常规数据库字段,获取表名失败导致输出异常
2 parents 0f4f043 + ae24903 commit fba2231

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

APIJSON-Java-Server/APIJSONORM/src/main/java/zuo/biao/apijson/server/AbstractSQLExecutor.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,20 @@ public JSONObject execute(SQLConfig config) throws Exception {
214214

215215
for (int i = 1; i <= length; i++) {
216216

217-
if (hasJoin && viceColumnStart > length && config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) {
218-
viceColumnStart = i;
217+
// if (hasJoin && viceColumnStart > length && config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) {
218+
// viceColumnStart = i;
219+
// }
220+
221+
// FIXME bugfix-修复非常规数据库字段,获取表名失败导致输出异常
222+
if (hasJoin && viceColumnStart > length) {
223+
List<String> column = config.getColumn();
224+
225+
if (column != null && column.isEmpty() == false) {
226+
viceColumnStart = column.size() + 1;
227+
}
228+
else if (config.getSQLTable().equalsIgnoreCase(rsmd.getTableName(i)) == false) {
229+
viceColumnStart = i;
230+
}
219231
}
220232

221233
result = onPutColumn(config, rs, rsmd, index, result, i, hasJoin && i >= viceColumnStart ? childMap : null);

0 commit comments

Comments
 (0)