用in做查询,传入的是list,日志如下,感觉查询语句没有执行啊
[INFO][2017-11-30 16:47:09,331][com.kanq.app.App]begin to run excel and db comparator application
[INFO][2017-11-30 16:47:36,618][org.nutz.ioc.impl.NutIoc]NutIoc init begin ...
[INFO][2017-11-30 16:47:36,624][org.nutz.ioc.impl.NutIoc]... NutIoc init complete
[INFO][2017-11-30 16:47:37,102][com.alibaba.druid.pool.DruidDataSource]{dataSource-1} inited
[INFO][2017-11-30 16:47:37,244][org.nutz.filepool.NutFilePool]Init file-pool by: C:\Users\Administrator/.nutz/tmp/dao/ [200000]
[INFO][2017-11-30 16:47:37,245][org.nutz.filepool.NutFilePool]file-pool.cursor: 0
[INFO][2017-11-30 16:47:37,359][org.nutz.dao.jdbc.Jdbcs]Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
2791------
1000
[WARN][2017-11-30 16:47:38,266][org.nutz.dao.impl.entity.AnnotationEntityMaker]No @Table found, fallback to use table name='yg_helper' for type 'com.kanq.vo.YgHelper'
代码如下
private List<YgHelper> getDBInfo(Dao dao,String tableName,List<String> idCards){
Sql sql = Sqls.create("SELECT qlrzjbh,djkid,fdzl,jzmj FROM $table WHERE qlrzjbh in (@idCards)");
sql.vars().set("table", tableName);
sql.params().set("idCards", idCards.toArray(new String[idCards.size()]));
sql.setCallback(Sqls.callback.entities());
sql.setEntity(dao.getEntity(YgHelper.class));
dao.execute(sql);
List<YgHelper> list = sql.getList(YgHelper.class);
return list;
}