动态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>
相关推荐
落羽的落羽2 分钟前
【Linux系统】中断机制、用户态与内核态、虚拟地址与页表的本质
java·linux·服务器·c++·人工智能·算法·机器学习
拄杖忙学轻声码2 分钟前
maven引入本地jar包示例(非仓库引入)
java·maven·jar
lierenvip4 分钟前
Spring Boot 自动配置
java·spring boot·后端
tgethe2 小时前
java并发——1
java·开发语言·面试
coder_zh_2 小时前
Java基础-学习-面试-校招-要点突击检查
java
郑州光合科技余经理2 小时前
海外O2O系统源码剖析:多语言、多货币架构设计与二次开发实践
java·开发语言·前端·小程序·系统架构·uni-app·php
工程师老罗8 小时前
Image(图像)的用法
java·前端·javascript
leo_messi948 小时前
2026版商城项目(一)
java·elasticsearch·k8s·springcloud
美味蛋炒饭.9 小时前
Tomcat 超详细入门教程(安装 + 目录 + 配置 + 部署 + 排错)
java·tomcat
dreamxian9 小时前
苍穹外卖day11
java·spring boot·后端·spring·mybatis