动态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>
相关推荐
奋进的孤狼19 分钟前
【Java】在一个前台界面中动态展示多个数据表的字段及数据
java·数据库·oracle
穷人小水滴27 分钟前
Android 运行 deno 的新方法 (3): Termux 胖喵安初
android·linux
穷人小水滴35 分钟前
7 天充电宝计划 (小实验)
android·linux
IT利刃出鞘1 小时前
Intellij Idea--解决Cannot download “https://start.spring.io‘: Connect timedout
java·ide·intellij-idea
中国lanwp1 小时前
Spring 全局异常处理机制:多个 @ControllerAdvice 与重复 @ExceptionHandler
java·数据库·spring
Ashlee_code1 小时前
关税战火中的技术方舟:新西兰证券交易所的破局之道 ——从15%关税冲击到跨塔斯曼结算联盟,解码下一代交易基础设施
java·python·算法·金融·架构·系统架构·区块链
yh云想2 小时前
SQL 四大语言分类详解:DDL、DML、DCL、DQL
数据库·sql·oracle
hqxstudying3 小时前
SpringBoot启动项目详解
java·spring boot·后端
你我约定有三3 小时前
分布式微服务--Nacos作为配置中心(补)关于bosststrap.yml与@RefreshScope
java·分布式·spring cloud·微服务·架构
keepDXRcuriosity4 小时前
IDEA识别lombok注解问题
java·ide·intellij-idea