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 a.id=b.three_dept_id where b.second_dept_id=#{deptId}
GROUP BY three_dept_name order by rateNumber desc limit 10
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0),'%') rate, 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 a.id=b.three_dept_id where b.second_dept_id=#{deptId} GROUP BY three_dept_name order by rate desc limit 10
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 a.id=b.three_dept_id where b.second_dept_id=#{deptId}
GROUP BY three_dept_name order by rateNumber desc limit 10
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') rate,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 a.id=b.three_dept_id where b.second_dept_id=#{deptId} GROUP BY three_dept_name order by rate desc limit 10
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 a.id=b.three_dept_id where b.second_dept_id=#{deptId}
GROUP BY three_dept_name order by rateNumber desc limit 10
select b.three_dept_name name,CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') rate,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 a.id=b.three_dept_id where b.second_dept_id=#{deptId} GROUP BY three_dept_name order by rate desc limit 10