动态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>
相关推荐
booboosui5 分钟前
记忆装不下时谁删:500 条上限与每回合十行索引
android
会编程的吕洞宾44 分钟前
Spring Cloud Gateway 限流鉴权与灰度发布实战
java·经验分享·后端·spring
AI开源软件2 小时前
SpringCloud+Nacos 业务协同落地:业务调用与集成中心远程管理如何分别配置
java·spring boot
inferno2 小时前
十六、日志管理
数据库·sql·mysql
sharemylove12 小时前
Java集合框架全面详解
java·开发语言·经验分享·笔记·学习
FYKJ_201012 小时前
springboot众创项目团队管理系统94666-计算机课程设计、毕业设计
java·vue.js·spring boot·后端·python·spark·课程设计
摇滚侠14 小时前
《On Java 中文版 基础卷》阅读笔记 内部类 20
java·笔记·python
好的佩奇14 小时前
Dart 之 JSON
android·flutter·dart
_祝你今天愉快15 小时前
Android 事件传递机制:[一] 事件分发机制详解
android
FYKJ_201017 小时前
springboot贫困生认定管理系统59009-计算机毕业设计、课程设计
java·javascript·vue.js·spring boot·后端·django·课程设计