xml中Integer判空

一:问题的由来

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

二:解决问题过程

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

原写法如下:

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

,min_count = #{minCount}

</if>

三:解决方法

去掉and minCount != ''

<if test="minCount != null"</if>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念