Mybatis的XML中数字不为空的判断

发现1可以进去0进不去

    <if test="status != null and status != ''">
        and c.status = #{status}
    </if>

后来修改为

    <if test="status != null">
        and c.status = #{status}
    </if>

则0和1都可以

原文地址:https://www.cnblogs.com/dalianpai/p/14030410.html