mybatis map 遍历

 

 mybatis 中对 map 进行 遍历

<select id="getTableDataByFilter" resultType="Map">
select *
from ${tableName}
where 1 = 1
<if test="map != null">
<foreach collection="map.entrySet()" item="value" index="key" separator=";" >
and ${key} in (#{value})
</foreach>
</if>
limit #{count}
</select>

posted @   小匠人  阅读(594)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示