**
传入为0的值不生效
**
此处 isFiled 是Integer 类型
<if test="isFiled != null and isFiled != ''">
AND r.is_filed =#{isFiled}
</if>
在MyBatis中自动判断Integer为0时为false,即isActived == ‘’。所以这个判断就不生效了。
只需将字符空值的判断去掉就可以了。
<if test="isFiled != null">
AND r.is_filed =#{isFiled}
</if>
**
数字字符串 排序
**
需要数据库中的某个字段倒序排列,但是那个字段虽然保存的值是数字,但是类型是字符串,故排序无效。
在排序时**+0**,就可以了
order by item+0 desc