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