|
@@ -461,6 +461,8 @@
|
|
|
<result column="describe_handle_desc" property="describeHandleDesc"/>
|
|
|
<result column="describe_content" property="describeContent"/>
|
|
|
<collection property="complaintDetectList" column="customer_id" ofType="ComplaintDetectInfo" select="listComplaintDetect"/>
|
|
|
+ <!-- <collection property="postageInfoList" column="customer_id" ofType="PostageInfo" select="listPostageInfoByCustomerId"/>-->
|
|
|
+ <collection property="sendbackInfoList" column="customer_id" ofType="SendbackInfo" select="listSendbackInfoByCustomerId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="listComplaintDetect" parameterType="Integer" resultType="ComplaintDetectInfo">
|
|
@@ -757,7 +759,9 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
|
|
|
LEFT JOIN tb_rst_cm_relation cr ON cr.customer_id = c.customer_id
|
|
|
LEFT JOIN tb_rst_cm_proc_method cpm ON cpm.proc_method_id = cr.proc_method_id
|
|
|
LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
|
|
|
- </select>
|
|
|
+/*where cr.relation_id in (select relation_id from tb_rst_postage_info where postage_status = 1 and postage_create_time > '2019-02-12 00:00:00')
|
|
|
+and cr.relation_is_transfer = 10*/
|
|
|
+</select>
|
|
|
<!-- 退换货统计sql start -->
|
|
|
<!-- 总销量 -->
|
|
|
<select id="salesTotalSales" parameterType="SalesOrder" resultType="ReturnStatisticsInfo">
|
|
@@ -1044,15 +1048,34 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
|
|
|
|
|
|
<select id="getCmRelationInfo" parameterType="CmRelation" resultType="CmRelation">
|
|
|
SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- tb_rst_cm_relation
|
|
|
+ cr.*,
|
|
|
+ sx.sendback_status AS relationBackStatus
|
|
|
+ FROM
|
|
|
+ tb_rst_cm_relation cr
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ sxx.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ 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
|
|
|
+ GROUP BY
|
|
|
+ ss.relation_id
|
|
|
+ ) sxx
|
|
|
+ ) sx ON sx.customer_id = cr.customer_id
|
|
|
<where>
|
|
|
<if test="relationId != null and relationId != ''">
|
|
|
- relation_id = #{relationId},
|
|
|
+ cr.relation_id = #{relationId},
|
|
|
</if>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
|
- customer_id = #{customerId}
|
|
|
+ cr.customer_id = #{customerId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -1064,6 +1087,12 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
|
|
|
<select id="listPostageInfo" parameterType="Integer" resultType="PostageInfo">
|
|
|
SELECT * from tb_rst_postage_info where relation_id = #{relationId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="listPostageInfoByCustomerId" parameterType="Integer" resultType="PostageInfo">
|
|
|
+ SELECT * from tb_rst_postage_info
|
|
|
+ LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_postage_info.relation_id
|
|
|
+ where tb_rst_cm_relation.customer_id = #{customerId}
|
|
|
+ </select>
|
|
|
<insert id="addPostageInfo" parameterType="PostageInfo" keyProperty="postageId" useGeneratedKeys="true">
|
|
|
insert into tb_rst_postage_info
|
|
|
(
|
|
@@ -1203,6 +1232,23 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
|
|
|
WHERE relation_id = #{relationId}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="listSendbackInfoByCustomerId" parameterType="Integer" resultType="SendbackInfo">
|
|
|
+ SELECT
|
|
|
+ sendback_id,
|
|
|
+ tb_rst_cm_sendback_info.relation_id,
|
|
|
+ sendback_logistics_company,
|
|
|
+ sendback_logistics_no,
|
|
|
+ sendback_name,
|
|
|
+ sendback_tel,
|
|
|
+ sendback_status,
|
|
|
+ sendback_sign_time,
|
|
|
+ sendback_create_time,
|
|
|
+ sendback_update_time
|
|
|
+ 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
|
|
|
+ where tb_rst_cm_relation.customer_id = #{customerId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="sendbackItemList" parameterType="Integer" resultType="SendbackItem">
|
|
|
select
|
|
|
*,
|