<if test="value!=null and value!='' ">....</if>
此時若value爲數字封裝類型且 vlaue=0 mybatis會默認把value轉爲'',因此<if>中的代碼不會執行
解決方法:
<if test="value!=null">....</if>傳參時如果vlaue=''就讓他等於null
或者
<if test="(value!=null and value!='')or value==0 ">....</if>
<if test="value!=null and value!='' ">....</if>
此時若value爲數字封裝類型且 vlaue=0 mybatis會默認把value轉爲'',因此<if>中的代碼不會執行
解決方法:
<if test="value!=null">....</if>傳參時如果vlaue=''就讓他等於null
或者
<if test="(value!=null and value!='')or value==0 ">....</if>