码迷,mamicode.com
首页 > 编程语言 > 详细

解决mybatis报错Result Maps collection does not contain value for java.lang.Integer

时间:2018-05-07 17:45:47      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:interval   count   value   cdata   plain   amp   lang   lan   use   

 

解决办法:
1.检查mybatis的xml配置

2.在某处肯定有配错了的,如"resultMap" -->"resultType"

[html] view plain copy
<select id="getNumDayMoney" resultMap="java.lang.Integer" parameterType="java.lang.Integer">
<![CDATA[
select sum(money) from dw_account_recharge where user_id = #{userId}
AND addtime < UNIX_TIMESTAMP(
date_sub(curdate(), INTERVAL - 1 DAY)
)
AND addtime > UNIX_TIMESTAMP(
date_sub(curdate(), INTERVAL 1 DAY)
)
]]>
</select>
修改为:
[html] view plain copy
<select id="getNumDayMoney" resultType="java.lang.Integer" parameterType="java.lang.Integer">
<![CDATA[
select sum(money) from dw_account_recharge where user_id = #{userId}
AND addtime < UNIX_TIMESTAMP(
date_sub(curdate(), INTERVAL - 1 DAY)
)
AND addtime > UNIX_TIMESTAMP(
date_sub(curdate(), INTERVAL 1 DAY)
)
]]>
</select>

解决mybatis报错Result Maps collection does not contain value for java.lang.Integer

标签:interval   count   value   cdata   plain   amp   lang   lan   use   

原文地址:https://www.cnblogs.com/sprinng/p/9003630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!