动态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>
相关推荐
sinat_2554878125 分钟前
IDEA:查找文件/类
java·ide·设计模式·intellij-idea
Flynt33 分钟前
升级Flutter 3.44,我踩了HCPP和AGP 9的坑
android·flutter·dart
AI人工智能+电脑小能手1 小时前
【大白话说Java面试题 第77题】【Mysql篇】第7题:回表查询与全表扫描的区别?
java·开发语言·数据库·mysql·面试
lulu12165440781 小时前
Claude Code SpringBoot技能体系架构设计与演进
java·人工智能·spring boot·后端·ai编程
白色牙膏1 小时前
Cocos Creator 2.4.x 接入 AdMob 插件的迁移实践
android
callJJ1 小时前
Nacos 详解——从概念到实战
java·spring boot·spring·spring cloud·微服务·nacos
小马爱打代码2 小时前
Spring源码 第三篇:Spring 源码深度拆解:循环依赖 + 三级缓存
java·spring·缓存
罗超驿2 小时前
5.Java线程创建全攻略:5种写法 + 高频面试题解析
java·开发语言·java-ee
阿维的博客日记2 小时前
怎么理解Filter不是在afterCompetition里面remove掉ThreadLocal里面的东西,而是说在finally块里面remove
java
Simon523142 小时前
反射------5.26学习小计
java·开发语言·spring boot