动态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>
相关推荐
alexhilton4 小时前
MVI 让屏幕一次只有一个状态
android·kotlin·android jetpack
吃我一窝jio5 小时前
Python与Go线程模型深度对比
java·开发语言·python
这个昵称不容易5 小时前
SpringBoot 购物推荐网站的设计与实现:120 个 Java 文件、147 个接口、13 张表,附真实运行截图
java·springboot·毕设
文丑颜不良啊5 小时前
LeetCode3041~3060题目解析
java·leetcode
文丑颜不良啊6 小时前
LeetCode3101~3120题目解析
java·leetcode
Resean02236 小时前
SpringMVC 6+源码分析(十一)视图渲染与异步请求(收尾篇)
java·spring·springmvc
靠沿7 小时前
MySQL数据库进阶——存储过程和触发器
java·数据库·mysql
码少女8 小时前
MySQL--库与表的增删改查基础
java·数据库·mysql
二流小码农9 小时前
鸿蒙开发:证书只能创建3个,第4个应用怎么办
android·ios·harmonyos
Flynt10 小时前
掘金热文说 Spring Boot 4.1 默认开虚拟线程,我实测后发现了更狠的坑
java·spring boot·性能优化