<!--批量删除--> <!--delete from person where id in (1,2,3,4)--> <delete id="piliangdel" parameterType="map"> <!-- (1,2,3,4)把他当成一个集合看待 ids--> -- collection 遍历的容器 -- open 开始的语句 -- item 单签遍历的容器中的元素 -- separator 分隔符 -- close 结束的括号 delete from person where id in <foreach collection="ids" open="(" item="id" separator="," close=")" index="index"> #{id} </foreach> </delete>