华拓科技网
您的当前位置:首页xml中Integer判空

xml中Integer判空

来源:华拓科技网

  

一:问题的由来

业务需求在设置最小数量(minCount)时用到了Integer类型,发现设置为0时不能入库

二:解决问题过程

直接在*Mapper.xml中找到对应minCount判断语句

原写法如下:

<if test="minCount != null" and minCount != ''>

,min_count = #{minCount}

</if>

三:解决方法

去掉and minCount != ''

<if test="minCount != null">

,min_count = #{minCount}

</if>







转载于:https://my.oschina.net/bkc/blog/615145

因篇幅问题不能全部显示,请点此查看更多更全内容