首页 > 技术文章 > mybatis代码自动生成的where-if 查询Integer类型不生效问题

zxh-xy 2019-08-11 12:16 原文

查询语句:
<if test="intoIsPassed != null and intoIsPassed != '' "> and r.into_is_passed = #{intoIsPassed, jdbcType=INTEGER} </if>

  数据库内容:

postman查询条件:

查询结果:

"intoIsPassed": 1,
中途没有任何报错!!!!!!
修改:去掉后面判断部分
查询语句:
<if test="intoIsPassed != null "> and r.into_is_passed = #{intoIsPassed, jdbcType=INTEGER} </if>

查询成功!结果为:

更改条件:

 

至此,结束。

 

推荐阅读