<select id="getList" resultType="demo.Bean">
select * from user
where user_name REGEXP concat('(^|,)(',
concat_ws('|',
<foreach collection="ids" item="item" open="" close="" separator=",">
#{item}
</foreach> ),')(,|$)')
</select>
06-11
2829
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)