首先在pom.xml文件添加依赖:
<!-- bean工具 -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
mapper.xml:
<delete id="deleteFormTemplate" parameterType="com.activiti.entity.TblAssActivitiFormTemplate">
delete from
asura.tbl_ass_activiti_form_template
where
aft_id in
<foreach item="aftIdArray" collection="array" open="(" separator=","
close=")">
#{aftIdArray}
</foreach>
</delete>
mapper.java:
Integer deleteFormTemplate(Integer[] aftId);
serviceImpl:
@Override
public Integer deleteFormTemplate(HttpServletRequest request) {
String[] aftIdStringArray = request.getParameter("aftIdList").split(",");
//将String数组转成Integer数组
Integer[] aftIdArray = (Integer[])ConvertUtils.convert(aftIdStringArray, Integer.class);
Integer status = formTemplateMapper.deleteFormTemplate(aftIdArray);
return status;
}
controller.java:
Integer status = formTemplateService.deleteFormTemplate(request);