解决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>