摘录-Mybatis - Integer值为0的数据 return false

Mybatis在进行<if test="status != null and status != ''">判空操作时,如果status为0的时候,该判断条件的值为false,也就是说Mybatis此时把0作为 ""来进行判断的!

status 若为对象数据类型(例integer)就去掉为""判断 若为其他可以自定义在server参数处理成自定义的值。

猜你喜欢

转载自www.cnblogs.com/technology-huangyan/p/9121339.html