Commit 3b48f16408a8a086c59acf07d9c4533742cac491
Merge remote-tracking branch 'origin/dev' into test
Showing
3 changed files
with
69 additions
and
50 deletions
doc/v1.0.0/data处理sql.sql
1 | 1 | -- 订单数据处理 |
2 | +DELETE FROM follow_task WHERE type = 1; | |
3 | +DELETE FROM follow_record WHERE type = 1; | |
4 | +DELETE FROM follow_notice_record WHERE follow_type = 1; | |
5 | +DELETE FROM original_data WHERE type = 1; | |
6 | + | |
2 | 7 | insert into fw_valhalla.original_data(type, customer_id, generate_time, detail_id, solved, group_id, create_time, |
3 | 8 | update_time) |
4 | 9 | SELECT 1, |
... | ... | @@ -9,81 +14,97 @@ SELECT 1, |
9 | 14 | w1.group_id, |
10 | 15 | now(), |
11 | 16 | now() |
12 | -from `fw_order_v2.9.7`.car_order w1 | |
13 | - inner JOIN `fw_order_v2.9.7`.car_delivery_info w2 on w1.id = w2.order_id | |
14 | -where w1.id in ( | |
17 | +from `fw_valhalla`.car_order w1 | |
18 | + inner JOIN `fw_valhalla`.car_delivery_info w2 on w1.id = w2.order_id | |
19 | + INNER JOIN fw_valhalla.customer w3 on w1.car_vin = w3.frame_no | |
20 | +where w3.adviser_id is not NULL and w1.id in ( | |
15 | 21 | select max(w1.id) as id |
16 | - from `fw_order_v2.9.7`.car_order w1 | |
17 | - inner JOIN `fw_order_v2.9.7`.car_delivery_info w2 on w1.id = w2.order_id | |
22 | + from `fw_valhalla`.car_order w1 | |
23 | + inner JOIN `fw_valhalla`.car_delivery_info w2 on w1.id = w2.order_id | |
18 | 24 | where w2.delivery_done = 1 |
19 | 25 | and w1.group_id = 2 |
20 | 26 | and w1.order_canceled = 0 |
21 | - and w2.delivery_date >= DATE_ADD(NOW(), INTERVAL - 9 MONTH) | |
27 | + and w2.delivery_date >= DATE_ADD(NOW(), INTERVAL - 61 DAY ) | |
22 | 28 | group by w1.cust_archive_id |
23 | 29 | ); |
24 | 30 | |
25 | 31 | -- 保险数据处理 |
32 | +DELETE FROM follow_task WHERE type = 4; | |
33 | +DELETE FROM follow_record WHERE type = 4; | |
34 | +DELETE FROM follow_notice_record WHERE follow_type = 4; | |
35 | +DELETE FROM original_data WHERE type = 4; | |
36 | + | |
26 | 37 | insert into fw_valhalla.original_data(type, customer_id, generate_time, detail_id, solved, group_id, create_time, |
27 | 38 | update_time) |
28 | 39 | SELECT 4, |
29 | - w1.cus_id, | |
30 | - DATE_ADD(w1.effective_date, INTERVAL + 1 YEAR), | |
31 | 40 | w1.id, |
32 | - 0, | |
41 | + w1.buy_date, | |
42 | + -1 * w1.id, | |
43 | + 1, | |
33 | 44 | w1.group_id, |
34 | 45 | now(), |
35 | 46 | now() |
36 | -from fw_angel.insurance_policy w1 | |
37 | -where w1.id in ( | |
38 | - select max(w1.id) as id | |
39 | - from fw_angel.insurance_policy w1 | |
40 | - where w1.issue_date >= DATE_ADD(NOW(), INTERVAL - 4 MONTH) | |
41 | - group by w1.cus_id | |
42 | -); | |
47 | +from fw_valhalla.customer w1 WHERE w1.yn=1; | |
48 | + | |
49 | +UPDATE original_data | |
50 | +SET generate_time = DATE_ADD( generate_time, INTERVAL + 1 YEAR ) | |
51 | +WHERE | |
52 | + type=4 and | |
53 | + generate_time < DATE_ADD( | |
54 | + NOW(), | |
55 | + INTERVAL - 304 DAY); | |
56 | + | |
57 | + | |
43 | 58 | |
44 | 59 | -- 售后工单首保处理 |
60 | +DELETE FROM original_data WHERE type = 2; | |
45 | 61 | insert into fw_valhalla.original_data(type, customer_id, generate_time, detail_id, solved, group_id, create_time, |
46 | 62 | update_time) |
47 | 63 | SELECT 2, |
48 | - customer_id, | |
49 | - actual_pickup_time, | |
50 | - id, | |
64 | + t1.customer_id, | |
65 | + t1.actual_pickup_time, | |
66 | + t1.id, | |
51 | 67 | 0, |
52 | - group_id, | |
68 | + t1.group_id, | |
53 | 69 | now(), |
54 | 70 | now() |
55 | -from fw_cas.`order` | |
56 | -where id in ( | |
57 | - select max(id) as id | |
58 | - from fw_cas.`order` | |
59 | - where metal_sheet = 0 | |
60 | - and `status` = 9 | |
61 | - and (FIND_IN_SET(2, type) or FIND_IN_SET(2, type)) | |
62 | - and customer_id is not null | |
63 | - and actual_pickup_time >= DATE_ADD(NOW(), INTERVAL - 5 MONTH) | |
64 | - group by customer_id | |
71 | +from fw_cas.`order` t1 inner join fw_valhalla.customer t2 on t1.customer_id = t2.id | |
72 | +where t2.adviser_id is not null and t1.id in ( | |
73 | + select max(t3.id) as id | |
74 | + from fw_cas.`order` t3 | |
75 | + where t3.metal_sheet = 0 | |
76 | + and t3.`status` = 9 | |
77 | + and (FIND_IN_SET(2, t3.type) or FIND_IN_SET(2, t3.type)) | |
78 | + and t3.customer_id is not null | |
79 | + and t3.actual_pickup_time >= DATE_ADD(NOW(), INTERVAL - 65 DAY ) | |
80 | + group by t3.customer_id | |
65 | 81 | ); |
66 | 82 | |
67 | 83 | |
68 | 84 | -- 流失客户数据处理 |
85 | +DELETE FROM follow_task WHERE type = 2; | |
86 | +DELETE FROM follow_record WHERE type = 2; | |
87 | +DELETE FROM follow_notice_record WHERE follow_type = 2; | |
88 | +DELETE FROM original_data WHERE type = 5; | |
89 | + | |
69 | 90 | insert into fw_valhalla.original_data(type, customer_id, generate_time, detail_id, solved, group_id, create_time, |
70 | 91 | update_time) |
71 | 92 | SELECT 5, |
72 | - customer_id, | |
73 | - actual_pickup_time, | |
74 | - id, | |
93 | + t1.customer_id, | |
94 | + t1.actual_pickup_time, | |
95 | + t1.id, | |
75 | 96 | 0, |
76 | - group_id, | |
97 | + t2.group_id, | |
77 | 98 | now(), |
78 | 99 | now() |
79 | -from fw_cas.`order` | |
80 | -where id in ( | |
81 | - select max(id) as id | |
82 | - from fw_cas.`order` | |
83 | - where `status` = 9 | |
84 | - and customer_id is not null | |
85 | - and actual_pickup_time >= DATE_ADD(NOW(), INTERVAL - 5 MONTH) | |
86 | - group by customer_id | |
100 | +from fw_cas.`order` t1 inner join fw_valhalla.customer t2 on t1.customer_id = t2.id | |
101 | +where t2.adviser_id is not null and t1.id in ( | |
102 | + select max(t3.id) as id | |
103 | + from fw_cas.`order` t3 | |
104 | + where t3.`status` = 9 | |
105 | + and t3.customer_id is not null | |
106 | + and t3.actual_pickup_time >= DATE_ADD(NOW(), INTERVAL - 120 DAY ) | |
107 | + group by t3.customer_id | |
87 | 108 | ); |
88 | 109 | |
89 | 110 | ... | ... |
doc/v1.0.1/升级事项.md
fw-valhalla-common/src/main/java/cn/fw/valhalla/common/constant/RoleCode.java
... | ... | @@ -16,18 +16,10 @@ public interface RoleCode { |
16 | 16 | */ |
17 | 17 | String SGCGJ = "SGCGJ"; |
18 | 18 | /** |
19 | - * 首保跟进 | |
20 | - */ | |
21 | - String SBGJ = "SBGJ"; | |
22 | - /** | |
23 | 19 | * 续保跟进 |
24 | 20 | */ |
25 | 21 | String XBGJ = "XBGJ"; |
26 | 22 | /** |
27 | - * 流失客户跟进 | |
28 | - */ | |
29 | - String LSKHGJ = "LSKHGJ"; | |
30 | - /** | |
31 | 23 | * 保有客分配 |
32 | 24 | */ |
33 | 25 | String BYKFP = "BYKFP"; | ... | ... |