引用
Ibatis动态Sql语句 -- iterator
需求:从查询列表中删除被选中记录(复选框)。
String[] checkedIds = request.getParameterValues("checkId"); ... List<String> paramList = new ArrayList<String>(); paramList = Arrays.asList(checkedIds); sqlMapClientTemplate.delete("person.deletePersons", paramList);
<delete id="deletePersons" parameterClass="list"> DELETE FROM PERSON WHERE ID IN <iterate open="(" close=")" conjunction=","> #[]# </iterate> </delete>