Browse Source

信件分类统计大类型

master
laishajiang 2 years ago
parent
commit
b1e06c1738
  1. 31
      mailbox-lan/src/main/resources/mapper/DataMapper.xml

31
mailbox-lan/src/main/resources/mapper/DataMapper.xml

@ -20,6 +20,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
where a.level = '2'
<if test="deptId != null">
and a.id = #{deptId}
</if>
group by a.name,a.sort
order by crateNumber desc
@ -36,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
where a.level = '2'
<if test="deptId != null">
and a.id = #{deptId}
</if>
group by a.name) t order by rateNumber desc
) t2 on t1.cname = t2.rname
@ -55,7 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
where a.level = '2'
<if test="deptId != null">
and a.id = #{deptId}
</if>
group by a.name
order by srateNumber desc
) t4 on t3.cname = t4.sname ORDER BY score desc ,sort
@ -75,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
COUNT(1) AS cSum,
(SELECT COUNT(*) FROM mail_mark b where 1=1
<if test="searchStartTime != null and searchEndTime != null">
AND b.completion_time BETWEEN #{searchStartTime} AND (to_date(#{searchEndTime}) + interval '1 D')
AND b.completion_time BETWEEN #{searchStartTime} AND #{searchEndTime}
</if>) AS total
from mail_mark b left join dept a on a.id=b.second_dept_id where 1=1
<if test="searchStartTime != null and searchEndTime != null">
@ -85,9 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) t1
join
(
select CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END),0),'%') Rate,
SUM(COALESCE(b.resolved, 0)) resolved,SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) rSum,
(
select CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END),0),'%') Rate,
SUM(COALESCE(b.resolved, 0)) resolved,SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) rSum,
(SELECT COUNT(*) FROM mail_mark b where 1=1
<if test="searchStartTime != null and searchEndTime != null">
AND b.completion_time BETWEEN #{searchStartTime} AND #{searchEndTime}
@ -129,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
CONCAT(crateNumber,'%') crate,
SUM(COALESCE(b.completed, 0)) completed,count(1) csum
from dept a left join mail_mark b on a.id = b.second_dept_id
from dept a left join mail_mark b on a.id = b.three_dept_id
<if test="searchStartTime != null and searchEndTime != null">
AND b.completion_time BETWEEN #{searchStartTime} AND #{searchEndTime}
@ -137,7 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.level = '3'
<if test="deptId != null">
and a.pid = #{deptId} or a.id = #{deptId}
and a.pid = #{deptId}
</if>
group by a.name,a.sort
order by crateNumber desc
@ -148,14 +155,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from
(select a.name, SUM(COALESCE(b.resolved, 0)) resolved,
SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) sum
from dept a left join mail_mark b on a.id = b.second_dept_id
from dept a left join mail_mark b on a.id = b.three_dept_id
<if test="searchStartTime != null and searchEndTime != null">
AND b.completion_time BETWEEN #{searchStartTime} AND #{searchEndTime}
</if>
where a.level = '3'
<if test="deptId != null">
and a.pid = #{deptId} or a.id = #{deptId}
and a.pid = #{deptId}
</if>
group by a.name) t order by rateNumber desc
@ -169,14 +176,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 srateNumber,
CONCAT(srateNumber,'%') srate
from dept a left join mail_mark b on a.id = b.second_dept_id
from dept a left join mail_mark b on a.id = b.three_dept_id
<if test="searchStartTime != null and searchEndTime != null">
AND b.completion_time BETWEEN #{searchStartTime} AND #{searchEndTime}
</if>
where a.level = '3'
<if test="deptId != null">
and a.pid = #{deptId} or a.id = #{deptId}
and a.pid = #{deptId}
</if>
group by a.name
order by srateNumber desc

Loading…
Cancel
Save