Parameter 'PartnerCode' not found. Available parameters are [collection, lis] 报错
注意: 1.变量时item #{item}中必须填写一样的
2.collection=“list”
<select id="getEmpsByConditionForeach" resultType="com.mybatis.bean.Employee">
select * from tb1_employee where id in
<!--
collection:指定要遍历的集合
List类型的参数会特殊处理在map中,map的key就叫list
Array数组类型的参数会特殊处理在map中,map的key就叫array
item:将当前遍历的元素赋值给指定的变量
separator:每个元素之间的分隔符
open:遍历出所有结果拼接一个开始的字符
close:遍历出所有结果拼接一个结束的字符
index:索引。遍历list的时候是索引,item就是当前值
遍历map的时候,index是key,item就是map的值
#{变量名}就能取出变量的值,也就是当前遍历出的元素
-->
<foreach collection="List" item="item" separator="," open="(" close=")" index="index">
#{item}
</foreach>
</select>
还没有评论,来说两句吧...