Mybatis写xml文件时传入参数为Integer类型的0被if标签判断为空bug
当type = 0 时出现bug 不走这个条件
<if test='type != null and type!= ""' >
and type = #{type}
</if>
解决方案
去掉判断空字符串
<if test='type != null' >
and type = #{type}
</if>
<if test='type != null and type!= ""' >
and type = #{type}
</if>
<if test='type != null' >
and type = #{type}
</if>