Skip to content

Commit

Permalink
Merge pull request #74 from redcatmiss/master
Browse files Browse the repository at this point in the history
bugfix-修复Colomn非常规数据库字段,获取表名失败导致输出异常
  • Loading branch information
TommyLemon authored Mar 9, 2019
2 parents 0f4f043 + ae24903 commit fba2231
Showing 1 changed file with 14 additions and 2 deletions.
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

0 comments on commit fba2231

Please sign in to comment.