|
@@ -342,6 +342,15 @@
|
|
|
ss.relation_id
|
|
|
) sxx
|
|
|
) sx ON sx.customer_id = c.customer_id
|
|
|
+ LEFT JOIN (SELECT ss.* from (
|
|
|
+ select tb_rst_cm_sendback_info.*,tb_rst_cm_relation.customer_id
|
|
|
+ FROM
|
|
|
+ tb_rst_cm_sendback_info
|
|
|
+ LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_cm_sendback_info.relation_id
|
|
|
+
|
|
|
+ ORDER BY
|
|
|
+ sendback_create_time desc
|
|
|
+ ) ss) sss ON sss.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
|
|
@@ -402,7 +411,10 @@
|
|
|
and c.customer_create_time < #{endTime}
|
|
|
</if>
|
|
|
<if test="sendLogisticsNo != null and sendLogisticsNo != ''">
|
|
|
- AND cc.relationSendLogisticsNo = #{sendLogisticsNo} OR cc.relationBackLogisticsNo = #{sendLogisticsNo}
|
|
|
+ AND cc.relationSendLogisticsNo = #{sendLogisticsNo} OR sss.sendback_logistics_no = #{sendLogisticsNo}
|
|
|
+ </if>
|
|
|
+ <if test="storeId != null and storeId != ''">
|
|
|
+ AND c.store_id = #{storeId}
|
|
|
</if>
|
|
|
<if test="backStatus != null and backStatus != ''">
|
|
|
and c.customer_id in (
|
|
@@ -1263,25 +1275,25 @@ and cr.relation_is_transfer = 10*/
|
|
|
<update id="updateSendbackInfo" parameterType="SendbackInfo">
|
|
|
UPDATE tb_rst_cm_sendback_info
|
|
|
<set>
|
|
|
- <if test="sendbackLogisticsCompany != null and sendbackLogisticsCompany != ''">
|
|
|
+ <if test="sendbackLogisticsCompany != null">
|
|
|
sendback_logistics_company = #{sendbackLogisticsCompany},
|
|
|
</if>
|
|
|
- <if test="sendbackLogisticsNo != null and sendbackLogisticsNo != ''">
|
|
|
+ <if test="sendbackLogisticsNo != null">
|
|
|
sendback_logistics_no = #{sendbackLogisticsNo},
|
|
|
</if>
|
|
|
- <if test="sendbackName != null and sendbackName != ''">
|
|
|
+ <if test="sendbackName != null">
|
|
|
sendback_name = #{sendbackName},
|
|
|
</if>
|
|
|
- <if test="sendbackSignTime != null and sendbackSignTime != ''">
|
|
|
+ <if test="sendbackSignTime != null">
|
|
|
sendback_sign_time = #{sendbackSignTime},
|
|
|
</if>
|
|
|
- <if test="sendbackTel != null and sendbackTel != ''">
|
|
|
+ <if test="sendbackTel != null">
|
|
|
sendback_tel = #{sendbackTel},
|
|
|
</if>
|
|
|
- <if test="sendbackStatus != null and sendbackStatus != ''">
|
|
|
+ <if test="sendbackStatus != null">
|
|
|
sendback_status = #{sendbackStatus},
|
|
|
</if>
|
|
|
- <if test="sendbackSignTime != null and sendbackSignTime != ''">
|
|
|
+ <if test="sendbackSignTime != null">
|
|
|
sendback_sign_time = #{sendbackSignTime}
|
|
|
</if>
|
|
|
</set>
|