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

  数据库内容:

mybatis代码自动生成的where-if 查询Integer类型不生效问题

postman查询条件:

mybatis代码自动生成的where-if 查询Integer类型不生效问题

查询结果:

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

查询成功!结果为:mybatis代码自动生成的where-if 查询Integer类型不生效问题

更改条件:mybatis代码自动生成的where-if 查询Integer类型不生效问题

 

至此,结束。

 

相关文章:

  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-11-26
猜你喜欢
  • 2021-09-28
  • 2021-05-29
  • 2021-06-04
  • 2021-08-13
  • 2021-09-07
相关资源
相似解决方案