sql.sql
2.21 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
alter table follow_record_log
add task_id bigint null comment '跟进任务id' after id;
update follow_record_log t1
set task_id = (select w1.task_id from follow_record w1 where w1.id = t1.record_id)
where t1.task_id is null;
create table secret_report_history
(
id bigint auto_increment,
task_id bigint not null comment '任务id',
task_type int(3) not null comment '跟进类型 ',
follow_record_id bigint not null comment '跟进记录id',
first_call tinyint(1) not null comment '是否是首次通话',
call_id varchar(225) not null comment '通话记录id',
staff_id bigint not null comment '工作人员id',
staff_name varchar(64) null comment '工作人员名称',
customer_id bigint not null comment '客户id',
call_type int(3) not null comment '主/被叫',
call_time datetime not null comment '呼叫时间',
call_duration bigint null comment '通话时长(秒)',
shop_id bigint not null comment '门店id',
group_id bigint not null comment '集团id',
constraint secret_report_history_pk
primary key (id)
)
comment '智能电话通话记录';
create index secret_report_history_call_time_index
on secret_report_history (call_time);
create index secret_report_history_customer_id_index
on secret_report_history (customer_id);
create index secret_report_history_staff_id_index
on secret_report_history (staff_id);
-- 报表字段调整
alter table cas_015_d
add i10 int null comment '智能电话跟进有效数';
alter table cas_015_d
add i11 int null comment '智能电话跟进数';
alter table cas_015_d
add i12 int null comment '首次智能电话跟进有效数';
alter table cas_015_d
add i13 int null comment '首次智能电话跟进数';
alter table cas_015_m
add i10 int null comment '智能电话跟进有效数';
alter table cas_015_m
add i11 int null comment '智能电话跟进数';
alter table cas_015_m
add i12 int null comment '首次智能电话跟进有效数';
alter table cas_015_m
add i13 int null comment '首次智能电话跟进数';