当前位置:网站首页>Chapter 3 business function development (delete clues)
Chapter 3 business function development (delete clues)
2022-07-26 02:28:00 【Make a light】
1. Analyze according to functional requirements , The parameters for deleting thread transmission are id, Because multiple parameters can be deleted at the same time , So the parameter passed should be string data . The return value is int type
ClueMapper Interface

2.ClueMapper.xml file
<delete id="deleteClueById" parameterType="string">
delete from tbl_clue
where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
3.ClueService Interface
![]()
4.ClueServiceImpl class

5.ClueController
@RequestMapping(value = "/workbench/clue/removeClueChecked.do")
@ResponseBody
public Object removeClueChecked(String[] id){
ReturnObject returnObject=new ReturnObject();
try{
int i = clueService.removeClueChecked(id);
if (i>0){
returnObject.setCode(Contants.RETURN_OBJECT_CODE_SUCCESS);
}else {
returnObject.setCode(Contants.RETURN_OBJECT_CODE_FAIL);
returnObject.setMessage(" The system is busy , Please try again later !");
}
}catch (Exception e){
e.printStackTrace();
}
return returnObject;
}6.clue Of index.jsp page
js Code
// Add a delete event to the delete button
$("#removeClueBtn").click(function () {
// Collection parameters
var checkedIds=$("#tBody input[type='checkbox']:checked");
// validate form
if (checkedIds.size()==0){
alert(" Please select the campaign to delete !");
return;
}
var ids="";
$.each(checkedIds,function () {
ids+="id="+this.value+"&";
});
ids=ids.substr(0,ids.length-1);
if (window.confirm(" Are you sure to delete ?")) {
// Send a request
$.ajax({
url: "workbench/clue/removeClueChecked.do",
type: 'post',
dataType: 'json',
data:ids,
success:function (data) {
if (data.code=='1'){
queryClueByConditionForPage(
$("#demo_page").bs_pagination("getOption","currentPage"),
$("#demo_page").bs_pagination("getOption","rowsPerPage")
);
} else {
alert(data.message);
}
}
});
}
});A functional test
Select any piece of data , Click the delete button

After confirmation of brushing , Refresh the page

边栏推荐
- 2022-07-17
- Pinia的数据持久化插件 pinia-plugin-persist
- A pluggable am335x industrial control module onboard WiFi module
- Primary key b+ tree, secondary index b+ tree and corresponding query process analysis
- Project management: lean management method
- Brief introduction and use of NPM link
- Pinia plugin persist, a data persistence plug-in of Pinia
- SQL how to return all data when the input query condition is empty
- Illustration of the insertion process of b+ tree
- Error reporting caused by local warehouse
猜你喜欢
![[xxl-job] xxl-job learning](/img/2c/d3872983e4228a3ef52a9d1bef836e.png)
[xxl-job] xxl-job learning

Project management: lean management method

MySQL建Websites数据表

1. Mx6ul core module use serialization - view system information (II)

栈题目:文件的最长绝对路径

Bitmap这个“内存刺客”你要小心~

DFS Niuke maze problem

Bo Yun container cloud and Devops platform won the trusted cloud "technology best practice Award"
![[steering wheel] how to transfer the start command and idea: VM parameters, command line parameters, system parameters, environment variable parameters, main method parameters](/img/97/159d7df5e2d11b129c400d61e3fde6.png)
[steering wheel] how to transfer the start command and idea: VM parameters, command line parameters, system parameters, environment variable parameters, main method parameters

Handling process of the problem that the virtual machine's intranet communication Ping fails
随机推荐
Handling process of the problem that the virtual machine's intranet communication Ping fails
商业智能BI全解析,探寻BI本质与发展趋势
A pluggable am335x industrial control module onboard WiFi module
我来图书馆小程序一键签到和一键抢位置工具
17_ Form Data
Obsidian mobile PC segment synchronization
npm link的简单介绍及使用
scipy.sparse.vstack
el-table 表头合并前四列,合并成一个单元格
From a data incremental processing problem, we can see the consciousness gap of technicians
[early knowledge of activities] list of recent activities of livevideostack
17. Reverse the linked list
What does the Red Cross in the SQL editor mean (toad and waterdrop have been encountered...)
scipy.sparse.csr_matrix
Manifold learning
[introduction to C language] zzulioj 1006-1010
微信小程序解密并拆包获取源码教程
[reading notes] user portrait methodology and engineering solutions
Pytorch的API总览
HLS Experiment 1 -- multiplier