1.搜索条件为0的时候不生效
此处的#{status}是0
错误写法:
<if test="status != null and status != ''">
and l.status = #{status}
</if>
正确写法:
<if test=" (status != null and status != '') or status == 0 ">
and l.status = #{status}
</if>
1.搜索条件为0的时候不生效
此处的#{status}是0
错误写法:
<if test="status != null and status != ''">
and l.status = #{status}
</if>
正确写法:
<if test=" (status != null and status != '') or status == 0 ">
and l.status = #{status}
</if>