Commit 8697f5f4 authored by Quxl's avatar Quxl

x

parent 86fd1903
...@@ -333,10 +333,12 @@ public interface Dialect { ...@@ -333,10 +333,12 @@ 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>();
if(objMap != null) {
for(String key : objMap.keySet()) { for(String key : objMap.keySet()) {
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