2024-08-15 23:12:50 +08:00
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ics.admin.mapper.RepairStatsMapper">
|
|
|
|
|
|
2024-08-17 01:05:19 +08:00
|
|
|
|
<select id="selectRepairWorkerStatsList" parameterType="com.ics.admin.vo.RepairWorkerStatsVo" resultType="com.ics.admin.vo.RepairWorkerStatsVo">
|
2024-08-15 23:12:50 +08:00
|
|
|
|
SELECT id, username, mobile, typeid, typename, zs, process, closed, Unresolved, pj,
|
|
|
|
|
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
|
|
|
|
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
|
|
|
|
case when pj>0 then CONCAT(l,',',ROUND(l/pj*100,1),'%') else '0,0%' end as l
|
|
|
|
|
FROM worker_stats
|
|
|
|
|
<where>
|
|
|
|
|
<if test="username != null and username != ''">AND username LIKE CONCAT('%', #{username}, '%')</if>
|
|
|
|
|
<if test="mobile != null and mobile != ''">AND mobile LIKE CONCAT('%', #{mobile}, '%')</if>
|
|
|
|
|
<if test="typeid != null">AND typeid = #{typeid}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-08-17 01:05:19 +08:00
|
|
|
|
<select id="selectRepairFloorStatsVoList" parameterType="com.ics.admin.vo.RepairFloorStatsVo" resultType="com.ics.admin.vo.RepairFloorStatsVo">
|
2024-08-15 23:12:50 +08:00
|
|
|
|
SELECT id, name, mobile, adr, zs, process, closed, Unresolved, pj,
|
|
|
|
|
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
|
|
|
|
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
|
|
|
|
case when pj>0 then CONCAT(l,',',ROUND(l/pj*100,1),'%') else '0,0%' end as l
|
|
|
|
|
FROM floor_stats
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != null and name != ''">AND name LIKE CONCAT('%', #{name}, '%')</if>
|
|
|
|
|
<if test="mobile != null and mobile != ''">AND mobile LIKE CONCAT('%', #{mobile}, '%')</if>
|
|
|
|
|
<if test="adr != null and adr != ''">AND adr LIKE CONCAT('%', #{adr}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-08-17 01:05:19 +08:00
|
|
|
|
<!-- 第一行 管理员 工单与 通知统计 -->
|
|
|
|
|
<select id="repairAdminStats" resultType="com.ics.admin.vo.RepairAdminStatsVo">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT `wait`,`anew`,0 as newnotice,0 as oldnotice FROM
|
|
|
|
|
(SELECT count(id) as `wait` FROM ics_repair where delete_flag=0 and status=3) as A,
|
|
|
|
|
(SELECT count(DISTINCT repair_id) as `anew` FROM ics_repair_log where delete_flag=0 and node_form=3) as B
|
|
|
|
|
]]>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- 第二、三行 工单统计、工单完成情况、评价情况 -->
|
|
|
|
|
<select id="repairStats" resultType="com.ics.admin.vo.RepairStatsVo">
|
2024-08-15 23:12:50 +08:00
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT
|
|
|
|
|
count(id) zs,
|
2024-08-17 01:05:19 +08:00
|
|
|
|
sum(case when status < 9 then 1 else 0 end) `wait`,
|
|
|
|
|
sum(case when predate is not null and predate < now() and status < 9 then 1 else 0 end) timeout,
|
|
|
|
|
sum(case when eval_service is not null then 1 else 0 end) as pj,
|
|
|
|
|
sum(case when eval_service is not null and eval_service >=4 then 1 else 0 end) as h,
|
|
|
|
|
sum(case when eval_service is not null and eval_service =3 then 1 else 0 end) as m,
|
|
|
|
|
sum(case when eval_service is not null and eval_service <=2 then 1 else 0 end) as l,
|
|
|
|
|
sum(case when status > 7 then 1 else 0 end) wc,
|
|
|
|
|
sum(case when timeout =5 and status>=9 then 1 else 0 end) htimeout,
|
|
|
|
|
sum(case when timeout =3 and status>=9 then 1 else 0 end) mtimeout,
|
|
|
|
|
sum(case when predate < end_date and timeout=1 and status>=9 then 1 else 0 end) ltimeout,
|
|
|
|
|
sum(case when predate > end_date and timeout=1 and status>=9 then 1 else 0 end) ntimeout
|
2024-08-15 23:12:50 +08:00
|
|
|
|
FROM
|
|
|
|
|
ics_repair
|
|
|
|
|
WHERE
|
2024-08-17 01:05:19 +08:00
|
|
|
|
delete_flag = 0 and create_time between #{startTime} and #{endTime}
|
2024-08-15 23:12:50 +08:00
|
|
|
|
]]>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-08-17 01:05:19 +08:00
|
|
|
|
|
2024-08-15 23:12:50 +08:00
|
|
|
|
</mapper>
|