|
|
|
|
@ -20,22 +20,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
select a.name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.completed, 0)) completed,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 |
|
|
|
|
-- 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 |
|
|
|
|
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 != '森林公安局' |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
<select id="getResolvedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name, |
|
|
|
|
CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.resolved, 0)) resolved,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 |
|
|
|
|
-- 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 |
|
|
|
|
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 != '森林公安局' |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
<select id="getSatisfiedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber, |
|
|
|
|
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 |
|
|
|
|
-- 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 |
|
|
|
|
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 != '森林公安局' |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -268,5 +280,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
order by create_time desc limit 1 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="getOtherStationCompletedRateByDept" resultType="java.util.Map" parameterType="String"> |
|
|
|
|
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.completed, 0)) completed,count(1) sum |
|
|
|
|
from dept a inner join mail_mark b on a.id=b.second_dept_id where b.second_dept_id=#{deptId} |
|
|
|
|
GROUP BY three_dept_name order by rateNumber desc ,sum desc limit 10 |
|
|
|
|
</select> |
|
|
|
|
<select id="getOtherStationResolvedRateByDept" resultType="java.util.Map" parameterType="String"> |
|
|
|
|
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.resolved, 0)) resolved,count(1) sum |
|
|
|
|
from dept a inner join mail_mark b on a.id=b.second_dept_id where b.second_dept_id=#{deptId} |
|
|
|
|
GROUP BY three_dept_name order by rateNumber desc ,sum desc limit 10 |
|
|
|
|
</select> |
|
|
|
|
<select id="getOtherStationSatisfiedRateByDept" resultType="java.util.Map" parameterType="String"> |
|
|
|
|
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.satisfied, 0)) satisfied,count(1) sum |
|
|
|
|
from dept a inner join mail_mark b on a.id=b.second_dept_id where b.second_dept_id=#{deptId} |
|
|
|
|
GROUP BY three_dept_name order by rateNumber desc ,sum desc limit 10 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="getOtherCompletedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.completed, 0)) completed,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 |
|
|
|
|
from dept a left join mail_mark b on a.id = b.second_dept_id |
|
|
|
|
where |
|
|
|
|
a.level = '2' and (((a.category = '3' or a.category = '4')and a.name != '交警支队') |
|
|
|
|
or a.name = '公交分局' |
|
|
|
|
or a.name = '森林公安局') |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
<select id="getOtherResolvedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name, |
|
|
|
|
CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0) rateNumber, |
|
|
|
|
SUM(COALESCE(b.resolved, 0)) resolved,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 |
|
|
|
|
from dept a left join mail_mark b on a.id = b.second_dept_id |
|
|
|
|
where |
|
|
|
|
a.level = '2' and (((a.category = '3' or a.category = '4')and a.name != '交警支队') |
|
|
|
|
or a.name = '公交分局' |
|
|
|
|
or a.name = '森林公安局') |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
<select id="getOtherSatisfiedRate" resultType="java.util.Map"> |
|
|
|
|
select a.name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate, |
|
|
|
|
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber, |
|
|
|
|
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 |
|
|
|
|
from dept a left join mail_mark b on a.id = b.second_dept_id |
|
|
|
|
where |
|
|
|
|
a.level = '2' and (((a.category = '3' or a.category = '4')and a.name != '交警支队') |
|
|
|
|
or a.name = '公交分局' |
|
|
|
|
or a.name = '森林公安局') |
|
|
|
|
group by a.name |
|
|
|
|
order by rateNumber desc |
|
|
|
|
</select> |
|
|
|
|
</mapper> |
|
|
|
|
|