动态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>
相关推荐
heartbeat..34 分钟前
数据库基础知识体系:概念、约束、范式与国产产品
java·数据库·学习笔记·国产数据库
PXM的算法星球1 小时前
【操作系统】哲学家就餐问题实现详解
java
2301_815357701 小时前
Java项目架构从单体架构到微服务架构的发展演变
java·微服务·架构
Ethan-D1 小时前
#每日一题19 回溯 + 全排列思想
java·开发语言·python·算法·leetcode
山峰哥1 小时前
数据库工程核心:SQL调优让查询效率飙升的实战密码
网络·汇编·数据库·sql·编辑器
Echoo华地1 小时前
idea运行程序默认线程为daemon线程的问题
java·ide·intellij-idea
歪楼小能手2 小时前
Android16系统go版关闭重力旋转开关后缺失手动旋转屏幕悬浮按钮
android·java·平板
Coder_Boy_2 小时前
基于SpringAI的在线考试系统-DDD业务领域模块设计思路
java·数据库·人工智能·spring boot·ddd
曹轲恒2 小时前
SSM项目的部署
java·ssm
崇山峻岭之间2 小时前
Matlab学习记录37
android·学习·matlab