在mybatis查询时。遇到这种如果传进来的的status值为0 ,直接跳出if不执行,
<if test="null != status and "" != status">
...
</if>
问题在于status参数类型
’’ != status 只能作用于string,int 、double、float等类型的参数默认值为0 ,将直接跳出if,
删掉后面的空字符串判断即可
改为
<if test="null != status">
...
</if>
在mybatis查询时。遇到这种如果传进来的的status值为0 ,直接跳出if不执行,
<if test="null != status and "" != status">
...
</if>
问题在于status参数类型
’’ != status 只能作用于string,int 、double、float等类型的参数默认值为0 ,将直接跳出if,
删掉后面的空字符串判断即可
改为
<if test="null != status">
...
</if>