Mybatis中Integer类型在mapper.xml中使用

注意Integer类型如果是0的话,等价于空字符串,所以需要添加0值判断
<if test="query.status != null and query.status !='' or query.status == 0"> AND sdr.STATUS=#{query.status} </if>

posted @ 2021-07-30 16:09  有点儿放松  阅读(401)  评论(0)    收藏  举报