Visitar URL original
bugfix-修复Colomn非常规数据库字段,获取表名失败导致输出异常 by jackyang-hk · Pull Request #74 · APIJSON/APIJSON · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bugfix-修复Colomn非常规数据库字段,获取表名失败导致输出异常
  • Loading branch information
jackyang-hk committed Mar 6, 2019
commit ae249037d7ec887ad0c08cb2268c096be9e0c7bb
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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);
Expand Down