动态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>
相关推荐
seven97_top4 分钟前
两小时入门Sentinel
java·sentinel
叶小鸡4 分钟前
Java 篇-项目实战-AI 天机学堂(从 0 到 1)-day1
java·开发语言
bigbearxyz15 分钟前
Caused by: java.net.SocketException: Connection reset问题排查
java·keepalived·proxysql
500842 小时前
昇腾 CANN 的五层架构,到底分了哪五层
java·人工智能·分布式·架构·ocr·wpf
摇滚侠2 小时前
Java 零基础全套教程,File 类与 IO 流,笔记 177-178
java·开发语言·笔记
plainGeekDev3 小时前
Glide 该换了?Coil:Kotlin 时代的图片加载库
android·开源·kotlin
小a杰.3 小时前
Ascend C编程语言进阶:高性能算子开发技巧
android·c语言·开发语言
雨落在了我的手上3 小时前
初始java(十):类和对象(⼆)
java·开发语言
plainGeekDev3 小时前
Android内存面试题:OOM都解决不了,性能优化从何谈起?
android·面试·kotlin