动态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>
相关推荐
zopple5 分钟前
Laravel9.X重磅升级:十大核心特性解析
android
zs宝来了17 分钟前
AQS详解
java·开发语言·jvm
私人珍藏库32 分钟前
【windows】跨平台 Android 刷机Root工具箱
android·windows·工具·刷机·软件·多功能
summerkissyou19873 小时前
Android-MediaSession-播放流程和例子
android·mediasession
lulu12165440783 小时前
Claude Code Harness架构技术深度解析:生产级AI Agent工程化实践
java·人工智能·python·ai编程
阿里加多3 小时前
第 1 章:Go 并发编程概述
java·开发语言·数据库·spring·golang
一 乐3 小时前
物流信息管理|基于springboot + vue物流信息管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·物流信息管理系统
2301_792674863 小时前
java学习day29(juc)
java·开发语言·学习
私人珍藏库4 小时前
[Android] 蓝叠模拟器工具箱v1.1
android·智能手机·app·工具·软件·多功能