41 lines
2.1 KiB
XML
41 lines
2.1 KiB
XML
|
|
<?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.sercurityControl.proteam.dutyTask.mapper.DutyStatisticsMapper">
|
||
|
|
|
||
|
|
<!--值班统计列表-->
|
||
|
|
<select id="getDutyStatisticsList"
|
||
|
|
resultType="com.sercurityControl.proteam.dutyTask.domain.DutyStatisticsEntity">
|
||
|
|
SELECT
|
||
|
|
ANY_VALUE(IFNULL(tub.scheduling_name,su.login_name)) AS checkUser,
|
||
|
|
COUNT(check_user) AS totalTaskNum,
|
||
|
|
ANY_VALUE(COUNT(IF(is_check = '1',1,NULL))) AS finshTaskNum,
|
||
|
|
ANY_VALUE(CONVERT(SUM(check_time) / 60,DECIMAL(11,2))) AS checkTime,
|
||
|
|
ANY_VALUE(IFNULL(SUM(a.num),0)) AS issueNum
|
||
|
|
FROM t_class_metting_check tcmc
|
||
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
||
|
|
LEFT JOIN tb_user_banding tub ON tcmc.check_user = tub.login_user_id AND tcmc.create_time = tub.banding_date AND tub.is_flag = '0'
|
||
|
|
LEFT JOIN (
|
||
|
|
SELECT tcmc.class_id,COUNT(tnv.class_id) AS num
|
||
|
|
FROM t_class_metting_check tcmc
|
||
|
|
LEFT JOIN t_notice_voi tnv ON tcmc.class_id = tnv.class_id
|
||
|
|
WHERE tcmc.create_time = #{createTime} AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
||
|
|
AND tnv.`status` NOT IN ('7','8') AND (tnv.sup_type = '1' OR tnv.sup_type IS NULL)
|
||
|
|
GROUP BY tcmc.class_id
|
||
|
|
)a ON a.class_id = tcmc.class_id
|
||
|
|
<where>
|
||
|
|
<if test="isSup != 1">
|
||
|
|
tcmc.check_user = #{currentUserId}
|
||
|
|
</if>
|
||
|
|
<if test="checkUser!='' and checkUser!=null">
|
||
|
|
AND INSTR(IFNULL(tub.scheduling_name,su.login_name),#{checkUser}) > 0
|
||
|
|
</if>
|
||
|
|
<if test="createTime!='' and createTime!=null">
|
||
|
|
AND tcmc.create_time = #{createTime}
|
||
|
|
</if>
|
||
|
|
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
||
|
|
</where>
|
||
|
|
GROUP BY check_user
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|