动态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>
相关推荐
摇滚侠13 小时前
浏览器调试工具 检查元素 谷歌模拟器 控制台 断点调试
java·html
aaajj13 小时前
【Android】手机屏幕劫持防护
android·智能手机
心之伊始13 小时前
Spring Boot 接入 MCP 实战:用 Spring AI 调用本地工具的最小闭环
java·spring boot·agent·spring ai·mcp
写做四月一日的四月一日13 小时前
在安卓手机上安装小龙虾openclaw并配置QQ机器人接入
android·人工智能
Refrain_zc13 小时前
无触摸屏场景下的蓝牙交互:Android 纯按键蓝牙扫描配对与 A2DP/Headset 连接
java·蓝牙
计算机安禾13 小时前
【算法设计与分析】第29篇:启发式与元启发式搜索方法综述
java·数据库·算法
DIY源码阁13 小时前
JavaSwing学生选课系统 - MySQL版
java·数据库·mysql·eclipse
流星白龙13 小时前
【MySQL高阶】6.MySQL数据目录,日志
android·mysql·adb
福大大架构师每日一题13 小时前
rust 1.96.0 更新:语言、编译器、Cargo、Rustdoc、兼容性全面升级,必看完整解读
android·开发语言·rust