今天遇到个问题,接口入参Integer类型,mybatis传入0老是显示没传入参数,传入其他1,2等值正常;
解决办法:
1. 传参有Integer改成String
2. 去掉mybatis中 做法:去掉【status != ‘’】 的这条非空判断
<if test="status != '' and status != null">
and status = #{status}
</if>
修改成
<if test="status != null">
and status = #{status}
</if>
参考