好好編程-物流項(xiàng)目19【客戶管理-更新客戶】
客戶管理
更新客戶
更新規(guī)則如下
1.實(shí)現(xiàn)效果
2.實(shí)現(xiàn)步驟
改變修改按鈕的地址信息
1
內(nèi)容不用改變,和添加的時(shí)候一樣
@RequestMapping("/customerUpdate") public String customerUpdate(Integer id,Model model){ customerService.getUpdateInfo(id, model); return "customer/customerUpdate"; }
1
2
3
4
5
注意
:和添加時(shí)有調(diào)整
/** * 新增客戶 * 查詢 所有的角色是業(yè)務(wù)員的用戶 * 查詢 常用區(qū)間 基礎(chǔ)數(shù)據(jù) * 修改客戶 * 查詢 所有的角色是業(yè)務(wù)員的用戶 * 查詢 常用區(qū)間 基礎(chǔ)數(shù)據(jù) * 根據(jù)客戶ID 查詢?cè)敿?xì)信息 */ @Override public void getUpdateInfo(Integer id, Model m) { // 1.查詢所有具有業(yè)務(wù)員角色的用戶信息 List
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
給queryView添加了查詢條件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
保存修改的內(nèi)容
@RequestMapping("/saveOrUpdate") public String saveOrUpdate(Customer customer) throws IOException{ if(customer.getCustomerId()!=null && !"".equals(customer.getCustomerId())){ // 更新 customerService.updateCustomer(customer); }else{ // 添加 customerService.addCustomer(customer); } return "success"; }
1
2
3
4
5
6
7
8
9
10
11
public void updateCustomer(Customer customer)
1
@Override public void updateCustomer(Customer customer) { // TODO Auto-generated method stub customerMapper.updateByPrimaryKey(customer); }
1
2
3
4
5
ok 實(shí)現(xiàn)~
智慧物流
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。