动态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>
相关推荐
rocpp1 小时前
Android 多语言切换实战:从 Context 到 Android 13 应用语言适配
android·kotlin
释然小师弟2 小时前
Android开发十年:反思与回顾
android·后端·嵌入式
用户298698530143 小时前
Word 文档字符级格式化:Java 实现方案详解
java·后端
笨鸟飞不快4 小时前
从单个服务到集群:一次完整的性能排查复盘
java·前端
荣码4 小时前
用Streamlit给AI应用套个界面,10行代码出Web页面
java·python
SamDeepThinking4 小时前
Java微服务练习方式
java·后端·微服务
黄林晴4 小时前
用了这么久 Koin Scope,原来一直都用错了?
android·kotlin
朦胧之14 小时前
AI 编程-老项目改造篇
java·前端·后端
爱勇宝17 小时前
我做了一个只用来搜歌词的小 App
android·前端·后端
程序猿大帅19 小时前
别再只当调包侠了:用 Spring AI 落地 Function Calling,我被大模型硬生生砸出了三个大坑
java