|
@@ -25,7 +25,9 @@
|
|
customer_counsel_type, customer_name, customer_tel, customer_is_solve, customer_is_visit,
|
|
customer_counsel_type, customer_name, customer_tel, customer_is_solve, customer_is_visit,
|
|
customer_in_TDS, customer_out_TDS, customer_area, customer_create_time, customer_update_time
|
|
customer_in_TDS, customer_out_TDS, customer_area, customer_create_time, customer_update_time
|
|
</sql>
|
|
</sql>
|
|
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 根据id获取客诉信息 -->
|
|
|
|
+ <select id="getCustomerInfo" resultType="CustomerInfo" parameterType="java.lang.Integer" >
|
|
select
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
<include refid="Base_Column_List" />
|
|
from tb_rst_customer_info
|
|
from tb_rst_customer_info
|
|
@@ -48,7 +50,7 @@
|
|
c.customer_source customerSource,
|
|
c.customer_source customerSource,
|
|
t.type_name typeName,
|
|
t.type_name typeName,
|
|
ct.complaint_class_name complaintClassName,
|
|
ct.complaint_class_name complaintClassName,
|
|
- sc.small_class_name smallClassName,
|
|
|
|
|
|
+ s.small_class_name smallClassName,
|
|
d.describe_title describeTitle,
|
|
d.describe_title describeTitle,
|
|
sc.company_name companyName,
|
|
sc.company_name companyName,
|
|
si.store_name storeName,
|
|
si.store_name storeName,
|
|
@@ -57,7 +59,10 @@
|
|
c.customer_out_TDS customerOutTDS,
|
|
c.customer_out_TDS customerOutTDS,
|
|
c.customer_is_solve customerIsSolve,
|
|
c.customer_is_solve customerIsSolve,
|
|
c.customer_is_visit customerIsVisit,
|
|
c.customer_is_visit customerIsVisit,
|
|
- c.customer_create_time customerCreateTime
|
|
|
|
|
|
+ c.customer_create_time customerCreateTime,
|
|
|
|
+ v.visit_status visitStatus,
|
|
|
|
+ v.visit_complete_date visitCompleteDate,
|
|
|
|
+ cd.detect_state detectState
|
|
from
|
|
from
|
|
tb_rst_customer_info c
|
|
tb_rst_customer_info c
|
|
LEFT JOIN tb_rst_question_describe d ON c.customer_id = d.customer_id
|
|
LEFT JOIN tb_rst_question_describe d ON c.customer_id = d.customer_id
|
|
@@ -68,24 +73,29 @@
|
|
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_complaint_detect cd ON cd.customer_id = c.customer_id
|
|
<where>
|
|
<where>
|
|
<if test="customerName != null and customerName != ''">
|
|
<if test="customerName != null and customerName != ''">
|
|
- customer_name = #{customerName}
|
|
|
|
|
|
+ c.customer_name like CONCAT('%',#{customerName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="customerTel != null and customerTel != ''">
|
|
<if test="customerTel != null and customerTel != ''">
|
|
- and customer_tel = #{customerTel}
|
|
|
|
|
|
+ and c.customer_tel like CONCAT('%',#{customerTel},'%')
|
|
</if>
|
|
</if>
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
|
- customer_name = #{customerName}
|
|
|
|
|
|
+ <if test="describeTitle != null and describeTitle != ''">
|
|
|
|
+ and d.describe_title like CONCAT('%',#{describeTitle},'%')
|
|
</if>
|
|
</if>
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
|
- customer_name = #{customerName}
|
|
|
|
|
|
+ <if test="customerSourceType != null and customerSourceType != ''">
|
|
|
|
+ and c.customer_source_type = #{customerSourceType}
|
|
</if>
|
|
</if>
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
|
- customer_name = #{customerName}
|
|
|
|
|
|
+ <if test="complaintId != null and complaintId != ''">
|
|
|
|
+ and ct.complaint_id = #{complaintId}
|
|
</if>
|
|
</if>
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
|
- customer_name = #{customerName}
|
|
|
|
|
|
+ <if test="customerIsVisit != null and customerIsVisit != ''">
|
|
|
|
+ and c.customer_is_visit = #{customerIsVisit}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="adminId != null and adminId != ''">
|
|
|
|
+ and c.admin_id = #{adminId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -106,187 +116,60 @@
|
|
#{customerCreateTime,jdbcType=TIMESTAMP}, #{customerUpdateTime,jdbcType=TIMESTAMP}
|
|
#{customerCreateTime,jdbcType=TIMESTAMP}, #{customerUpdateTime,jdbcType=TIMESTAMP}
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
- <insert id="insertSelective" parameterType="CustomerInfo" >
|
|
|
|
- insert into tb_rst_customer_info
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
|
- <if test="customerId != null" >
|
|
|
|
- customer_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="adminId != null" >
|
|
|
|
- admin_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="questionId != null" >
|
|
|
|
- question_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="companyId != null" >
|
|
|
|
- company_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="storeId != null" >
|
|
|
|
- store_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerSourceType != null" >
|
|
|
|
- customer_source_type,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerSource != null" >
|
|
|
|
- customer_source,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerCounselType != null" >
|
|
|
|
- customer_counsel_type,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerName != null" >
|
|
|
|
- customer_name,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerTel != null" >
|
|
|
|
- customer_tel,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerIsSolve != null" >
|
|
|
|
- customer_is_solve,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerIsVisit != null" >
|
|
|
|
- customer_is_visit,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerInTds != null" >
|
|
|
|
- customer_in_TDS,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerOutTds != null" >
|
|
|
|
- customer_out_TDS,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerArea != null" >
|
|
|
|
- customer_area,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerCreateTime != null" >
|
|
|
|
- customer_create_time,
|
|
|
|
- </if>
|
|
|
|
- <if test="customerUpdateTime != null" >
|
|
|
|
- customer_update_time,
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
|
- <if test="customerId != null" >
|
|
|
|
- #{customerId,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="adminId != null" >
|
|
|
|
- #{adminId,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="questionId != null" >
|
|
|
|
- #{questionId,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="companyId != null" >
|
|
|
|
- #{companyId,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="storeId != null" >
|
|
|
|
- #{storeId,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerSourceType != null" >
|
|
|
|
- #{customerSourceType,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerSource != null" >
|
|
|
|
- #{customerSource,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerCounselType != null" >
|
|
|
|
- #{customerCounselType,jdbcType=BIT},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerName != null" >
|
|
|
|
- #{customerName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerTel != null" >
|
|
|
|
- #{customerTel,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerIsSolve != null" >
|
|
|
|
- #{customerIsSolve,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerIsVisit != null" >
|
|
|
|
- #{customerIsVisit,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerInTds != null" >
|
|
|
|
- #{customerInTds,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerOutTds != null" >
|
|
|
|
- #{customerOutTds,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerArea != null" >
|
|
|
|
- #{customerArea,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerCreateTime != null" >
|
|
|
|
- #{customerCreateTime,jdbcType=TIMESTAMP},
|
|
|
|
- </if>
|
|
|
|
- <if test="customerUpdateTime != null" >
|
|
|
|
- #{customerUpdateTime,jdbcType=TIMESTAMP},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </insert>
|
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="CustomerInfo" >
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 修改客诉信息 -->
|
|
|
|
+ <update id="updateCustomerInfo" parameterType="CustomerInfo" >
|
|
update tb_rst_customer_info
|
|
update tb_rst_customer_info
|
|
<set >
|
|
<set >
|
|
<if test="adminId != null" >
|
|
<if test="adminId != null" >
|
|
- admin_id = #{adminId,jdbcType=INTEGER},
|
|
|
|
|
|
+ admin_id = #{adminId},
|
|
</if>
|
|
</if>
|
|
<if test="questionId != null" >
|
|
<if test="questionId != null" >
|
|
- question_id = #{questionId,jdbcType=INTEGER},
|
|
|
|
|
|
+ question_id = #{questionId},
|
|
</if>
|
|
</if>
|
|
<if test="companyId != null" >
|
|
<if test="companyId != null" >
|
|
- company_id = #{companyId,jdbcType=INTEGER},
|
|
|
|
|
|
+ company_id = #{companyId},
|
|
</if>
|
|
</if>
|
|
<if test="storeId != null" >
|
|
<if test="storeId != null" >
|
|
- store_id = #{storeId,jdbcType=INTEGER},
|
|
|
|
|
|
+ store_id = #{storeId},
|
|
</if>
|
|
</if>
|
|
<if test="customerSourceType != null" >
|
|
<if test="customerSourceType != null" >
|
|
- customer_source_type = #{customerSourceType,jdbcType=TINYINT},
|
|
|
|
|
|
+ customer_source_type = #{customerSourceType},
|
|
</if>
|
|
</if>
|
|
<if test="customerSource != null" >
|
|
<if test="customerSource != null" >
|
|
- customer_source = #{customerSource,jdbcType=VARCHAR},
|
|
|
|
|
|
+ customer_source = #{customerSource},
|
|
</if>
|
|
</if>
|
|
<if test="customerCounselType != null" >
|
|
<if test="customerCounselType != null" >
|
|
- customer_counsel_type = #{customerCounselType,jdbcType=BIT},
|
|
|
|
|
|
+ customer_counsel_type = #{customerCounselType},
|
|
</if>
|
|
</if>
|
|
<if test="customerName != null" >
|
|
<if test="customerName != null" >
|
|
- customer_name = #{customerName,jdbcType=VARCHAR},
|
|
|
|
|
|
+ customer_name = #{customerName},
|
|
</if>
|
|
</if>
|
|
<if test="customerTel != null" >
|
|
<if test="customerTel != null" >
|
|
- customer_tel = #{customerTel,jdbcType=VARCHAR},
|
|
|
|
|
|
+ customer_tel = #{customerTel},
|
|
</if>
|
|
</if>
|
|
<if test="customerIsSolve != null" >
|
|
<if test="customerIsSolve != null" >
|
|
- customer_is_solve = #{customerIsSolve,jdbcType=TINYINT},
|
|
|
|
|
|
+ customer_is_solve = #{customerIsSolve},
|
|
</if>
|
|
</if>
|
|
<if test="customerIsVisit != null" >
|
|
<if test="customerIsVisit != null" >
|
|
- customer_is_visit = #{customerIsVisit,jdbcType=VARCHAR},
|
|
|
|
|
|
+ customer_is_visit = #{customerIsVisit},
|
|
</if>
|
|
</if>
|
|
- <if test="customerInTds != null" >
|
|
|
|
- customer_in_TDS = #{customerInTds,jdbcType=INTEGER},
|
|
|
|
|
|
+ <if test="customerInTDS != null" >
|
|
|
|
+ customer_in_TDS = #{customerInTDS},
|
|
</if>
|
|
</if>
|
|
- <if test="customerOutTds != null" >
|
|
|
|
- customer_out_TDS = #{customerOutTds,jdbcType=INTEGER},
|
|
|
|
|
|
+ <if test="customerOutTDS != null" >
|
|
|
|
+ customer_out_TDS = #{customerOutTDS},
|
|
</if>
|
|
</if>
|
|
<if test="customerArea != null" >
|
|
<if test="customerArea != null" >
|
|
- customer_area = #{customerArea,jdbcType=VARCHAR},
|
|
|
|
|
|
+ customer_area = #{customerArea},
|
|
</if>
|
|
</if>
|
|
<if test="customerCreateTime != null" >
|
|
<if test="customerCreateTime != null" >
|
|
- customer_create_time = #{customerCreateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
|
+ customer_create_time = #{customerCreateTime},
|
|
</if>
|
|
</if>
|
|
<if test="customerUpdateTime != null" >
|
|
<if test="customerUpdateTime != null" >
|
|
- customer_update_time = #{customerUpdateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
|
+ customer_update_time = #{customerUpdateTime},
|
|
</if>
|
|
</if>
|
|
</set>
|
|
</set>
|
|
- where customer_id = #{customerId,jdbcType=INTEGER}
|
|
|
|
- </update>
|
|
|
|
- <update id="updateByPrimaryKey" parameterType="CustomerInfo" >
|
|
|
|
- update tb_rst_customer_info
|
|
|
|
- set admin_id = #{adminId,jdbcType=INTEGER},
|
|
|
|
- question_id = #{questionId,jdbcType=INTEGER},
|
|
|
|
- company_id = #{companyId,jdbcType=INTEGER},
|
|
|
|
- store_id = #{storeId,jdbcType=INTEGER},
|
|
|
|
- customer_source_type = #{customerSourceType,jdbcType=TINYINT},
|
|
|
|
- customer_source = #{customerSource,jdbcType=VARCHAR},
|
|
|
|
- customer_counsel_type = #{customerCounselType,jdbcType=BIT},
|
|
|
|
- customer_name = #{customerName,jdbcType=VARCHAR},
|
|
|
|
- customer_tel = #{customerTel,jdbcType=VARCHAR},
|
|
|
|
- customer_is_solve = #{customerIsSolve,jdbcType=TINYINT},
|
|
|
|
- customer_is_visit = #{customerIsVisit,jdbcType=VARCHAR},
|
|
|
|
- customer_in_TDS = #{customerInTds,jdbcType=INTEGER},
|
|
|
|
- customer_out_TDS = #{customerOutTds,jdbcType=INTEGER},
|
|
|
|
- customer_area = #{customerArea,jdbcType=VARCHAR},
|
|
|
|
- customer_create_time = #{customerCreateTime,jdbcType=TIMESTAMP},
|
|
|
|
- customer_update_time = #{customerUpdateTime,jdbcType=TIMESTAMP}
|
|
|
|
- where customer_id = #{customerId,jdbcType=INTEGER}
|
|
|
|
|
|
+ where customer_id = #{customerId}
|
|
</update>
|
|
</update>
|
|
</mapper>
|
|
</mapper>
|