1. List<?>对象

dao接口:

int batchDelete(List<String> ids);

mapping.xml:

<delete id="batchDelete" parameterType="java.util.List">
	delete from test where test_id in
	<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
		#{item}
	</foreach>
</delete>

2. 数组对象

dao接口:

int batchDelete(String[] ids);

mapping.xml:

<delete id="batchDelete" parameterType="java.lang.String">
	delete from test where test_id in
	<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
		#{item}
	</foreach>
</delete>

3. 多参数批量操作

请移步MyBatis多参数批量操作

4. 属性说明