Commit f25f9330 by Wangmin

bugfix

parent 02c8be32
......@@ -88,17 +88,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY satisfaction_rate desc
</select>
<select id="selectEmployeesById" resultType="com.pz.merchant.domain.vo.EmployeesVo">
SELECT e.id, s.avatar ,e.name,e.working_hours,(SUM(CASE WHEN o.is_satisfaction = 1 THEN 1 ELSE 0 END) / NULLIF(COUNT(o.is_satisfaction), 0)) * 100 AS satisfaction_rate
SELECT e.id,
s.avatar,
e.name,
e.working_hours,
concat(round((sum(if(o.is_satisfaction = 1, 1, 0)) / count(o.id)) * 100, 2)) AS satisfaction_rate
FROM employees e
INNER join total_order o on o.em_id = e.id
left join company c on c.id = e.company_id
left join sys_user s on s.user_id = e.uid
WHERE e.`status` = 1 and e.now_type= 1 and e.del_flag= 0 and e.id = #{id}
GROUP BY
e.id,
WHERE e.`status` = 1
and e.now_type = 1
and e.del_flag = 0
and e.id = #{id}
GROUP BY e.id,
e.`name`
HAVING
satisfaction_rate >= #{favorableRate};
HAVING satisfaction_rate >= #{favorableRate};
</select>
<select id="selectOrder" resultType="com.pz.merchant.domain.vo.OrderInfoVO">
......
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