动态sql 单选变多选

实体类

添加数组存储值

private ArrayList tssjfjList;

复制代码
<!--            <if test="tssjfj != null  and tssjfj != ''">and tssjfj = #{tssjfj}</if>-->

            <if test="tssjfjList != null and tssjfjList.size() > 0">
                AND tssjfj IN
                <foreach item="item" index="index" collection="tssjfjList" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>

存在循环且模糊匹配的情况

复制代码
  <if test="corpbqList != null and corpbqList.size() > 0">
                AND (
                <foreach item="item" index="index" collection="corpbqList" open="(" separator=" OR " close=")">
                    typed LIKE CONCAT('%', #{item}::text, '%')
                </foreach>
                )
            </if>
相关推荐
Digitally6 分钟前
如何将联系人从 Android 转移到 Android
android
云烟成雨TD32 分钟前
Spring AI Alibaba 1.x 系列【5】ReactAgent 构建器深度源码解析
java·人工智能·spring
最初的↘那颗心36 分钟前
Agent 实战:构建第一个 Agent 与记忆系统设计
java·大模型·agent·spring ai·记忆系统
Y0011123637 分钟前
MySQL-进阶
开发语言·数据库·sql·mysql
程序猿_极客37 分钟前
SpringBoot 三大参数注解详解:@RequestParam @RequestBody @PathVariable 区别及常用开发注解
java·spring boot·后端·面试八股文·springboot注释
小胖java42 分钟前
校园通衢公告枢纽系统
java·spring boot
Crazy________43 分钟前
docker4.8
java·开发语言·eureka
cch89181 小时前
Laravel 2.x:早期框架的奠基之路
java·开发语言
李小枫1 小时前
webflux接收application/x-www-form-urlencoded参数
android·java·开发语言
爱丽_1 小时前
MySQL `EXPLAIN`:看懂执行计划、判断索引是否生效与排错套路
android·数据库·mysql