`

Ibatis查询Iterate的使用

阅读更多
<!-- Iterate的使用,根据多个匹配条件查询,类似in(a,b,c)-->
<select id="selectByIterate" parameterClass="java.util.List" resultClass="user">
 SELECT * FROM USERS WHERE USER_ID IN
 <iterate conjunction="," open="(" close=")">
  #ids[]#
 </iterate>
</select>
注意:不要property属性,否则报错。String index out of range: -1
但是,若参数有多个传入的一个是List,另一个不是, parameterClass为map时,需要property属性区分要遍历的  集合。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics