Skip to content

Commit

Permalink
xxxByMap 支持 null 查询
Browse files Browse the repository at this point in the history
  • Loading branch information
青苗 committed Sep 4, 2016
1 parent d1fae77 commit c1f8d96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ protected String sqlWhere(TableInfo table, boolean space) {
protected String sqlWhereByMap() {
StringBuilder where = new StringBuilder();
where.append("\n<foreach collection=\"cm.keys\" item=\"k\" separator=\"AND\"> ");
where.append("\n<if test=\"cm[k]!=null\">").append("${k}=#{cm[${k}]}").append("</if>");
where.append("\n${k}=#{cm[${k}]}");
where.append("\n</foreach>");
return where.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public static void main(String[] args) {

Map<String, Object> columnMap = new HashMap<String, Object>();
columnMap.put("name", "deleteByMap");
columnMap.put("age", null);
rlt = userMapper.deleteByMap(columnMap);
System.err.println("---------deleteByMap------- result=" + rlt + "\n\n");
sleep();
Expand Down

0 comments on commit c1f8d96

Please sign in to comment.