当所传的Integer参数的值为0(并不为空)但没有触发该sql语句(而为1时会触发):
<if test="params.result != null and params.result != ''">
and azb.result=#{params.result}
</if>
因为rusult是Integer类型的,不会有空字符串的情况,删掉and后面的判断条件即可。
<if test="params.result != null">
and azb.result=#{params.result}
</if>
此时,result为0也会触发该语句。