XXXMapper.xml
<delete id="deleteAlarmInfo" parameterType="java.util.List">
DELETE FROM t_alarm where id in
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
serviceImpl类中业务处理
List<String> list = new ArrayList<String>();
String[] str = ids.split(","); //ids为传来的用逗号隔开的多个ID的字符串
//将String转化为List
for (int i = 0; i < str.length; i++) {
list.add(str[i]);
}
alarmDao.deleteAlarmInfo(list);