<select id="selectTestForEach" parameterType="News" resultMap="NewsResultMapper">
select * from t_news n where
<foreach collection="listTag" index="index" item="tag" open="("
separator="," close=")">
#{tag} in n.tags
</foreach>
foreach 生成的效果是集合 转化为下面的
select * from t_news n where ( ? in n.tags , ? in n.tags )
mybatis foreach标签
猜你喜欢
转载自417755712.iteye.com/blog/2261034
今日推荐
周排行