为什么我的daos.queryCount 方法的参数是String ,而nutzwk 的参数是SQL? 我怎么能把我的jar包给替换掉?
/**
* 查询某sql的结果条数
*/
public static long queryCount(Dao dao, String sql) {
String tmpTable = "as nutz_tmp";
if (dao.meta().isDB2())
tmpTable = "as nutz_tmp" + R.UU32();
else if (dao.meta().isOracle())
tmpTable = "";
else
tmpTable += "_" + R.UU32();
Sql sql2 = Sqls.fetchInt("select count(1) from (" + sql + ")" + tmpTable);
dao.execute(sql2);
return sql2.getInt();
}
```
public static long queryCount(Dao dao, Sql sql) {
String tmpTable = "as _nutz_tmp";
if(dao.meta().isDB2()) {
tmpTable = "as nutz_tmp_" + R.UU32();
} else if(dao.meta().isOracle()) {
tmpTable = "";
} else {
tmpTable = tmpTable + "_" + R.UU32();
}
Sql sql2 = Sqls.fetchLong("select count(1) from (" + sql.getSourceSql() + ")" + tmpTable);
Iterator var4 = sql.params().keys().iterator();
String key;
while(var4.hasNext()) {
key = (String)var4.next();
sql2.setParam(key, sql.params().get(key));
}
var4 = sql.vars().keys().iterator();
while(var4.hasNext()) {
key = (String)var4.next();
sql2.setVar(key, sql.vars().get(key));
}
return dao.execute(sql2).getLong();
}