Home > Java > javaTutorial > body text

mybatis springmvc batch deletion code sharing

巴扎黑
Release: 2017-07-24 13:50:59
Original
2363 people have browsed it

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}   

         

   

页面:

##

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template