动态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>
相关推荐
geinvse_seg5 分钟前
飞算JavaAI:把企业采购协同需求拆成一套可运行的慧采平台
java·ai·飞算
雨白23 分钟前
嵌套 ScrollView 滑动冲突实战:实现内部优先滚动
android
阿pin29 分钟前
Android随笔-IntentService详解(了解)
android·intentservice
海天鹰1 小时前
content://com.android.externalstorage.documents/document/primary%3A
android
ClouGence1 小时前
跨云、跨地域数据同步,这样更省心
数据库·sql·saas
烛影摇红透纱窗1 小时前
ForkJoinPool 与工作窃取
java
浩瀚地学2 小时前
【面试算法笔记】0302-哈希表-哈希表实现
java·经验分享·笔记·算法·面试
AC赳赳老秦2 小时前
时间开销自动统计:OpenClaw 记录工作任务时长、分析时间分配、给出优化建议
java·大数据·开发语言·python·自动化·deepseek·openclaw
帅帅的记忆2 小时前
uniapp项目调用原生android studio的sdk文件(即aar文件)
android·uni-app·android studio
名侦探7222 小时前
构建 Agent 的五大难点与解决方案
java·大数据·人工智能