原先查询片段如下,自动生成的代码默认只能全字段匹配查询

 <if test="hobby != null and hobby != ''">
       and HOBBY = #{hobby}
 </if>
 <if test="code != null and code != ''">
       and CODE = #{code}
 </if>

现要对code字段的值实现模糊查询,如下

 <if test="hobby != null and hobby != ''">
        and HOBBY = #{hobby}
 </if>
 <if test="code != null and code != ''">
        and CODE like concat(concat('%',#{code}),'%') 
 </if>

 

相关文章:

  • 2021-07-12
  • 2021-10-16
  • 2021-10-16
  • 2021-08-09
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-28
  • 2021-08-06
  • 2022-03-08
  • 2021-08-04
相关资源
相似解决方案