Sql sql = Sqls.create("select sum(money) as money from applet_search_meal where appletId=@appletId and opAt>=@opAt and status=2");
sql.setParam("appletId", appletId).setParam("opAt", opAt);
appletSearchMealService.dao().execute(sql);
double total = sql.getDouble();
2017-10-13 14:06:19,001 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT * FROM applet_config
2017-10-13 14:06:19,059 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - select sum(money) as money from applet_search_meal where appletId=? and opAt>=? and status=2
| 1 | 2 |
|--------------------|------------|
| wx0526af5c48e985e5 | 1507824000 |
For example:> "select sum(money) as money from applet_search_meal where appletId='wx0526af5c48e985e5' and opAt>=1507824000 and status=2"
2017-10-13 14:06:19,062 cn.wizzer.common.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) DEBUG - [GET ]URI=/nutzwk/private/applet/meal/pay 116ms
2017-10-13 14:06:19,063 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN - Error@/private/applet/meal/pay :
java.lang.NullPointerException
at org.nutz.dao.impl.sql.NutStatement.getDouble(NutStatement.java:156)
at cn.wizzer.modules.back.applet.controllers.AppletMealPayController.index(AppletMealPayController.java:60)
at cn.wizzer.modules.back.applet.controllers.AppletMealPayController$FM$index$6052d1be34a69ad8029c9896542e7052.invoke(AppletMealPayController.java)
能查出值,但是取就不行,请教下