status是Integer類型。
一開始傳入0的時候,發現這個判斷語句走不進去,但是傳1是好的:
<if test="status != null and status != ''">
and c.status = #{status}
</if>
后來修改為
<if test="status != null">
and c.status = #{status}
</if>
則0和1都可以
所以數字判斷的時候,應該是只要判斷非空就可以。