动态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>
相关推荐
郝学胜-神的一滴1 小时前
设计模式依赖于多态特性
java·开发语言·c++·python·程序人生·设计模式·软件工程
测试人社区—小叶子1 小时前
DevTestOps成熟度模型:从CI/CD到质量门禁
java·运维·网络·人工智能·测试工具·ci/cd·自动化
陌sr,1 小时前
关于TMK的生成及安全注入方式
android·运维·服务器·安全·pos机·edc·刷卡
honder试试1 小时前
客户端连接Clickhouse连不上解决方案
java·clickhouse
lang201509281 小时前
深入解析Sentinel熔断机制
java·前端·sentinel
键来大师1 小时前
Android16 RK3576 系统清理缓存
android·缓存·framework·rk3588·android15
全粘架构师1 小时前
五分钟精通RuntimeException
java·exception
故渊ZY1 小时前
JVM栈帧深度解析:规范与实战
java·栈帧
流绪染梦1 小时前
多表联查时处理一对多的信息,将子表字段放入数组
java·数据库
Arva .1 小时前
G1收集器
java·jvm·算法