Visitar URL original
解决 LEFT/RIGHT JOIN 在主副表都有条件时 preparedValueList 里的主副表值顺序错误 by zhangtianxiao · Pull Request #70 · 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
愚蠢的smallint
  • Loading branch information
zhangtianxiao authored Feb 17, 2019
commit b2e42ffd2e6225150c619780ee2958f5d12fd365
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,8 @@ public String getJoinString() throws Exception {

if (joinList != null) {
String quote = getQuote();
List<Object> pvl = new ArrayList<>();
boolean changed = false;

String sql = null;
SQLConfig jc;
Expand Down Expand Up @@ -1898,7 +1900,10 @@ public String getJoinString() throws Exception {
+ quote + tn + quote + "." + quote + j.getTargetKey() + quote;
jc.setMain(false).setKeyPrefix(true);

preparedValueList.addAll(jc.getPreparedValueList());
// preparedValueList.addAll(jc.getPreparedValueList());

pvl.addAll(jc.getPreparedValueList());
changed = true;
break;

case "": // FULL JOIN
Expand All @@ -1916,6 +1921,13 @@ public String getJoinString() throws Exception {

joinOns += " \n " + sql;
}


if (changed) {
pvl.addAll(preparedValueList);
preparedValueList = pvl;
}

}

return joinOns;
Expand Down