Commit 8697f5f4 authored by Quxl's avatar Quxl

x

parent 86fd1903
...@@ -333,9 +333,11 @@ public interface Dialect { ...@@ -333,9 +333,11 @@ public interface Dialect {
default Sql argsQuery(String tableName, Map<String, Object> objMap) { default Sql argsQuery(String tableName, Map<String, Object> objMap) {
List<String> wheres = new ArrayList<String>(); List<String> wheres = new ArrayList<String>();
List<Object> args = new ArrayList<Object>(); List<Object> args = new ArrayList<Object>();
for(String key : objMap.keySet()) { if(objMap != null) {
wheres.add(getColumnLeft() + key + getColumnRight() + " = ?"); for(String key : objMap.keySet()) {
args.add(objMap.get(key)); wheres.add(getColumnLeft() + key + getColumnRight() + " = ?");
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