update.sql 2.14 KB
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;