Heim  >  Artikel  >  Java  >  Freigabe des Batch-Löschcodes für Mybatis SpringMVC

Freigabe des Batch-Löschcodes für Mybatis SpringMVC

巴扎黑
巴扎黑Original
2017-07-24 13:50:592363Durchsuche

service层:

 

@Override

public void batchDeletes(List list) {

creditDao.batchDeletes(list);

 

}

控制层controller:

 

/**
* Batch-Löschbatch
*/
   @RequestMapping(value="/batchDeletes")
   @ResponseBody
   öffentliche Liste batchDeletes(HttpServletRequest request,HttpServletResponse Antwort){
       String items = request.getParameter("creditIdbox");
       List delList = new ArrayList();
       String[] strs = items.split(",");
       for (String str : strs) {
           delList.add(str);
       }
       creditService.batchDeletes(delList);
       Liste 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}   

         

   

页面: