动态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>

在这里插入图片描述

相关推荐

  1. 软件工程 补充 复刻

    2024-07-12 20:00:03       62 阅读
  2. Element-ui el-table组件//跨页勾讲解

    2024-07-12 20:00:03       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 20:00:03       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 20:00:03       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 20:00:03       58 阅读
  4. Python语言-面向对象

    2024-07-12 20:00:03       69 阅读

热门阅读

  1. ListView

    ListView

    2024-07-12 20:00:03      17 阅读
  2. 低代码:架起产教融合的“立交桥”

    2024-07-12 20:00:03       23 阅读
  3. Vue使用vue-cropper裁剪图片作头像

    2024-07-12 20:00:03       22 阅读
  4. RuoYi-Vue3不启动后端服务如何登陆?

    2024-07-12 20:00:03       21 阅读
  5. mysql8 锁表与解锁

    2024-07-12 20:00:03       19 阅读
  6. 如何部署本地dockers镜像源

    2024-07-12 20:00:03       20 阅读
  7. CAD二次开发(12)- 块的定义和使用

    2024-07-12 20:00:03       17 阅读
  8. MySQL在Windows系统上的详细安装指南

    2024-07-12 20:00:03       17 阅读