您的位置:首页 > 其它

mybatis使用in查询

2016-10-18 13:43 239 查看
dao中的方法

public List<Long> getListInId(List<Long> list);

mapper文件中的配置

<select id="getListInId" parameterType="java.lang.Long"
resultType="java.lang.Long">
select id from student where id in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mybatis