|
@@ -1,13 +1,51 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xintong.visualinspection.dao.master.StatisticsDao" >
|
|
<mapper namespace="com.xintong.visualinspection.dao.master.StatisticsDao" >
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="deletedUser">
|
|
|
|
|
+ (select t_s_y.id,date_sub(t_p.starttime,interval 1 hour) as starttime from t_sys_users t_s_y
|
|
|
|
|
+ LEFT join (select starttime,endtime from check_task_period ) t_p on DELETE_TIME >= starttime and DELETE_TIME < endtime
|
|
|
|
|
+ WHERE STATUS =-1 and DELETE_TIME >= t_p.starttime and DELETE_TIME < t_p.endtime ) deleted_user
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="taskexclouddeleteUser">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ ( select id from ( select check_task.*,deleted_user.starttime as u_delet_time from check_task left join
|
|
|
|
|
+ <include refid="deletedUser"/>
|
|
|
|
|
+ on check_task.checked_person = deleted_user.id ) v_task where v_task.u_delet_time is not null and v_task.end_time > v_task.u_delet_time
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="classexclouddeleteUser">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ (select id from ( select sys_user_class.*,deleted_user.starttime as u_delet_time from sys_user_class left join
|
|
|
|
|
+ <include refid="deletedUser"/>
|
|
|
|
|
+ on sys_user_class.user_id = deleted_user.id ) v_user_class where v_user_class.u_delet_time is not null and v_user_class.end_time > v_user_class.u_delet_time
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="unregularclassexclouddeleteUser">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ (select id from ( select sys_user_class_unregular.*,deleted_user.starttime as u_delet_time from sys_user_class_unregular left join
|
|
|
|
|
+ <include refid="deletedUser"/>
|
|
|
|
|
+ on sys_user_class_unregular.user_id = deleted_user.id ) v_user_class where v_user_class.u_delet_time is not null and v_user_class.end_time > v_user_class.u_delet_time
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
<select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
<select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
SELECT u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name FROM (
|
|
SELECT u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name FROM (
|
|
|
SELECT t.checked_person , t.checked_dept,ci.parent_id, t.check_item_score AS score FROM check_score t
|
|
SELECT t.checked_person , t.checked_dept,ci.parent_id, t.check_item_score AS score FROM check_score t
|
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
|
- WHERE 1=1 and ct.check_status!=22
|
|
|
|
|
|
|
+ WHERE 1=1 and ct.check_status!=22 and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -22,7 +60,7 @@
|
|
|
|
|
|
|
|
SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
|
|
SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
|
|
|
a.monitor_user_id != -1 and a.monitor_user_id != 0 and
|
|
a.monitor_user_id != -1 and a.monitor_user_id != 0 and
|
|
|
- a.start_time >= #{start_time} and a.end_time < #{end_time} and a.check_status !=22
|
|
|
|
|
|
|
+ a.start_time >= #{start_time} and a.end_time < #{end_time} and a.check_status !=22 and a.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -31,7 +69,7 @@
|
|
|
|
|
|
|
|
select sum(num) AS num from (
|
|
select sum(num) AS num from (
|
|
|
SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct
|
|
SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct
|
|
|
- WHERE ct.check_status != 22
|
|
|
|
|
|
|
+ WHERE ct.check_status != 22 and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="dept_id!=null">
|
|
<if test="dept_id!=null">
|
|
|
AND ct.checked_dept = #{dept_id}
|
|
AND ct.checked_dept = #{dept_id}
|
|
|
</if>
|
|
</if>
|
|
@@ -53,7 +91,7 @@
|
|
|
|
|
|
|
|
<select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
<select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
SELECT COUNT(1) AS checked_num , t.checked_person AS user_id FROM check_task t
|
|
SELECT COUNT(1) AS checked_num , t.checked_person AS user_id FROM check_task t
|
|
|
- WHERE 1=1 and t.check_status!=22
|
|
|
|
|
|
|
+ WHERE 1=1 and t.check_status!=22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND t.start_time >= #{start_date} AND t.end_time < #{end_date}
|
|
AND t.start_time >= #{start_date} AND t.end_time < #{end_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -66,7 +104,7 @@
|
|
|
<select id="selectFeeStationCheckNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
<select id="selectFeeStationCheckNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
SELECT COUNT(DISTINCT( t.checked_person )) AS checked_people_num , COUNT(t.checked_person) AS checked_num ,t.checked_dept AS dept_id
|
|
SELECT COUNT(DISTINCT( t.checked_person )) AS checked_people_num , COUNT(t.checked_person) AS checked_num ,t.checked_dept AS dept_id
|
|
|
FROM check_task t left join t_sys_users u on t.checked_person = u.id
|
|
FROM check_task t left join t_sys_users u on t.checked_person = u.id
|
|
|
- WHERE 1=1 and t.check_status!=22
|
|
|
|
|
|
|
+ WHERE 1=1 and t.check_status!=22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND t.start_time >= #{start_date} AND t.end_time < #{end_date}
|
|
AND t.start_time >= #{start_date} AND t.end_time < #{end_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -85,7 +123,7 @@
|
|
|
FROM check_score t
|
|
FROM check_score t
|
|
|
LEFT JOIN check_item c ON t.check_item_id = c.id
|
|
LEFT JOIN check_item c ON t.check_item_id = c.id
|
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
|
- WHERE 1=1 and ct.check_status!=22
|
|
|
|
|
|
|
+ WHERE 1=1 and ct.check_status!=22 and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -98,7 +136,7 @@
|
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
|
LEFT JOIN t_sys_users uu on t.checked_person = uu.id
|
|
LEFT JOIN t_sys_users uu on t.checked_person = uu.id
|
|
|
- WHERE 1=1 AND ct.check_status!=22 AND t.check_item_score is not null
|
|
|
|
|
|
|
+ WHERE 1=1 AND ct.check_status!=22 AND t.check_item_score is not null and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -124,7 +162,7 @@
|
|
|
FROM
|
|
FROM
|
|
|
check_score m INNER JOIN
|
|
check_score m INNER JOIN
|
|
|
( select * From check_task t
|
|
( select * From check_task t
|
|
|
- where t.check_status != 22
|
|
|
|
|
|
|
+ where t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date !=null">
|
|
<if test="start_date !=null">
|
|
|
AND t.start_time >= #{start_date}
|
|
AND t.start_time >= #{start_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -150,7 +188,7 @@
|
|
|
check_task t
|
|
check_task t
|
|
|
WHERE
|
|
WHERE
|
|
|
t.checked_person IS NOT NULL
|
|
t.checked_person IS NOT NULL
|
|
|
- AND t.check_status != 22
|
|
|
|
|
|
|
+ AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date !=null">
|
|
<if test="start_date !=null">
|
|
|
AND t.start_time >= #{start_date}
|
|
AND t.start_time >= #{start_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -193,7 +231,7 @@
|
|
|
<sql id="selectEveryCheckedInfo">
|
|
<sql id="selectEveryCheckedInfo">
|
|
|
SELECT SUM(sc.check_item_score) AS checkd_all_score , t.checked_person ,t.checked_dept FROM check_task t
|
|
SELECT SUM(sc.check_item_score) AS checkd_all_score , t.checked_person ,t.checked_dept FROM check_task t
|
|
|
INNER JOIN check_score sc ON sc.task_id = t.id
|
|
INNER JOIN check_score sc ON sc.task_id = t.id
|
|
|
- WHERE monthfunc( t.start_time ) = #{mth}
|
|
|
|
|
|
|
+ WHERE monthfunc( t.start_time ) = #{mth} and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
GROUP BY t.checked_person
|
|
GROUP BY t.checked_person
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
@@ -215,7 +253,7 @@
|
|
|
|
|
|
|
|
<select id="selectfeestationChekcedSocre" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
<select id="selectfeestationChekcedSocre" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
select tso.parentid , ci.name AS check_item_name ,sum(t.check_item_score) AS all_check_score, t.checked_dept FROM
|
|
select tso.parentid , ci.name AS check_item_name ,sum(t.check_item_score) AS all_check_score, t.checked_dept FROM
|
|
|
- ( SELECT ci.parent_id, t.* from check_score t INNER JOIN check_task ct ON ct.check_status !=22 AND monthfunc( ct.start_time ) = '2017/07' AND ct.id = t.task_id
|
|
|
|
|
|
|
+ ( SELECT ci.parent_id, t.* from check_score t INNER JOIN check_task ct ON ct.check_status !=22 and ct.id not in <include refid="taskexclouddeleteUser"/> AND monthfunc( ct.start_time ) = '2017/07' AND ct.id = t.task_id
|
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id ) t
|
|
LEFT JOIN check_item ci ON t.check_item_id = ci.id ) t
|
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
|
LEFT JOIN t_sys_organ tso ON tso.id = t.checked_dept
|
|
LEFT JOIN t_sys_organ tso ON tso.id = t.checked_dept
|
|
@@ -249,7 +287,7 @@
|
|
|
) t
|
|
) t
|
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
|
) m ON t.id = m.task_id
|
|
) m ON t.id = m.task_id
|
|
|
- where t.check_status !=22
|
|
|
|
|
|
|
+ where t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
AND monthfunc( t.start_time ) = #{mth}
|
|
AND monthfunc( t.start_time ) = #{mth}
|
|
|
GROUP BY m.parent_id
|
|
GROUP BY m.parent_id
|
|
|
</select>
|
|
</select>
|
|
@@ -266,7 +304,7 @@
|
|
|
FROM
|
|
FROM
|
|
|
check_score m INNER JOIN
|
|
check_score m INNER JOIN
|
|
|
( select * From check_task t
|
|
( select * From check_task t
|
|
|
- where t.check_status != 22
|
|
|
|
|
|
|
+ where t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date !=null">
|
|
<if test="start_date !=null">
|
|
|
AND t.start_time >= #{start_date}
|
|
AND t.start_time >= #{start_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -290,7 +328,7 @@
|
|
|
check_task t
|
|
check_task t
|
|
|
WHERE
|
|
WHERE
|
|
|
t.checked_person IS NOT NULL
|
|
t.checked_person IS NOT NULL
|
|
|
- AND t.check_status != 22
|
|
|
|
|
|
|
+ AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date !=null">
|
|
<if test="start_date !=null">
|
|
|
AND t.start_time >= #{start_date}
|
|
AND t.start_time >= #{start_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -319,7 +357,7 @@
|
|
|
) t
|
|
) t
|
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
LEFT JOIN check_item ci ON t.parent_id = ci.id
|
|
|
) m ON t.id = m.task_id
|
|
) m ON t.id = m.task_id
|
|
|
- where t.check_status !=22
|
|
|
|
|
|
|
+ where t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="start_date !=null">
|
|
<if test="start_date !=null">
|
|
|
AND t.start_time >= #{start_date}
|
|
AND t.start_time >= #{start_date}
|
|
|
</if>
|
|
</if>
|
|
@@ -345,7 +383,7 @@
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
LEFT JOIN (SELECT ci.* ,cp.name AS parent_name FROM check_item ci LEFT JOIN check_item cp ON ci.parent_id = cp.id) ci ON ci.id = cs.check_item_id
|
|
LEFT JOIN (SELECT ci.* ,cp.name AS parent_name FROM check_item ci LEFT JOIN check_item cp ON ci.parent_id = cp.id) ci ON ci.id = cs.check_item_id
|
|
|
- where t.check_status !=22
|
|
|
|
|
|
|
+ where t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="queryType!=null and queryType==0">
|
|
<if test="queryType!=null and queryType==0">
|
|
|
AND (cs.checked_person = #{user_id} OR t.monitor_user_id = #{user_id} )
|
|
AND (cs.checked_person = #{user_id} OR t.monitor_user_id = #{user_id} )
|
|
|
</if>
|
|
</if>
|
|
@@ -383,7 +421,7 @@
|
|
|
v_check_task t
|
|
v_check_task t
|
|
|
LEFT JOIN check_score cs ON t.id = cs.task_id
|
|
LEFT JOIN check_score cs ON t.id = cs.task_id
|
|
|
WHERE
|
|
WHERE
|
|
|
- t.check_status != 22
|
|
|
|
|
|
|
+ t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
<if test="checkman_id!=null and checkman_id!=''">
|
|
<if test="checkman_id!=null and checkman_id!=''">
|
|
|
AND t.checkman = #{checkman_id}
|
|
AND t.checkman = #{checkman_id}
|
|
|
</if>
|
|
</if>
|
|
@@ -412,7 +450,7 @@
|
|
|
SUM(cs.check_item_score ) AS all_checked_score , COUNT(DISTINCT cs.checked_person) AS checked_people_num , COUNT(DISTINCT cs.task_id) AS checked_task_num , count(1) AS all_checkman
|
|
SUM(cs.check_item_score ) AS all_checked_score , COUNT(DISTINCT cs.checked_person) AS checked_people_num , COUNT(DISTINCT cs.task_id) AS checked_task_num , count(1) AS all_checkman
|
|
|
FROM
|
|
FROM
|
|
|
check_score cs
|
|
check_score cs
|
|
|
- LEFT JOIN v_check_task t ON t.id = cs.task_id AND t.check_status != 22
|
|
|
|
|
|
|
+ LEFT JOIN v_check_task t ON t.id = cs.task_id AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
WHERE
|
|
WHERE
|
|
|
t.check_time >= #{start_date}
|
|
t.check_time >= #{start_date}
|
|
|
AND t.check_time < #{end_date}
|
|
AND t.check_time < #{end_date}
|
|
@@ -422,7 +460,7 @@
|
|
|
SELECT COUNT(1) AS unable_task_num FROM v_check_task t WHERE
|
|
SELECT COUNT(1) AS unable_task_num FROM v_check_task t WHERE
|
|
|
t.check_time >= #{start_date}
|
|
t.check_time >= #{start_date}
|
|
|
AND t.check_time < #{end_date}
|
|
AND t.check_time < #{end_date}
|
|
|
- AND t.check_status = 22
|
|
|
|
|
|
|
+ AND t.check_status = 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
</select>
|
|
</select>
|
|
|
<!--稽查人员工作量统计 end -->
|
|
<!--稽查人员工作量统计 end -->
|
|
|
|
|
|
|
@@ -468,8 +506,8 @@
|
|
|
|
|
|
|
|
<select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
<select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
|
SELECT t.* , ct.id AS check_id FROM sys_user_class t
|
|
SELECT t.* , ct.id AS check_id FROM sys_user_class t
|
|
|
- LEFT JOIN check_task ct ON t.id = ct.user_class_id AND ct.check_status != 22 AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
|
|
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
|
|
+ LEFT JOIN check_task ct ON t.id = ct.user_class_id AND ct.check_status != 22 and ct.id not in <include refid="taskexclouddeleteUser"/> AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="classexclouddeleteUser"/>
|
|
|
<include refid="select_Fswork_condition" />
|
|
<include refid="select_Fswork_condition" />
|
|
|
ORDER BY t.work_date , t.user_id
|
|
ORDER BY t.work_date , t.user_id
|
|
|
</select>
|
|
</select>
|
|
@@ -477,7 +515,7 @@
|
|
|
<select id="selectFsWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
|
|
<select id="selectFsWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
|
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.*
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.*
|
|
|
FROM sys_user_class t
|
|
FROM sys_user_class t
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="classexclouddeleteUser"/>
|
|
|
<include refid="select_Fswork_condition"/>
|
|
<include refid="select_Fswork_condition"/>
|
|
|
GROUP BY t.user_id
|
|
GROUP BY t.user_id
|
|
|
</select>
|
|
</select>
|
|
@@ -485,16 +523,16 @@
|
|
|
<select id="selectFsUnregularWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
<select id="selectFsUnregularWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
|
SELECT t.* , ct.id AS check_id FROM sys_user_class_unregular t
|
|
SELECT t.* , ct.id AS check_id FROM sys_user_class_unregular t
|
|
|
LEFT JOIN check_task ct ON (t.id = ct.user_class_unregular_id OR ( ct.start_time > t.start_time AND ct.end_time < t.end_time ) )
|
|
LEFT JOIN check_task ct ON (t.id = ct.user_class_unregular_id OR ( ct.start_time > t.start_time AND ct.end_time < t.end_time ) )
|
|
|
- AND ct.check_status != 22 AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
|
|
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
- <include refid="select_Fswork_condition" />
|
|
|
|
|
|
|
+ AND ct.check_status != 22 and ct.id not in <include refid="taskexclouddeleteUser"/> AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="unregularclassexclouddeleteUser"/>
|
|
|
|
|
+ <include refid="select_Fswork_condition" />
|
|
|
ORDER BY t.work_date
|
|
ORDER BY t.work_date
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectFsUnregularWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
|
|
<select id="selectFsUnregularWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
|
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.*
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.*
|
|
|
FROM sys_user_class_unregular t
|
|
FROM sys_user_class_unregular t
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="unregularclassexclouddeleteUser"/>
|
|
|
<include refid="select_Fswork_condition"/>
|
|
<include refid="select_Fswork_condition"/>
|
|
|
GROUP BY t.user_id
|
|
GROUP BY t.user_id
|
|
|
</select>
|
|
</select>
|
|
@@ -502,7 +540,7 @@
|
|
|
<select id="selectFsWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork" >
|
|
<select id="selectFsWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork" >
|
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , t.*
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , t.*
|
|
|
FROM sys_user_class t
|
|
FROM sys_user_class t
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="classexclouddeleteUser"/>
|
|
|
<include refid="select_Fswork_condition"/>
|
|
<include refid="select_Fswork_condition"/>
|
|
|
GROUP BY t.user_id , t.class_type
|
|
GROUP BY t.user_id , t.class_type
|
|
|
</select>
|
|
</select>
|
|
@@ -510,7 +548,7 @@
|
|
|
<select id="selectFsUnregularWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
<select id="selectFsUnregularWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
|
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , t.*
|
|
SELECT COUNT(DISTINCT(work_date)) AS work_days , t.*
|
|
|
FROM sys_user_class_unregular t
|
|
FROM sys_user_class_unregular t
|
|
|
- WHERE 1=1 AND t.user_id IS NOT NULL
|
|
|
|
|
|
|
+ WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="classexclouddeleteUser"/>
|
|
|
<include refid="select_Fswork_condition"/>
|
|
<include refid="select_Fswork_condition"/>
|
|
|
GROUP BY t.user_id , t.class_type
|
|
GROUP BY t.user_id , t.class_type
|
|
|
</select>
|
|
</select>
|
|
@@ -525,7 +563,7 @@
|
|
|
|
|
|
|
|
<select id="selectCheckAppealNum" parameterType="com.xintong.visualinspection.bean.CheckAppealStatistic" resultMap="appealNum" >
|
|
<select id="selectCheckAppealNum" parameterType="com.xintong.visualinspection.bean.CheckAppealStatistic" resultMap="appealNum" >
|
|
|
SELECT COUNT(t.appeal_dept) AS appeal_num ,t.appeal_dept AS dept_id,t.appeal_result FROM check_appeal t
|
|
SELECT COUNT(t.appeal_dept) AS appeal_num ,t.appeal_dept AS dept_id,t.appeal_result FROM check_appeal t
|
|
|
- INNER JOIN check_task ct ON t.task_id = ct.id WHERE 1=1
|
|
|
|
|
|
|
+ INNER JOIN check_task ct ON t.task_id = ct.id WHERE 1=1 and t.task_id not in <include refid="taskexclouddeleteUser"/> and t.task_id not in (select id from check_task where check_task.check_status = 22)
|
|
|
<if test="start_time!=null ">
|
|
<if test="start_time!=null ">
|
|
|
AND t.appeal_time >= #{start_time}
|
|
AND t.appeal_time >= #{start_time}
|
|
|
</if>
|
|
</if>
|