动态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>
相关推荐
鹏晨互联7 分钟前
《Android 自定义 WebView 组件:从封装到路由,打造灵活可复用的混合开发利器》
android
yaoxin5211239 分钟前
390. Java IO API - WatchDir 示例
java·前端·python
程序员陆业聪25 分钟前
AI Code Review:让每一行代码都有AI审查员
android
程序员陆业聪25 分钟前
AI Bug修复与测试生成:从崩溃日志到修复PR的自动化 | AI提效Android开发(5)
android
诸神黄昏EX32 分钟前
Android Google Widevine
android
Halo_tjn2 小时前
Java 基于字符串相关知识点
java·开发语言·算法
梦想的颜色2 小时前
java 利用redis来限制用户频繁点击
java·开发语言
PH = 73 小时前
OverlayFS联合文件系统使用示例
java·linux·服务器
HealthScience3 小时前
【Bib 2026】基因最新综述(有什么任务、benchmark、代表性模型)
android·开发语言·kotlin
AC赳赳老秦3 小时前
OpenClaw进阶技巧:批量修改文件内容、替换关键词,解放双手
java·linux·人工智能·python·算法·测试用例·openclaw