Commit 48513cab by huluobin

默认美甲师按照客诉扣分排序

parent 7e676a06
...@@ -55,7 +55,11 @@ ...@@ -55,7 +55,11 @@
</sql> </sql>
<sql id="storeClassesTechnicianSql"> <sql id="storeClassesTechnicianSql">
ct.id, ct.user_id, ct.days, ct.classes, ct.`status` ct.id,
ct.user_id,
ct.days,
ct.classes,
ct.`status`
</sql> </sql>
<sql id="storeClassesSql"> <sql id="storeClassesSql">
...@@ -86,9 +90,19 @@ ...@@ -86,9 +90,19 @@
</sql> </sql>
<sql id="scheduleServeSql"> <sql id="scheduleServeSql">
ss.id ss_id,ss.sch_id ss_sch_id,ss.technician_id ss_technician_id,ss.serve_id ss_serve_id,ss.main_serve_id ss_main_serve_id,ss.is_customer_pick ss_is_customer_pick ss.id ss_id,
,ss.start_time ss_start_time,ss.end_time ss_end_time,ss.produce_name ss_produce_name,ss.serve_number ss_serve_number,ss.serve_number ss_serve_number ss.sch_id ss_sch_id,
,ss.create_user ss_create_user,ss.produce_id ss_produce_id ss.technician_id ss_technician_id,
ss.serve_id ss_serve_id,
ss.main_serve_id ss_main_serve_id,
ss.is_customer_pick ss_is_customer_pick,
ss.start_time ss_start_time,
ss.end_time ss_end_time,
ss.produce_name ss_produce_name,
ss.serve_number ss_serve_number,
ss.serve_number ss_serve_number,
ss.create_user ss_create_user,
ss.produce_id ss_produce_id
</sql> </sql>
<select id="listClassesTechnicianDetail" resultMap="classesTechnicianMap"> <select id="listClassesTechnicianDetail" resultMap="classesTechnicianMap">
...@@ -117,36 +131,41 @@ ...@@ -117,36 +131,41 @@
date_format(days, '%Y-%m-%d') = #{days} date_format(days, '%Y-%m-%d') = #{days}
</select> </select>
<!-- <select id="listClassesTechnician" resultMap="classesTechnicianMap">--> <!-- <select id="listClassesTechnician" resultMap="classesTechnicianMap">-->
<!-- SELECT--> <!-- SELECT-->
<!-- <include refid="storeClassesTechnicianSql"/>,--> <!-- <include refid="storeClassesTechnicianSql"/>,-->
<!-- <include refid="storeClassesSql"/>,--> <!-- <include refid="storeClassesSql"/>,-->
<!-- <include refid="storeTechnicianSql"/>,--> <!-- <include refid="storeTechnicianSql"/>,-->
<!-- <include refid="scheduleServeSql"/>--> <!-- <include refid="scheduleServeSql"/>-->
<!-- FROM store_classes_technician ct--> <!-- FROM store_classes_technician ct-->
<!-- LEFT JOIN store_classes cls ON cls.id = ct.classes--> <!-- LEFT JOIN store_classes cls ON cls.id = ct.classes-->
<!-- LEFT JOIN store_technician tech ON tech.id = ct.user_id--> <!-- LEFT JOIN store_technician tech ON tech.id = ct.user_id-->
<!-- LEFT JOIN (--> <!-- LEFT JOIN (-->
<!-- SELECT t4.*--> <!-- SELECT t4.*-->
<!-- FROM scheduled_serve t4--> <!-- FROM scheduled_serve t4-->
<!-- inner JOIN scheduled_manage t5 ON t4.sch_id = t5.id--> <!-- inner JOIN scheduled_manage t5 ON t4.sch_id = t5.id-->
<!-- AND t5.STATUS != 3--> <!-- AND t5.STATUS != 3-->
<!-- AND t5.STATUS != 4--> <!-- AND t5.STATUS != 4-->
<!-- AND t5.STATUS != 5--> <!-- AND t5.STATUS != 5-->
<!-- AND t5.STATUS != 2--> <!-- AND t5.STATUS != 2-->
<!-- and t4.status !=3--> <!-- and t4.status !=3-->
<!-- WHERE t4.start_time LIKE concat(#{days},'%')--> <!-- WHERE t4.start_time LIKE concat(#{days},'%')-->
<!-- <if test="scheduleId != null">--> <!-- <if test="scheduleId != null">-->
<!-- and t5.id != #{scheduleId}--> <!-- and t5.id != #{scheduleId}-->
<!-- </if>) ss ON ct.user_id = ss.technician_id--> <!-- </if>) ss ON ct.user_id = ss.technician_id-->
<!-- WHERE ct.days = #{days}--> <!-- left join recent_deducted_complaint_score t6 on t6.technician_id = tech.id-->
<!-- AND tech.user_id IN (SELECT user_id FROM staff_store_authority WHERE store_id = #{departmentId})--> <!-- WHERE ct.days = #{days}-->
<!-- AND cls.department_id = #{departmentId}--> <!-- AND tech.user_id IN (SELECT user_id FROM staff_store_authority WHERE store_id = #{departmentId})-->
<!-- and tech.`status`=1--> <!-- AND cls.department_id = #{departmentId}-->
<!-- </select>--> <!-- and tech.`status`=1-->
<!-- </select>-->
<select id="listClassesTechnician" resultMap="classesTechnicianMap"> <select id="listClassesTechnician" resultMap="classesTechnicianMap">
select * select
<include refid="storeClassesTechnicianSql"/>,
<include refid="storeClassesSql"/>,
<include refid="storeTechnicianSql"/>,
<include refid="scheduleServeSql"/>
from store_classes_technician ct from store_classes_technician ct
left join store_classes cls on cls.id = ct.classes left join store_classes cls on cls.id = ct.classes
left join store_technician tech on tech.id = ct.user_id left join store_technician tech on tech.id = ct.user_id
...@@ -164,12 +183,12 @@ ...@@ -164,12 +183,12 @@
and t5.id != #{scheduleId} and t5.id != #{scheduleId}
</if> </if>
) ss on ct.user_id = ss.technician_id ) ss on ct.user_id = ss.technician_id
left join recent_deducted_complaint_score t5 on t5.technician_id = tech.id left join recent_deducted_complaint_score t6 on t6.technician_id = tech.id
where ct.days = #{days} where ct.days = #{days}
and tech.user_id in (select user_id from staff_store_authority where store_id = #{departmentId}) and tech.user_id in (select user_id from staff_store_authority where store_id = #{departmentId})
and cls.department_id = #{departmentId} and cls.department_id = #{departmentId}
and tech.`status` = 1 and tech.`status` = 1
order by t5.score order by t6.score
</select> </select>
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
<insert id="syncRecentDeductedComplaintScore"> <insert id="syncRecentDeductedComplaintScore">
insert into recent_deducted_complaint_score (technician_id, score) insert into recent_deducted_complaint_score (technician_id, score)
select t1.technician_id, sum(t3.score) as score select tt.technician_id, sum(tt.score)
from complaint_detailed_technician t1 from (select t1.technician_id, t3.score as score
left join complaint_detailed t2 on t1.complaint_detailed_id = t2.id from complaint_detailed_technician t1
left join complaint_level_score_config t3 on t2.`level` = t3.`level` left join complaint_detailed t2 on t1.complaint_detailed_id = t2.id
where t2.create_date > '2020-06-20' left join complaint_level_score_config t3 on t2.`level` = t3.`level`
group by t1.technician_id where t2.create_date > #{localDate}
group by t2.main_id) tt
group by tt.technician_id
</insert> </insert>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment