Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
358cc69d28
  1. 26
      mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

26
mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

@ -28,8 +28,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by a.name
order by rateNumber desc
</select>
<select id="getResolvedRate" resultType="java.util.Map">
select t.name, t.resolved, t.sum, CASE WHEN t.sum = 0 THEN 0 ELSE (t.resolved / t.sum) * 100 END AS rateNumber, concat(rateNumber, '%') rate
select t.name, t.resolved, t.sum, CASE WHEN t.sum = 0 THEN 0 ELSE (ROUND(t.resolved / t.sum)) * 100 END AS rateNumber, concat(rateNumber, '%') rate
from
(select a.name, SUM(COALESCE(b.resolved, 0)) resolved,
SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) sum
@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where ((a.category = '2' and a.name like '%局') or a.name='交警支队')and a.name != '公交分局' and a.name != '森林公安局' and a.name != '经开区分局'
group by a.name) t order by rateNumber desc
</select>
<select id="getSatisfiedRate" resultType="java.util.Map">
select a.name,
ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0) rateNumber,
@ -103,8 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAllCompletedRate" resultType="java.util.Map">
select
CONCAT(ROUND(SUM(COALESCE(b.resolved, 0))*100 / NULLIF(COUNT(1), 0),0),'%') AS completedRate,
SUM(COALESCE(b.resolved, 0)) AS completed,
CONCAT(ROUND(SUM(COALESCE(b.completed, 0))*100 / NULLIF(COUNT(1), 0),0),'%') AS completedRate,
SUM(COALESCE(b.completed, 0)) AS completed,
COUNT(1) AS completedSum
from mail_mark b left join dept a on a.id=b.second_dept_id where 1=1
@ -182,24 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
GROUP BY month order by month
</select>
<!-- <select id="mapData" resultType="java.util.Map">-->
<!-- select d.name, a.id,-->
<!-- (select count(1) mailCount from mail c where c.create_time>=CURRENT_DATE and c.second_dept_id=a.id) todaysum ,-->
<!-- CONCAT(ROUND(sum(COALESCE(b.resolved, 0))*100/count(1),0),'%') resolvedRate,-->
<!-- SUM(COALESCE(b.resolved, 0)) resolved,-->
<!-- ROUND(sum(COALESCE(b.completed, 0))*100/count(b.mail_id),0) value,-->
<!-- CONCAT(ROUND(sum(COALESCE(b.completed, 0))*100/count(b.mail_id),0),'%') completedRate,-->
<!-- SUM(COALESCE(b.completed, 0)) completed,-->
<!-- CONCAT(ROUND(sum(COALESCE(b.satisfied, 0))*100/count(1),0),'%') satisfiedRate,-->
<!-- SUM(COALESCE(b.satisfied, 0)) satisfied,-->
<!-- count(1) allsum-->
<!-- from mail_mark b left join dept a on a.id=b.second_dept_id-->
<!-- inner join county_street_dept d on b.second_dept_id=d.dept_id-->
<!-- where 1=1-->
<!-- <if test="deptId != null and deptId != ''"> and b.second_dept_id=#{deptId}</if>-->
<!-- GROUP BY d.name,a.id-->
<!-- </select>-->
<select id="mapData" resultType="java.util.Map">
SELECT d.name, a.id,
(
@ -341,4 +326,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by a.name
order by rateNumber desc
</select>
</mapper>

Loading…
Cancel
Save