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

相關文章
相關標籤/搜索