|
@@ -295,7 +295,14 @@
|
|
|
cc.procMethodIsBack as procMethodIsBack,
|
|
|
cc.procMethodIsSend as procMethodIsSend,
|
|
|
cc.relationSendAddress as customerSendAddress,
|
|
|
- cc.relationId as relationId
|
|
|
+ cc.relationId as relationId,
|
|
|
+ ri.receivingOne as receivingOne,
|
|
|
+ ri.receivingTwo as receivingTwo,
|
|
|
+ cs.beDetected as beDetected,
|
|
|
+ cs.beMaintenance as beMaintenance,
|
|
|
+ cs.beRefurbished as beRefurbished,
|
|
|
+ cs.beScrapped as beScrapped,
|
|
|
+ cs.beContact as beContact
|
|
|
FROM
|
|
|
tb_rst_cm_customer_info c
|
|
|
LEFT JOIN (
|
|
@@ -356,6 +363,48 @@
|
|
|
sendback_create_time desc
|
|
|
) ss
|
|
|
) sss ON sss.customer_id = c.customer_id
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ signclosed_id,
|
|
|
+ signclosed_customer_id,
|
|
|
+ COUNT(
|
|
|
+ CASE signclosed_is_receiving
|
|
|
+ WHEN 1 THEN
|
|
|
+ 1
|
|
|
+ END
|
|
|
+ ) AS receivingOne,
|
|
|
+ COUNT(
|
|
|
+ CASE signclosed_is_receiving
|
|
|
+ WHEN 2 THEN
|
|
|
+ 2
|
|
|
+ END
|
|
|
+ ) AS receivingTwo
|
|
|
+ FROM
|
|
|
+ tb_rst_complaint_signclosed
|
|
|
+ GROUP BY
|
|
|
+ signclosed_customer_id) ri ON ri.signclosed_customer_id = c.customer_id
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ detect_id,
|
|
|
+ customer_id,
|
|
|
+ COUNT(
|
|
|
+ CASE detect_state
|
|
|
+ WHEN 1 THEN
|
|
|
+ 1
|
|
|
+ END
|
|
|
+ ) AS beDetected,
|
|
|
+ COUNT(case detect_state when 31 then 1
|
|
|
+ when 35 then 1
|
|
|
+ end) as beMaintenance,
|
|
|
+ COUNT(case detect_state when 20 then 1
|
|
|
+ end) as beRefurbished,
|
|
|
+ COUNT(case detect_state when 22 then 1
|
|
|
+ end) as beScrapped,
|
|
|
+ COUNT(case detect_state when 30 then 1
|
|
|
+ when 34 then 1 WHEN 38 then 1
|
|
|
+ end) as beContact
|
|
|
+ FROM
|
|
|
+ tb_rst_complaint_detect
|
|
|
+ GROUP BY
|
|
|
+ customer_id) cs ON cs.customer_id = c.customer_id
|
|
|
LEFT JOIN tb_rst_cm_visit v ON v.customer_id = c.customer_id
|
|
|
LEFT JOIN tb_rst_sales_order_info oi ON cc.orderId = oi.sales_id
|
|
|
LEFT JOIN tb_rst_cm_question_describe qd ON c.customer_id = qd.customer_id
|
|
@@ -696,7 +745,7 @@
|
|
|
sa.admin_name AS visitDesignatedAdminName,
|
|
|
q.question_profile,
|
|
|
d.describe_handle_desc,
|
|
|
- d.describe_content
|
|
|
+ d.describe_content,
|
|
|
from
|
|
|
tb_rst_cm_customer_info c
|
|
|
LEFT JOIN tb_rst_cm_question_describe d ON c.customer_id = d.customer_id
|