关于mybatis中,<foreach item=“xxx“ index=“xxx“ collection=“xxx“ separator=“xxx“>详解
(1)collection = “” ,这个参数是 dao 层(mapper)接口方法里面传过来的集合参数,如果dao 层传的参数只有一个,这里写关键字 list(如果是数组,写 array)
例子:
dao 层:User getInfo(List user_ids)
collection = “list”
【
如果有多个参数,并且使用了 @Param 注解(import org.apache.ibatis.annotations.Param),则这里要写注解里面的参数!
例子: dao 层 :User
原创
2020-07-24 10:02:54 ·
2443 阅读 ·
0 评论