当传入条件为0时,查询结果有误,没有过滤state条件。将state !=''判断去掉即可
原始写法
<if test="state != null and state != '' ">
state = #{state}
</if>
更改后
<if test="state != null">
state = ${state}
</if>
当传入条件为0时,查询结果有误,没有过滤state条件。将state !=''判断去掉即可
<if test="state != null and state != '' ">
state = #{state}
</if>
<if test="state != null">
state = ${state}
</if>