mybatis if test 条件参数为0 语句为加入到查询语句中解决

在mybatis查询时。遇到这种如果传进来的的status值为0 ,直接跳出if不执行,
在这里插入图片描述

问题在于status参数类型
’’ != status 只能作用于string,int 、double、float等类型的参数默认值为0 ,将直接跳出if,
删掉后面的空字符串判断即可
改为
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/TrayLei/article/details/84579212