动态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>
相关推荐
SunnyDays101114 小时前
Java 合并 Excel 文件的几种实用方法
java·合并 excel
t***54414 小时前
如何确认 Clang 是否在 Dev-C++ 中成功应用
java·开发语言·c++
m0_7520356314 小时前
idea的debug configurations里面的shorten command line作用
java·ide·intellij-idea
一顿操作猛如虎,啥也不是!14 小时前
VISUAL STUDIO和IDEA-c#和java调试快捷键
java
一 乐14 小时前
智慧社区|基于Python + Django智慧社区系统(源码+数据库+文档)
java·数据库·python·django·论文·毕设·智慧社区系统
不会吉他的肌肉男不是好的挨踢男14 小时前
Windows 下安装 sqlBot
sql·ai·大模型·bi
WL_Aurora14 小时前
排序算法(二)
java·算法·排序算法
天码-行空14 小时前
深入拆解Tomcat架构:多层容器设计原理
java·架构·tomcat
人道领域15 小时前
【Redis实战篇】秒杀系统:一人一单高并发实战(synchronized锁实战与事务失效问题)
java·开发语言·数据库·redis·spring