<mapper namespace="com.liulei.garbagesorting.mapper.UserCollectionMapper">
<select id="getCollectionsByQuestionListAndOpenId" resultType="com.liulei.garbagesorting.pojo.UserCollection">
SELECT * FROM user_collection
WHERE question_id IN
<foreach collection="questionList" item="questionId" open="(" separator="," close=")">
#{questionId}
</foreach>
AND open_id = #{openId}
</select>
</mapper>
mabatis查询数据是在集合中
最新推荐文章于 2024-08-08 23:24:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)