你的位置:首页 > 软件开发 > Java > 第二章 mybatis使用注解实现in查询(mysql)

第二章 mybatis使用注解实现in查询(mysql)

发布时间:2016-05-13 15:00:08
mybatis实现in查询,两种方法:注解方式(个人喜欢注解,但是in场景可能不太适合注解)代码:1 @Select("<script>"2 + "SELECT IDFA FROM t_xxx WHERE IDFA IN ...

mybatis实现in查询,两种方法:

  • 注解方式(个人喜欢注解,但是in场景可能不太适合注解)

代码:

第二章 mybatis使用注解实现in查询(mysql)第二章 mybatis使用注解实现in查询(mysql)
1   @Select("<script>"2        + "SELECT IDFA FROM t_xxx WHERE IDFA IN "3        + "<foreach item='item' index='index' collection='strList' open='(' separator=',' close=')'>"4          + "#{item}"5        + "</foreach>"6      + "</script>")7   @Results(value = { @Result(column = "user_name", property = "username") })8   public List<String> getXxxList(@Param("strList") List<String> strList);

原标题:第二章 mybatis使用注解实现in查询(mysql)

关键词:MYSQL

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录