Commit ca2d60c0 authored by Quxl's avatar Quxl

x

parent f6ae26bc
...@@ -335,10 +335,15 @@ public interface Dialect { ...@@ -335,10 +335,15 @@ public interface Dialect {
List<Object> args = new ArrayList<Object>(); List<Object> args = new ArrayList<Object>();
if(objMap != null) { if(objMap != null) {
for(String key : objMap.keySet()) { for(String key : objMap.keySet()) {
Object val = objMap.get(key);
if(val == null) {
wheres.add(getColumnLeft() + key + getColumnRight() + " is null");
} else {
wheres.add(getColumnLeft() + key + getColumnRight() + " = ?"); wheres.add(getColumnLeft() + key + getColumnRight() + " = ?");
args.add(objMap.get(key)); args.add(objMap.get(key));
} }
} }
}
String sql = "select * from " + tableName + StringUtil.join(" and ", " where ", "", wheres); String sql = "select * from " + tableName + StringUtil.join(" and ", " where ", "", wheres);
return new Sql(sql, args.toArray()); return new Sql(sql, args.toArray());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment