mybatis xml中之前的写法
<if test="balance != null and balance!=''">
balance = #{balance},
</if>
更改后的写法
<if test="balance != null">
balance = #{balance},
</if>
在debug调试的时候实体类balance其实是接收到了值为0,但是执行Update sql语句的时候发现balance字段并没有更新。自己猜想可能是bigdecimal为0的值和空字符串适配了,自己也不是很懂是什么原因,有知道的大佬麻烦解答一下,非常感谢
追加:在后来的开发中用int类型的时候也出现相同问题,float double还未试过