|
@@ -0,0 +1,63 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
+<mapper namespace="com.iamberry.rst.service.cm.mapper.CustomerCommonMapper">
|
|
|
+
|
|
|
+ <select id="listCustomerCommon" parameterType="CustomerCommon" resultType="CustomerCommon">
|
|
|
+ SELECT cc.*
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ FROM tb_rst_noreason_back
|
|
|
+ )cc
|
|
|
+ <where>
|
|
|
+ <if test="customerId != null and customerId != ''">
|
|
|
+ AND cc.customerId = #{customerId}
|
|
|
+ </if>
|
|
|
+ <if test="relationBackStatus != null and relationBackStatus != ''">
|
|
|
+ AND cc.relationBackStatus = #{relationBackStatus}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|