在做视频的点赞收藏修改操作中,取消收藏无法将1改成0
debug发现业务层已经将数据改为0 所以怀疑是数据映射中的问题
发现int类型的good_num和comment_num是这样判断的 因为int类型是基本类型 不能用字符判断
所以将and good_num != ""去掉 修改成0成功!
将
<if test=' good_num != null and good_num != "" '>
,good_num=#{good_num}
</if>
<if test=' comment_num != null and comment_num != "" '>
,comment_num=#{comment_num}
</if>
修改为
<if test=' good_num != null '>
,good_num=#{good_num}
</if>
<if test=' comment_num != null '>
,comment_num=#{comment_num}
</if>