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

 

解决办法:
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>

posted @ 2018-05-07 16:54  Earic  阅读(882)  评论(0编辑  收藏  举报