动态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>
相关推荐
阿pin2 小时前
Java随笔-ConcurrentHashMap
java·开发语言·哈希算法
C+-C资深大佬3 小时前
Java 变量:从入门到精通
java·开发语言·python
Flittly3 小时前
【日常小问】Docker 部署 Nacos 2.4.3,Dubbo 3.3 连接 Config Service 失败排查
java·spring boot·dubbo
kuonyuma4 小时前
java之动态代理
java·开发语言
衔烛之龙14 小时前
Windows x64 构建 liboqs-java教程
java·windows·python
鱼儿也有烦恼4 小时前
01.搭建Android Studio开发环境
android·android studio
一路向北North4 小时前
Spring Security OAuth2.0(20):完善环境配置
java·后端·spring
Java面试题总结4 小时前
IntelliJ IDEA 从卡顿到起飞,只用改这些。。。
java·ide·intellij-idea
兰令水4 小时前
hot100【acm版】【2026.7.11/12打卡-java版本】
java·开发语言·数据结构·算法·职场和发展
Misnearch4 小时前
nacos配置管理改造
java·spring cloud·nacos