dao接口:java
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>
dao接口:app
int batchDelete(String[] ids);
mapping.xml:ide
<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>
请移步MyBatis多参数批量操做code