九月 发表于 2018-6-6 15:35:35

sum数据,同样的sql利用minidao 和工具查出来的不一致

使用minidao的日志打印:
userId:137********__dateStr:2018-06-06 15:29:51__sendflag:R
MiniDao-SQL:select SUM(outprem) redprem from lc_*** WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate
AND userid=:phone AND sendflag=:sendflag
sum:45.32__dateStr:2018-06-06 15:29:51

sql执行情况截图
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA5EAAADJCAIAAAA1hSHvAAAgAElEQVR4nO3deVQUd6Iv8N/1nnfmZN555+Xdc+bemXfnZqKTd+dub+aNGGN2Z5JMJvPmJve+6IwKRlyixrhNNIsxKggIrokrawPduDQgiAqyQ7MLsi+yqAiIgJpIR8BotLvfHwVNddWvflW90F0N38/5HU51UfWr3+9X1V1ffjQNMRqNRqOREGIcw192gAUAAAAAwKWINaGSMc4EVmRWAAAAAHA5ZxMqMisAAAAATDRkVgAAAABQO2RWAAAAAFA7ZFYAAAAAUDthZsXfYAEAAACA2tgkVHxuAAAAAACoEDIrAAAAAKid8F8JILMCAAAAgNqM/0MBwQIyKwAAAACoBLFOr/IhswIAAACAeuBzAwAAAABA7WxmVTHPCgAAAAAqhP8pAAAAAABqh8wKAAAAAGo3IZmVEGLwZgHqaL9KmuG9srKyTpw4oXORaAUiFIiTdvbsWU+P2WRjfRJZ8GxyCyXjjHPhPPEY4n4BLuTpaCoJmVVIVc98FzZm2rRp06ZNc1VtbjZtjF17ZWRkeFdmTU9Pn6ABnJr4Tx/kJPfw3sxqIcQ9DXPJUaiVqOrmpQZefdezEvfCDf3ydDSVNP6xrC78rCtCyHvvWazFYDDwHwrWWMdIvI1gpdQ2YoMvX7MW60PGt6zfNajsae/axkz0Vc44y9QTzVh2SfszMzO9K7Pm5ORQR1X8lfoEYY+8M88dqTVKKhE/9RQemr+eUTP1WBz2JCuXUSy2uVYcXMQPZcONVD0TsZeghdZK2Dsq7Dt1F/GO1GUlrRWv5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uQJUDxTp76tjuLinIrAAAAABejVzpaJEq/Mx6paPl7u0GLy3IrAAAAABejRiZrJnV2yGzAgAAAHgvEs9EJhFPDzUAAAAAOAiZFQAAAADUTua9AVzau+XlkFkBAAAAvBoZvrSVUdyWWQVzovz19u5FrQSZFQAAAMB7kRU8QzWBguLOzCoVSe3ai5p3kVkBAAAAvJptZq0LExTPZlbGeqnvIrMCAAAATD6jSY7LrPcaDwiKR94bIJVBleyFzAoAAAAw+dhm1uajguKReVa73s8qWEZmBQAAAJh8bDLrt60xguKRzw1QnlnFeyGzAgAAAEw+tpm1XScomGcFAAAAAI+zyazGK4mC4s55VqnPqGJHWIV7IbMCAAAAeC/bzNqZJigeeW+AyyGzAgAAAHg128zadUFQkFkBAAAAwONsMuvgjXxBQWYFAAAAAI+z+Z8CgzdLBQWZFQAAAAA8ziaz3h2oEhRkVgAAAADwOHL3dgOjILMCAAAAgMcRIxOZRDw91AAAAADgIBLP5Omc6UqeHmoAAAAAcBCSHAAAAACoHTIrAAAAAKgdMisAAAAAqB0yKwAAAACoHTIrAAAAAKgdMisAAAAAqB0yKwAAAACoHTIrAAAAAKgdMisAAAAAqB0yKwAAAACoHTIrAAAAAKgdMisAAAAAqB0yKwAAAACoHTIrAAAAAKgdMisAAAAAqN3/B2STDEhLV422AAAAAElFTkSuQmCCAA==
求指点


admin 发表于 2018-6-6 15:39:32

minidao 查出来多少

九月 发表于 2018-6-6 15:40:50

minidao sum出的是45.32,实际应该是 51.50

九月 发表于 2018-6-6 15:46:16

admin 发表于 2018-6-6 15:39 static/image/common/back.gif
minidao 查出来多少

minidao sum出的是45.32,实际应该是 51.50

admin 发表于 2018-6-6 15:48:05

代码贴出来,把日志打出来

九月 发表于 2018-6-6 15:55:52

admin 发表于 2018-6-6 15:48 static/image/common/back.gif
代码贴出来,把日志打出来

调用的地方
logger.info("----into --34-getRedpacketReward----userId:"+userId+"__dateStr:"+dateStr+"__sendflag:"+sendflag);
Map<String, BigDecimal> storeInfo = appRedpacketMiniDao.getRedEnvelopesReward(userId, dateStr, sendflag);
String sum=storeInfo.get("redprem")+"";
if (sum.equals("null")) {
        sum="";
}
logger.info("----into --34-getRedpacketReward----sum:"+sum+"__dateStr:"+dateStr);


定义的地方
@Arguments({"phone","pdate","sendflag"})
@Sql("select SUM(outprem) redprem from lc_rptotalpay WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate AND userid=:phone AND sendflag=:sendflag")
Map<String, BigDecimal> getRedEnvelopesReward(String phone,String pdate, String sendflag);

九月 发表于 2018-6-6 16:02:24

九月 发表于 2018-6-6 15:55 static/image/common/back.gif
调用的地方
logger.info("----into --34-getRedpacketReward----userId:"+userId+"__dateStr:"+dateStr+" ...

调用的地方
logger.info("----into --34-getRedpacketReward----userId:"+userId+"__dateStr:"+dateStr+"__sendflag:"+sendflag);
Map<String, BigDecimal> storeInfo = appRedpacketMiniDao.getRedEnvelopesReward(userId, dateStr, sendflag);
String sum=storeInfo.get("redprem")+"";
if (sum.equals("null")) {
        sum="";
}
logger.info("----into --34-getRedpacketReward----sum:"+sum+"__dateStr:"+dateStr);


定义的地方
@Arguments({"phone","pdate","sendflag"})
@Sql("select SUM(outprem) redprem from lc_rptotalpay WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate AND userid=:phone AND sendflag=:sendflag")
Map<String, BigDecimal> getRedEnvelopesReward(String phone,String pdate, String sendflag);


日志:
----into --34-getRedpacketReward----userId:13716837204__dateStr:2018-06-06 15:29:51__sendflag:R
MiniDao-SQL:

select SUM(outprem) redprem from lc_rptotalpay WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate AND userid=:phone AND sendflag=:sendflag
----into --34-getRedpacketReward----sum:45.32__dateStr:2018-06-06 15:29:51

admin 发表于 2018-6-6 16:41:47

直接返回long 类型试试

九月 发表于 2018-6-6 18:22:50

admin 发表于 2018-6-6 16:41 static/image/common/back.gif
直接返回long 类型试试

还是不行
代码:
@Arguments({"phone","pdate","sendflag"})
        @Sql("select SUM(outprem) redprem from lc_rptotalpay WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate AND userid=:phone AND sendflag=:sendflag")
        Map<String, Long> getRedEnvelopesReward(String phone,String pdate, String sendflag);

日志:
----into --34-getRedpacketReward----userId:13716837204__dateStr:2018-06-06 18:20:12__sendflag:R
MiniDao-SQL:
select SUM(outprem) redprem from lc_rptotalpay WHERE STR_TO_DATE(create_date,'%Y-%m-%d %H:%i:%s') BETWEEN startdate AND enddate AND userid=:phone AND sendflag=:sendflag
----into --34-getRedpacketReward----sum:45.32__dateStr:2018-06-06 18:20:12

admin 发表于 2018-6-6 18:26:47

那就是条件不对,你自己调试看看
页: [1] 2
查看完整版本: sum数据,同样的sql利用minidao 和工具查出来的不一致