动态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>
相关推荐
phltxy5 小时前
C语言操作符详解
java·c语言·算法
91刘仁德6 小时前
MYSQL 事务原理及使用
android·mysql·adb
步行cgn6 小时前
@Configuration 详解:Spring 配置类的核心注解
java·后端·spring
sunshine22 girl6 小时前
Java学习一 环境配置2 安装和基本使用Idea
java·学习·intellij-idea
一笑的小酒馆7 小时前
AndroidKMP之瀑布流实现
android
RainyJiang7 小时前
AI时代下,Android的边界正在消失
android·openai·ai编程
嘿嘿-668 小时前
Windows 一键使用 GPT-6 Astra:Codex CLI 配置教程
java·人工智能·windows·gpt·chatgpt·web
Android-Flutter8 小时前
android 内存抖动详解
android
策案案案9 小时前
YOLO: 将AI Agents嵌入到IntelliJ IDEA
java·大数据·人工智能·笔记·yolo·microsoft·intellij-idea
方白羽10 小时前
为什么 Android 非要用 Intent 传值?
android·ios·harmonyos