|
|
|
|
@ -41,10 +41,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<select id="getSatisfiedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name, |
|
|
|
|
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber, |
|
|
|
|
CONCAT(rateNumber,'%') rate, |
|
|
|
|
SUM(COALESCE(b.satisfied, 0)) satisfied,count(1) sum |
|
|
|
|
-- from dept a left join mail_mark b on a.id=b.second_dept_id where a.category='2' GROUP BY a.name order by rateNumber desc limit 10 |
|
|
|
|
SUM(COALESCE(b.satisfied, 0)) satisfied, |
|
|
|
|
SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) sum, |
|
|
|
|
CASE WHEN sum = 0 THEN 0 ELSE ROUND(sum(COALESCE(b.satisfied, 0))*100/sum,0) END rateNumber, |
|
|
|
|
CONCAT(rateNumber,'%') rate |
|
|
|
|
from dept a left join mail_mark b on a.id = b.second_dept_id |
|
|
|
|
where ((a.category = '2' and a.name like '%局') or a.name='交警支队')and a.name != '公交分局' and a.name != '森林公安局' and a.name != '经开区分局' |
|
|
|
|
group by a.name |
|
|
|
|
|