|
@@ -59,12 +59,12 @@
|
|
t.customer_secondary_customer,
|
|
t.customer_secondary_customer,
|
|
t.customer_last_id,
|
|
t.customer_last_id,
|
|
t.customer_initial_id
|
|
t.customer_initial_id
|
|
- from tb_rst_customer_info t
|
|
|
|
|
|
+ from tb_rst_cm_customer_info t
|
|
where t.customer_id = #{customerId,jdbcType=INTEGER}
|
|
where t.customer_id = #{customerId,jdbcType=INTEGER}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
- delete from tb_rst_customer_info
|
|
|
|
|
|
+ delete from tb_rst_cm_customer_info
|
|
where customer_id = #{customerId,jdbcType=INTEGER}
|
|
where customer_id = #{customerId,jdbcType=INTEGER}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
@@ -109,16 +109,16 @@
|
|
d.describe_handle_desc,
|
|
d.describe_handle_desc,
|
|
d.describe_content
|
|
d.describe_content
|
|
from
|
|
from
|
|
- tb_rst_customer_info c
|
|
|
|
- LEFT JOIN tb_rst_question_describe d ON c.customer_id = d.customer_id
|
|
|
|
|
|
+ tb_rst_cm_customer_info c
|
|
|
|
+ LEFT JOIN tb_rst_cm_question_describe d ON c.customer_id = d.customer_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
- LEFT JOIN tb_rst_complaint_question q ON c.question_id = q.question_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_small_class s ON q.small_class_id = s.small_class_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_type ct ON s.complaint_id = ct.complaint_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_question q ON c.question_id = q.question_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_small_class s ON q.small_class_id = s.small_class_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_type ct ON s.complaint_id = ct.complaint_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_sys_admin a ON c.admin_id = a.admin_id
|
|
LEFT JOIN tb_rst_sys_admin a ON c.admin_id = a.admin_id
|
|
- LEFT JOIN tb_rst_visit v ON v.customer_id = c.customer_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_visit v ON v.customer_id = c.customer_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON v.designated_admin_id = sa.admin_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON v.designated_admin_id = sa.admin_id
|
|
<where>
|
|
<where>
|
|
<if test="customerName != null and customerName != ''">
|
|
<if test="customerName != null and customerName != ''">
|
|
@@ -283,7 +283,7 @@
|
|
cc.relationBackLogisticsCompany AS backLogisticsCompany,
|
|
cc.relationBackLogisticsCompany AS backLogisticsCompany,
|
|
oi.sales_pay_time AS salesTime
|
|
oi.sales_pay_time AS salesTime
|
|
FROM
|
|
FROM
|
|
- tb_rst_customer_info c
|
|
|
|
|
|
+ tb_rst_cm_customer_info c
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
xx.*
|
|
xx.*
|
|
@@ -293,7 +293,7 @@
|
|
'3' AS customerIsSolve,
|
|
'3' AS customerIsSolve,
|
|
renewed_id AS relationId,
|
|
renewed_id AS relationId,
|
|
customer_id AS customerId,
|
|
customer_id AS customerId,
|
|
- tb_rst_relation_order.sales_id AS orderId,
|
|
|
|
|
|
+ tb_rst_cm_relation_order.sales_id AS orderId,
|
|
signclosed_id AS signclosedId,
|
|
signclosed_id AS signclosedId,
|
|
renewed_back_status AS relationBackStatus,
|
|
renewed_back_status AS relationBackStatus,
|
|
renewed_send_status AS relationSendStatus,
|
|
renewed_send_status AS relationSendStatus,
|
|
@@ -303,14 +303,14 @@
|
|
renewed_back_logistics_company AS relationBackLogisticsCompany
|
|
renewed_back_logistics_company AS relationBackLogisticsCompany
|
|
FROM
|
|
FROM
|
|
tb_rst_renewed
|
|
tb_rst_renewed
|
|
- LEFT JOIN tb_rst_relation_order ON tb_rst_relation_order.relation_id = tb_rst_renewed.renewed_id
|
|
|
|
- AND tb_rst_relation_order.relation_type = '3'
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ON tb_rst_cm_relation_order.relation_id = tb_rst_renewed.renewed_id
|
|
|
|
+ AND tb_rst_cm_relation_order.relation_type = '3'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT
|
|
SELECT
|
|
'4' AS customerIsSolve,
|
|
'4' AS customerIsSolve,
|
|
repair_id AS relationId,
|
|
repair_id AS relationId,
|
|
customer_id AS customerId,
|
|
customer_id AS customerId,
|
|
- tb_rst_relation_order.sales_id AS orderId,
|
|
|
|
|
|
+ tb_rst_cm_relation_order.sales_id AS orderId,
|
|
signclosed_id AS signclosedId,
|
|
signclosed_id AS signclosedId,
|
|
repair_back_status AS relationBackStatus,
|
|
repair_back_status AS relationBackStatus,
|
|
repair_send_status AS relationSendStatus,
|
|
repair_send_status AS relationSendStatus,
|
|
@@ -320,14 +320,14 @@
|
|
repair_back_logistics_company AS relationBackLogisticsCompany
|
|
repair_back_logistics_company AS relationBackLogisticsCompany
|
|
FROM
|
|
FROM
|
|
tb_rst_repair
|
|
tb_rst_repair
|
|
- LEFT JOIN tb_rst_relation_order ON tb_rst_relation_order.relation_id = tb_rst_repair.repair_id
|
|
|
|
- AND tb_rst_relation_order.relation_type = '4'
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ON tb_rst_cm_relation_order.relation_id = tb_rst_repair.repair_id
|
|
|
|
+ AND tb_rst_cm_relation_order.relation_type = '4'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT
|
|
SELECT
|
|
'5' AS customerIsSolve,
|
|
'5' AS customerIsSolve,
|
|
reissue_id AS relationId,
|
|
reissue_id AS relationId,
|
|
customer_id AS customerId,
|
|
customer_id AS customerId,
|
|
- tb_rst_relation_order.sales_id AS orderId,
|
|
|
|
|
|
+ tb_rst_cm_relation_order.sales_id AS orderId,
|
|
NULL AS signclosedId,
|
|
NULL AS signclosedId,
|
|
NULL AS relationBackStatus,
|
|
NULL AS relationBackStatus,
|
|
reissue_send_status AS relationSendStatus,
|
|
reissue_send_status AS relationSendStatus,
|
|
@@ -337,14 +337,14 @@
|
|
NULL AS relationBackLogisticsCompany
|
|
NULL AS relationBackLogisticsCompany
|
|
FROM
|
|
FROM
|
|
tb_rst_reissue
|
|
tb_rst_reissue
|
|
- LEFT JOIN tb_rst_relation_order ON tb_rst_relation_order.relation_id = tb_rst_reissue.reissue_id
|
|
|
|
- AND tb_rst_relation_order.relation_type = '5'
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ON tb_rst_cm_relation_order.relation_id = tb_rst_reissue.reissue_id
|
|
|
|
+ AND tb_rst_cm_relation_order.relation_type = '5'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT
|
|
SELECT
|
|
'6' AS customerIsSolve,
|
|
'6' AS customerIsSolve,
|
|
back_goods_id AS relationId,
|
|
back_goods_id AS relationId,
|
|
customer_id AS customerId,
|
|
customer_id AS customerId,
|
|
- tb_rst_relation_order.sales_id AS orderId,
|
|
|
|
|
|
+ tb_rst_cm_relation_order.sales_id AS orderId,
|
|
signclosed_id AS signclosedId,
|
|
signclosed_id AS signclosedId,
|
|
back_goods_back_status AS relationBackStatus,
|
|
back_goods_back_status AS relationBackStatus,
|
|
NULL AS relationSendStatus,
|
|
NULL AS relationSendStatus,
|
|
@@ -354,14 +354,14 @@
|
|
back_goods_back_logistics_company AS relationBackLogisticsCompany
|
|
back_goods_back_logistics_company AS relationBackLogisticsCompany
|
|
FROM
|
|
FROM
|
|
tb_rst_back_goods
|
|
tb_rst_back_goods
|
|
- LEFT JOIN tb_rst_relation_order ON tb_rst_relation_order.relation_id = tb_rst_back_goods.back_goods_id
|
|
|
|
- AND tb_rst_relation_order.relation_type = '6'
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ON tb_rst_cm_relation_order.relation_id = tb_rst_back_goods.back_goods_id
|
|
|
|
+ AND tb_rst_cm_relation_order.relation_type = '6'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT
|
|
SELECT
|
|
'7' AS customerIsSolve,
|
|
'7' AS customerIsSolve,
|
|
noreason_back_id AS relationId,
|
|
noreason_back_id AS relationId,
|
|
customer_id AS customerId,
|
|
customer_id AS customerId,
|
|
- tb_rst_relation_order.sales_id AS orderId,
|
|
|
|
|
|
+ tb_rst_cm_relation_order.sales_id AS orderId,
|
|
signclosed_id AS signclosedId,
|
|
signclosed_id AS signclosedId,
|
|
noreason_back_back_status AS relationBackStatus,
|
|
noreason_back_back_status AS relationBackStatus,
|
|
NULL AS relationSendStatus,
|
|
NULL AS relationSendStatus,
|
|
@@ -371,16 +371,16 @@
|
|
noreason_back_back_logistics_company AS relationBackLogisticsCompany
|
|
noreason_back_back_logistics_company AS relationBackLogisticsCompany
|
|
FROM
|
|
FROM
|
|
tb_rst_noreason_back
|
|
tb_rst_noreason_back
|
|
- LEFT JOIN tb_rst_relation_order ON tb_rst_relation_order.relation_id = tb_rst_noreason_back.noreason_back_id
|
|
|
|
- AND tb_rst_relation_order.relation_type = '7'
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ON tb_rst_cm_relation_order.relation_id = tb_rst_noreason_back.noreason_back_id
|
|
|
|
+ AND tb_rst_cm_relation_order.relation_type = '7'
|
|
) xx
|
|
) xx
|
|
) cc ON cc.customerId = c.customer_id
|
|
) cc ON cc.customerId = c.customer_id
|
|
- LEFT JOIN tb_rst_visit v ON v.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_sales_order_info oi ON cc.orderId = oi.sales_id
|
|
- LEFT JOIN tb_rst_question_describe qd ON c.customer_id = qd.customer_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_question cq ON c.question_id = cq.question_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_small_class csc ON csc.small_class_id = cq.small_class_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_type ct ON ct.complaint_id = csc.complaint_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_question_describe qd ON c.customer_id = qd.customer_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_question cq ON c.question_id = cq.question_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_small_class csc ON csc.small_class_id = cq.small_class_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_type ct ON ct.complaint_id = csc.complaint_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
@@ -531,7 +531,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="insert" parameterType="CustomerInfo" useGeneratedKeys="true" keyProperty="customerId">
|
|
<insert id="insert" parameterType="CustomerInfo" useGeneratedKeys="true" keyProperty="customerId">
|
|
- insert into tb_rst_customer_info (customer_id, admin_id, question_id,
|
|
|
|
|
|
+ insert into tb_rst_cm_customer_info (customer_id, admin_id, question_id,
|
|
company_id, store_id, customer_source_type,
|
|
company_id, store_id, customer_source_type,
|
|
customer_source, customer_counsel_type, customer_name,
|
|
customer_source, customer_counsel_type, customer_name,
|
|
customer_tel,customer_wechat_name, customer_is_solve, customer_is_visit,
|
|
customer_tel,customer_wechat_name, customer_is_solve, customer_is_visit,
|
|
@@ -548,7 +548,7 @@
|
|
|
|
|
|
<!-- 修改客诉信息 -->
|
|
<!-- 修改客诉信息 -->
|
|
<update id="updateCustomerInfo" parameterType="CustomerInfo" >
|
|
<update id="updateCustomerInfo" parameterType="CustomerInfo" >
|
|
- update tb_rst_customer_info
|
|
|
|
|
|
+ update tb_rst_cm_customer_info
|
|
<set >
|
|
<set >
|
|
<if test="adminId != null" >
|
|
<if test="adminId != null" >
|
|
admin_id = #{adminId},
|
|
admin_id = #{adminId},
|
|
@@ -631,7 +631,7 @@
|
|
pt.*
|
|
pt.*
|
|
FROM
|
|
FROM
|
|
tb_rst_product_type pt
|
|
tb_rst_product_type pt
|
|
- LEFT JOIN tb_rst_customer_info ci ON pt.type_id = ci.type_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_customer_info ci ON pt.type_id = ci.type_id
|
|
where
|
|
where
|
|
ci.customer_id = #{customerId}
|
|
ci.customer_id = #{customerId}
|
|
</select>
|
|
</select>
|
|
@@ -640,7 +640,7 @@
|
|
SELECT
|
|
SELECT
|
|
COUNT(customer_id)
|
|
COUNT(customer_id)
|
|
FROM
|
|
FROM
|
|
- tb_rst_customer_info
|
|
|
|
|
|
+ tb_rst_cm_customer_info
|
|
<where>
|
|
<where>
|
|
<if test="questionId != null" >
|
|
<if test="questionId != null" >
|
|
question_id = #{questionId}
|
|
question_id = #{questionId}
|
|
@@ -698,16 +698,16 @@
|
|
d.describe_handle_desc,
|
|
d.describe_handle_desc,
|
|
d.describe_content
|
|
d.describe_content
|
|
from
|
|
from
|
|
- tb_rst_customer_info c
|
|
|
|
- LEFT JOIN tb_rst_question_describe d ON c.customer_id = d.customer_id
|
|
|
|
|
|
+ tb_rst_cm_customer_info c
|
|
|
|
+ LEFT JOIN tb_rst_cm_question_describe d ON c.customer_id = d.customer_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
LEFT JOIN tb_rst_product_type t ON c.type_id = t.type_id
|
|
- LEFT JOIN tb_rst_complaint_question q ON c.question_id = q.question_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_small_class s ON q.small_class_id = s.small_class_id
|
|
|
|
- LEFT JOIN tb_rst_complaint_type ct ON s.complaint_id = ct.complaint_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_question q ON c.question_id = q.question_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_small_class s ON q.small_class_id = s.small_class_id
|
|
|
|
+ LEFT JOIN tb_rst_cm_complaint_type ct ON s.complaint_id = ct.complaint_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_sys_admin a ON c.admin_id = a.admin_id
|
|
LEFT JOIN tb_rst_sys_admin a ON c.admin_id = a.admin_id
|
|
- LEFT JOIN tb_rst_visit v ON v.customer_id = c.customer_id
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_visit v ON v.customer_id = c.customer_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON v.designated_admin_id = sa.admin_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON v.designated_admin_id = sa.admin_id
|
|
<where>
|
|
<where>
|
|
<if test="customerName != null and customerName != ''">
|
|
<if test="customerName != null and customerName != ''">
|
|
@@ -804,11 +804,11 @@ ELSE
|
|
END) AS customerSecondaryCustomer,
|
|
END) AS customerSecondaryCustomer,
|
|
sa.admin_name AS adminName
|
|
sa.admin_name AS adminName
|
|
FROM
|
|
FROM
|
|
- tb_rst_customer_info c
|
|
|
|
-LEFT JOIN tb_rst_question_describe qd ON c.customer_id = qd.customer_id
|
|
|
|
-LEFT JOIN tb_rst_complaint_question cq ON c.question_id = cq.question_id
|
|
|
|
-LEFT JOIN tb_rst_complaint_small_class csc ON csc.small_class_id = cq.small_class_id
|
|
|
|
-LEFT JOIN tb_rst_complaint_type ct ON ct.complaint_id = csc.complaint_id
|
|
|
|
|
|
+ tb_rst_cm_customer_info c
|
|
|
|
+LEFT JOIN tb_rst_cm_question_describe qd ON c.customer_id = qd.customer_id
|
|
|
|
+LEFT JOIN tb_rst_cm_complaint_question cq ON c.question_id = cq.question_id
|
|
|
|
+LEFT JOIN tb_rst_cm_complaint_small_class csc ON csc.small_class_id = cq.small_class_id
|
|
|
|
+LEFT JOIN tb_rst_cm_complaint_type ct ON ct.complaint_id = csc.complaint_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
@@ -871,7 +871,7 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
GROUP BY oi.sales_id) salesNum
|
|
GROUP BY oi.sales_id) salesNum
|
|
- LEFT JOIN tb_rst_relation_order ro
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ro
|
|
on ro.sales_id = salesNum.sales_id
|
|
on ro.sales_id = salesNum.sales_id
|
|
WHERE relation_type = 3) salesExchange
|
|
WHERE relation_type = 3) salesExchange
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -905,7 +905,7 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
GROUP BY oi.sales_id) salesNum
|
|
GROUP BY oi.sales_id) salesNum
|
|
- LEFT JOIN tb_rst_relation_order ro
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ro
|
|
on ro.sales_id = salesNum.sales_id
|
|
on ro.sales_id = salesNum.sales_id
|
|
WHERE relation_type in (6,7)) salesExchange
|
|
WHERE relation_type in (6,7)) salesExchange
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -939,11 +939,11 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
GROUP BY oi.sales_id) salesNum
|
|
GROUP BY oi.sales_id) salesNum
|
|
- LEFT JOIN tb_rst_relation_order ro
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ro
|
|
on ro.sales_id = salesNum.sales_id
|
|
on ro.sales_id = salesNum.sales_id
|
|
LEFT JOIN tb_rst_renewed rr
|
|
LEFT JOIN tb_rst_renewed rr
|
|
on ro.relation_id = rr.renewed_id
|
|
on ro.relation_id = rr.renewed_id
|
|
- LEFT JOIN tb_rst_customer_info ci
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_customer_info ci
|
|
ON rr.customer_id = ci.customer_id
|
|
ON rr.customer_id = ci.customer_id
|
|
WHERE relation_type = 3 and ci.customer_secondary_customer = 1) salesExchange
|
|
WHERE relation_type = 3 and ci.customer_secondary_customer = 1) salesExchange
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -977,11 +977,11 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
GROUP BY oi.sales_id) salesNum
|
|
GROUP BY oi.sales_id) salesNum
|
|
- LEFT JOIN tb_rst_relation_order ro
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_relation_order ro
|
|
on ro.sales_id = salesNum.sales_id
|
|
on ro.sales_id = salesNum.sales_id
|
|
LEFT JOIN tb_rst_renewed rr
|
|
LEFT JOIN tb_rst_renewed rr
|
|
on ro.relation_id = rr.renewed_id
|
|
on ro.relation_id = rr.renewed_id
|
|
- LEFT JOIN tb_rst_customer_info ci
|
|
|
|
|
|
+ LEFT JOIN tb_rst_cm_customer_info ci
|
|
ON rr.customer_id = ci.customer_id
|
|
ON rr.customer_id = ci.customer_id
|
|
WHERE relation_type in(6,7) and ci.customer_secondary_customer = 1) salesExchange
|
|
WHERE relation_type in(6,7) and ci.customer_secondary_customer = 1) salesExchange
|
|
GROUP BY
|
|
GROUP BY
|