Heim > Java > javaLernprogramm > Hauptteil

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

巴扎黑
Freigeben: 2017-07-24 13:50:59
Original
2368 Leute haben es durchsucht

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}   

         

   

页面:

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage