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>
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--使用in的多个参数查询。
- mybatis中使用in查询时的注意事项
- 第二章 mybatis使用注解实现in查询(mysql)
- mybatis中使用in查询时的注意事项
- mybatis处理集合、循环、数组和in查询等语句的使用
- mybatis下oracle查询语句where xxx in(aa,bb)的使用方式
- mybatis中使用in查询
- mybatis使用in语句作为查询条件
- mybatis查询sql中in条件使用(foreach)
- mybatis使用foreach语句实现IN查询
- Mybatis 多条件查询(模糊查询 使用in查询)
- mybatis 的 In 查询,子查询 ,集合查询foreach 使用
- 第二章 mybatis使用注解实现in查询(mysql)
- mybatis处理集合、循环、数组和in查询等语句的使用
- mybatis中使用in查询时的注意事项
- Mybatis 中sql 使用in(#{item})无法查询解决办法
- mybatis中使用in查询时的注意事项
- mybatis中使用in查询时的注意事项
- 在mybatis中处理集合、循环、数组和in查询等语句的使用
- mybatis中使用in查询时的注意事项