Home  >  Article  >  Java  >  mybatis springmvc batch deletion code sharing

mybatis springmvc batch deletion code sharing

巴扎黑
巴扎黑Original
2017-07-24 13:50:592377browse

service层:

 

@Override

public void batchDeletes(List list) {

creditDao.batchDeletes(list);

 

}

控制层controller:

 

/**
* Batch deletion batch
*/
   @RequestMapping(value="/batchDeletes")
   @ResponseBody
   public List batchDeletes(HttpServletRequest request,HttpServletResponse response){
       String items = request.getParameter("creditIdbox");
       List delList = new ArrayList();
       String[] strs = items.split(",");
       for (String str : strs) {
           delList.add(str);
       }
       creditService.batchDeletes(delList);
       List list=creditService.queryUserInfo(null);
      ModelAndView mv = new ModelAndView();
      Map model = new HashMap();
      model.put("creditVOList", list);
      mv.addAllObjects(model);
      mv.setViewName("queryregister");
      return list;
   }

mapper.xml:

   

            DELETE FROM t_credit where t_credit_id in

          

            #{item}   

         

   

页面:

##

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn