Sql sql = Sqls.create("SELECT MONTH, SUM(money) FROM ptbalance $condition");
sql.setCondition(Cnd.where("balancerid","=",ptid).and("state","=",1).groupBy("month").orderBy("month", "asc"));
sql.setCallback(Sqls.callback.map());
final Map map = new HashMap<>();
sql.setCallback(new SqlCallback() {
public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
List<Map<String, Double>> list = new LinkedList<Map<String, Double>>();
while (rs.next())
map.put(rs.getString("month"), rs.getDouble("SUM(money)"));
return map;
}
});
dao.execute(sql);
Map lm=sql.getObject(Map.class);
dao.execute(sql);这个报错空指针,开始都是好好的,貌似是service继承IdNameEntityService后,就开始报错,这个错在哪儿啊?