mybatis springmvc批量刪除程式碼分享
Jul 24, 2017 pm 01:50 PM服務層:
###@Override
public void batchDeletes(List list) {
##creditDao.batchDeletes(list);#
#}#控制層控制器:
##
/**
* 批次刪除 batch
*/
# @RequestMapping(value="/batchDeletes")
@ResponseBody
## 公用清單 batchDeletes(HttpServletRequest 請求,HttpServletResponse 回應){
## String items = request.getParameter("creditIdbox");##String();
String[] strs = items.split(",");
for (String str : strs) {
delList.add(str);
# }
# # creditService。 列出; list=creditService.queryUserInfo(null);
ModelAndView mv = new ModelAndView();
Map
model.put("creditVOList", list);
mv.addAllObjects(model);
mv.addAllObjects(model);
# mv.setViewName("queryregister");
# return list;
}
mapper.xml:
DELETE FROM t_credit where t_credit_id in . "item" open="("separator=","close=")"> #{item} ##> #頁: <script type="text/javascript" src="../easyui/jquery.easyui.min.js ?1.1. 11"></script> <script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN. js?1.1 .11" ></script> <script type="text/javascript" src="../easyui/js/index.js?1.1 .11" ></script> <link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui .css? 1.1.11"/> <link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css ?1.1.11 " //> <腳本類型=“text/javascript”> $(function(){ $("#button").click(function(){ var form=$("#registerform"); form.prop("action","http://localhost:8080/ssmy2/CreditController/intiqu.do"); # form.submit() ; #}); //方式二: /*$(function(){ $("#button").click(function(){ # document.registerform.action="http://localhost:8080/ssmy/CreditController/intiqu.do"; document.registerform.submit();
});**/ # //定死查詢按鈕 $("#status").val($("#statushidden").val()); }); function selectAll(){ if ($("#SelectAll").is(":checked")) { $(":checkbox").prop("checked", true);//所有選擇方塊都選取 } else { # } else { # } else { # } else { # } else { # } else { # }” ## $(":checkbox").prop("checked", false); data:{"creditIdbox":checkedList.toString()}, # success:function(data){ $("[name='creditIdbox']:checkbox").attr("checked",#name='creditIdbox']:checkbox").attr("checked",#se='creditIdbox']:checkbox").attr("checked",#se='credit ## alert('成功中!'); }, # alert('刪除失敗!'); } 與 # # /* var form=$("#registerform"); form.prop("action","http://localhost:8080/ssmy/CreditController/deleteuser.do" ); form.submit(); */ }); $ ("#exports").click(function(){ var form =$("#registerform"); # form. prop("action","http://localhost:8080/ssmy2/CreditController/exprotExcel.do"); form.submit(); # form.submit(); # $("#delete").click(function(){ var form =$("#registerform"); form.prop("action","http://localhost:8080/ssmy2/ CreditController/batchDeletes.do?creditIdbox=${credit.creditId}"); form.submit(); # ## }); # $("#uploadFile").click(function(){ var form =$("#registerform"); form.prop("action","http://localhost:8080/ssmy2/CreditController/uploadFile.do"); form.submit(); ## }); }); </script> </head> <body> <div id="head"> <form id="registerform" name ="registerform" action="" method="post" enctype="multipart/form-data"> <div class="search-box" style="width:100%;height:40px;"> <label> 登录名: </label> <input type="text" name="loginName" id="loginName" /> <label style="margin-left:10px;">身份证:</label> <input type="text" name="IDCard" id="IDCard" /> <label style="margin-left:10px;"> 提交状态:</label> <select id="status" name="status" style="width:100px;height:20px;"> <option value="">全部</option> <option value="0">已提交</option> <option value="1">未提交</option> </select> <input type="button" id="button" value="查询" style="width:65px;height:22px;margin-left:20px;"/> <input type="submit" id="exports" value="导出" style="width:65px;height:22px;margin-left:20px;"/> </div> <input type="hidden" name="status" id="statushidden" value="${status }" /> <input type="hidden" name="totalcount" id="totalcount" value="${totalcount }" /> < "0" cellpadding="0" cellspacing="0"> <tr style="width:100%; height: 50px;"> <td> <input type="checkbox" id="SelectAllon name="Selectlect" ="margin-right:5px;"/>全選</td> <td>序列</td> <td >登入名稱</td> <td 登入密碼< # <td >確認密碼</td> <td >##< <td >固定電話</td> <td >手機號碼</td> <td >居住地址</td> ## "address">提交狀態</td> <td >建立時間</td> … td >作業</td> </tr> ## : < for: < "${creditVOList}" varStatus="status"> 卷<td><input type="checkbox" name="creditIdbox" id="creditIdbox" value="${credit.creditId }"></td>
<td>${status.index}</td> <td> ## <td>${credit.loginPwd}</td> <td> <td>${credit.IDCard}</td> 相信< ; <td>${credit.telephoneNumber}</td> ; </td> <td id="address">${credit.address}</td> ${credit.status ==0 ? '已提交':'未提交'}
#
##
沒有任何員工資料。 <br/>
<input type="button" value="刪除" id ="deleteuser" >
##
#
########### ## ####### ##########服務層:@Override public void batchDeletes(List list) {creditDao.batchDeletes(list); } 控制層controller/** * 批次刪除 batch*/ @RequestMapping(value="/batchDeletes") @ResponseBody public List#Credit >batchDeletes(HttpServletRequest request,HttpServletResponse response){ String items = request.getParameter("creditIdbox");列表#String> delList = new ArrayList >(); String[] strs = items.split(","); for (String str : strs) { delList.add(str); } CreditService.batchDeletes(delList); List##Credit> list=creditService.queryUserInfo(null); ModelAndView mv = new ModelAndView();映射 model = new HashMap
以上是mybatis springmvc批量刪除程式碼分享的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱門文章

熱門文章

熱門文章標籤

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)