update.sql
2.14 KB
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
alter table follow_record_log modify att_type int not null comment '附件类型 1:电话 2:微聊 3:拜访 4:微信 5:短信 6:企业微信 7:智能电话';
alter table follow_record_log modify attachments varchar(2000) null comment '跟进凭证 fid逗号隔开,智能电话的情况为通话记录id';
alter table follow_record_log
add feedback_type int(5) null comment '反馈类型 1:距离远 2:收费高 3:即将进站 4:其他' after attachments;
alter table customer
add arrival_count int default '0' not null comment '进站次数' after current_mileage;
alter table follow_task
add reception_user_id bigint null comment '接待人员id' after reason;
alter table follow_task
add reception_user_name varchar(255) null comment '接待人员名称' after reception_user_id;
alter table follow_task
add reception_shop_id bigint null comment '接待门店id' after reception_user_name;
alter table follow_task
add reception_shop_name varchar(255) null comment '接待门店名称' after reception_shop_id;
alter table follow_task
add feedback varchar(225) null comment '客户反馈' after reason;
alter table follow_task
add last_feedback int(3) null comment '最新的反馈' after feedback;
alter table follow_task
add times int(3) null after last_feedback;
update follow_record_log set feedback_type = 99 where feedback_type is null;
update follow_task
set feedback = '99',
last_feedback='99'
where feedback is null;
update follow_task t1
set t1.times = (select count(t2.id) num
from follow_record t2
where t1.follow_user = t2.user_id
and t1.id = t2.task_id
and t2.out_time = 0
and t2.follow_time is not null)
where t1.times is null;
update customer t1
set t1.arrival_count = (select count(t2.arrival_time)
from (select distinct customer_id, arrival_time from customer_reach_log w1) t2
where t1.id = t2.customer_id)
where t1.arrival_count is null;
alter table accident_pool
add frame_no varchar(64) null comment '车架号' after plate_no;