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 @ 2022-02-18 11:26  小匠人  阅读(551)  评论(0编辑  收藏  举报