select SUM(scorenum) c from supervisor_evaluation_sum WHERE project_id=@projectId and store_id=@storeId and sales_id=@saleId AND type=@type;
这是单条数据,nutz怎么弄
5 回复
Sql sql = Sqls.create("select SUM(scorenum) c from supervisor_evaluation_sum WHERE project_id=@projectId and store_id=@storeId and sales_id=@saleId AND type=@type;");
sql.setCallback(Sqls.callback.integer());
dao().execute(sql);
int num = sql.getInt();
这样是不是更简单?
Sql sql = Sqls.fetchInt("select 1 from dual");
dao.execute(sql);
System.out.println(sql.getInt());
@bugss 恩, 如果是1.b.53或以上的话, 可以一行写完
System.out.println(dao.execute(Sqls.fetchInt("select 1 from dual")).getInt());
添加回复
请先登陆