服務層:
###@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} ##> #頁:
<腳本類型=“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(); ## }); });
<
"0" cellpadding="0" cellspacing="0">
全選 ## "address">提交狀態
序列
登入名稱
確認密碼
##< 固定電話
手機號碼 & td >信箱居住地址 建立時間 … td >作業
## : <
: <for: < "${creditVOList}" varStatus="status">
卷
相信< ;
;
#
##
沒有任何員工資料。
##
#
########### ## ####### ##########服務層:@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
; 全選 | 登入名稱 | 登入密碼 | 確認密碼 | 身分證;td >身分證;td >確認密碼 | 身分證;td >身分證;號 | 固定電話 | 手機號碼 | 信箱 | 住址< /td> | 提交狀態 | 創建時間 | 操作 | ||
${status.index} | ${credit.loginName} | ${credit.loginPwd} | ${credit.againPwd} | ${credit.IDCard} | ${credit.fixedTelephoneNumber} | ${credit.telephoneNumber} | ${credit.email} | ${credit.email} | ${credit.address} | ${credit.status ==0 ? '已提交':'未提交'} | ${ creditVO.createtime} | 刪除 |
以上是mybatis springmvc批量刪除程式碼分享的詳細內容。更多資訊請關注PHP中文網其他相關文章!