mybatis中if条件判断的值为Long/Integer数值类型时,判断条件不能用
<if test="status != null and status != ''">
因为MyBatis的源码中对空传的判断是会先转成 0.0D 所以status != ''也等于 0 = 0.0D,结果是true, 判断就会进不去。
可以更改条件 <if test="status != null and status != '' or status == 0">
或者删掉条件<if test="status != null and status == 0">
这样就会执行里面的代码了。