<select id="selectMarkIds">
select name from t_user
where user_mark in
<foreach item = "code" collection="userIDs" separator="," open="(" close=")">
#{code}
</foreach>
</select>
MySQL中使用In()函数中使用foreach 循环
MyBatis批量查询示例
最新推荐文章于 2023-07-31 20:21:33 发布
本文介绍了一种使用MyBatis进行批量查询的方法。通过<foreach>标签实现参数遍历,有效地提高了数据库查询效率。适用于需要大量查询用户信息的场景。
963

被折叠的 条评论
为什么被折叠?



