當有Integer數據類型的參數值爲0時,如pid=0,xml中pid=="" 判斷爲ture,即不走條件語句 xml
<if test="pid != null and pid != '' "> AND a.pid = #{pid} </if>
因此還要加上一句 or pid==0test