mybatis 的xml,Integer类型参数bug问题

当有Integer数据类型的参数值为0时,如pid=0,xml中pid=="" 判断为ture,即不走条件语句 xml

<if test="pid != null and pid != '' ">
   AND a.pid = #{pid}
</if>

因此还要加上一句 or pid==0test

相关文章
相关标签/搜索