动态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>
相关推荐
callJJ14 小时前
SQL 调优完全指南 —— 从入门到实战
数据库·sql·调优·慢查询
Full Stack Developme14 小时前
Spring Context 解析
java·spring·rpc
程序员陆业聪14 小时前
Android插件化江湖:从DroidPlugin到Shadow的技术演进
android
爱棋笑谦14 小时前
热部署简述
java
敲代码的瓦龙14 小时前
Android?广播!!!
android·java·开发语言·android-studio
磊 子14 小时前
1.2内存的存储金字塔
java·开发语言·spring·操作系统
逆境不可逃15 小时前
Hello-Agents 第二部分-第四章总结:智能体经典范式构建-包含习题解析和Java版
java·开发语言·javascript·人工智能·分布式·agent
ChoSeitaku15 小时前
08_抽象_接口_final关键字_多态
java·开发语言
Seven9715 小时前
dubbo服务暴露源码
java
黄林晴15 小时前
Android Studio Quail 1 Canary 5 发布,Compose 截图测试 + R8 混淆 mapping 问题解决
android·android studio