Mybats写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>
posted @ 2024-07-26 15:36  进击的乌拉  阅读(1)  评论(0编辑  收藏  举报