|
@@ -49,7 +49,7 @@
|
|
|
noreason_back_back_logistics_company AS relationBackLogisticsCompany,
|
|
|
noreason_back_back_logistics_no AS relationBackLogisticsNo
|
|
|
FROM tb_rst_noreason_back
|
|
|
- )cc
|
|
|
+ )cc LEFT JOIN tb_rst_customer_info c on cc.customerId = c.customer_id
|
|
|
<where>
|
|
|
<if test="customerId != null and customerId != ''">
|
|
|
AND cc.customerId = #{customerId}
|
|
@@ -57,7 +57,84 @@
|
|
|
<if test="relationBackStatus != null and relationBackStatus != ''">
|
|
|
AND cc.relationBackStatus = #{relationBackStatus}
|
|
|
</if>
|
|
|
+ <if test="adminId != null and adminId != ''">
|
|
|
+ and c.admin_id = #{adminId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="listCustomerCommonByStatus" parameterType="CustomerCommon" resultType="Integer">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM (
|
|
|
+ SELECT
|
|
|
+ '3' AS customerIsSolve,
|
|
|
+ renewed_id AS relationId,
|
|
|
+ customer_id AS customerId,
|
|
|
+ renewed_back_status AS relationBackStatus,
|
|
|
+ renewed_back_logistics_company AS relationBackLogisticsCompany,
|
|
|
+ renewed_back_logistics_no AS relationBackLogisticsNo,
|
|
|
+ renewed_create_time AS relationCreateTime,
|
|
|
+ renewed_back_efast_order_id AS relationBackEfastOrderId
|
|
|
+ FROM tb_rst_renewed
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ '4' AS customerIsSolve,
|
|
|
+ repair_id AS relationId,
|
|
|
+ customer_id AS customerId,
|
|
|
+ repair_back_status AS relationBackStatus,
|
|
|
+ repair_back_logistics_company AS relationBackLogisticsCompany,
|
|
|
+ repair_back_logistics_no AS relationBackLogisticsNo,
|
|
|
+ repair_create_time AS relationCreateTime,
|
|
|
+ repair_back_efast_order_id AS relationBackEfastOrderId
|
|
|
+ FROM tb_rst_repair
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ '5' AS customerIsSolve,
|
|
|
+ reissue_id AS relationId,
|
|
|
+ customer_id AS customerId,
|
|
|
+ NULL AS relationBackStatus,
|
|
|
+ NULL AS relationBackLogisticsCompany,
|
|
|
+ NULL AS relationBackLogisticsNo,
|
|
|
+ reissue_create_time AS relationCreateTime,
|
|
|
+ reissue_back_efast_order_id AS relationBackEfastOrderId
|
|
|
+ FROM tb_rst_reissue
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ '6' AS customerIsSolve,
|
|
|
+ back_goods_id AS relationId,
|
|
|
+ customer_id AS customerId,
|
|
|
+ back_goods_back_status AS relationBackStatus,
|
|
|
+ back_goods_back_logistics_company AS relationBackLogisticsCompany,
|
|
|
+ back_goods_back_logistics_no AS relationBackLogisticsNo,
|
|
|
+ back_goods_create_time AS relationCreateTime,
|
|
|
+ '0' AS relationBackEfastOrderId
|
|
|
+ FROM tb_rst_back_goods
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ '7' AS customerIsSolve,
|
|
|
+ noreason_back_id AS relationId,
|
|
|
+ customer_id AS customerId,
|
|
|
+ noreason_back_back_status AS relationBackStatus,
|
|
|
+ noreason_back_back_logistics_company AS relationBackLogisticsCompany,
|
|
|
+ noreason_back_back_logistics_no AS relationBackLogisticsNo,
|
|
|
+ noreason_back_create_time AS relationCreateTime,
|
|
|
+ '0' AS relationBackEfastOrderId
|
|
|
+ FROM tb_rst_noreason_back
|
|
|
+ )cc LEFT JOIN tb_rst_customer_info c on cc.customerId = c.customer_id
|
|
|
+ <where>
|
|
|
+ <if test="relationBackStatus != null and relationBackStatus != ''">
|
|
|
+ AND cc.relationBackStatus = #{relationBackStatus}
|
|
|
+ </if>
|
|
|
+ <if test="relationBackStatus == 3 ">
|
|
|
+ AND cc.relationBackEfastOrderId IS NULL
|
|
|
+ </if>
|
|
|
+ <if test="relationCreateTime != null and relationCreateTime != ''">
|
|
|
+ AND DATEDIFF(#{relationCreateTime}, cc.relationCreateTime) > 3
|
|
|
+ </if>
|
|
|
+ <if test="adminId != null and adminId != ''">
|
|
|
+ and c.admin_id = #{adminId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|