service层:
@Override
public void batchDeletes(List list) {
creditDao.batchDeletes(list);
}
控制层controller:
/**
* Batch deletion batch
*/
@RequestMapping(value="/batchDeletes")
@ResponseBody
public List
String items = request.getParameter("creditIdbox");
List
String[] strs = items.split(",");
for (String str : strs) {
delList.add(str);
}
creditService.batchDeletes(delList);
List
ModelAndView mv = new ModelAndView();
Map
model.put("creditVOList", list);
mv.addAllObjects(model);
mv.setViewName("queryregister");
return list;
}
mapper.xml:
DELETE FROM t_credit where t_credit_id in
#{item}
页面:
$(function(){
$("#button").click(function(){
var form=$("#registerform");
form.prop("action","http://localhost:8080/ssmy2/CreditController/intiqu.do");
form.submit() ;
});
//Method 2:
/*$(function(){
## $("#button").click(function(){
document.registerform.action="http://localhost:8080/ssmy/CreditController/intiqu.do";
document.registerform.submit();
});**/
//Determine the dead state of the query button
$("#status").val($("#statushidden").val());
});
function selectAll(){
if ($("#SelectAll").is(":checked")) {
$ (": Checkbox"). Prop ("Checked", TRUE); // Select all the selection boxes
} Else {
$(":checkbox").prop(""checked", false); }
##$(function(){
$("#deleteuser").click(function() {
//Check that at least one item has been written
var checkedNum = $("input[name='creditIdbox']:checked" ).length;console.log(checkedNum);
if(checkedNum==0){
alert("Please select at least one item!");
alert("Please select at least one item!");
# if(confirm("Are you sure to delete the selected item?")){
$ ("INPUT [name = 'creditidbox']: Checked"). );
## ); # $.ajax({
type:"POST",
## url:"http://localhost:8080/ssmy2/CreditController /batchDeletes.do",
use with using using ’ through through through out through out out through out out through out out out through out out’'s' out’s ’ ’ s ‐ ‐ ‐ ‐ ‐ ‐ n ‐ through – – data:{"creditIdbox":checkedList.toString()},
## . success:function(data){
$("[name='creditIdbox']:checkbox").attr("checked",false);
Alert ('Delete success!');
## stettimeout ("local##
# /* 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();
## });
$("#delete").click(function(){
var form =$("#registerform");
## 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();
## });
});
##
# & LT; input Type = "Hidden" name = "Status" ID = "Statushidden" Value = "$ {Status}" /& gt; # "0" cellpadding=0 # ="margin-right:5px;"/>Select all # ## td > Email address "address">Submission status ## ## "${creditVOList}" varStatus="status"> ## ## & LT; TD & GT; $ {Credit.telephonumber} & lt;/td & gt; # & LT; TD & GT; $ {Credit.email} ## 没有任何员工信息. service层:@Override public void batchDeletes(List list) { creditDao.batchDeletes(list); } 控制层controller/** * Delete batch batch*/ @RequestMapping(value="/batchDeletes") @ResponseBody public ListCredit> batchDeletes(HttpServletRequest request,HttpServletResponse response){ String items = request.getParameter("creditIdbox"); ListString> delList = new ArrayListString>(); String[] strs = items.split(","); for (String str : strs) { delList.add(str); } creditService.batchDeletes(delList); ListCredit> list=creditService.queryUserInfo(null); ModelAndView mv = new ModelAndView(); MapLand-line number
${credit.status ==0 ? '已提交':'未提交'}
${creditVO.createtime}
Select all
Login name Login password Confirm password ID card No. Landline number Mobile phone number E-mail address Residential address
Submit status Creation time Operation ${status.index} ${credit.loginName} ${credit.loginPwd} ${credit.againPwd} ${credit.IDCard} ${credit.fixedTelephoneNumber} ${credit.telephoneNumber} ${credit.email} ${credit.address} ${credit.status ==0 ? 'Submitted':'Not submitted'} ${ creditVO.createtime} Delete
The above is the detailed content of mybatis springmvc batch deletion code sharing. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool