|
|
@@ -163,7 +163,7 @@
|
|
|
(r.STATUS = 3, 1, 0)) AS completed,
|
|
|
sum(r.exception_count) AS exceptionCount
|
|
|
FROM core_resumption r
|
|
|
- INNER JOIN core_resumption_plan p ON r.plan_id = p.id
|
|
|
+ INNER JOIN core_resumption_plan p ON r.plan_id = p.id and p.plan_cycle < 5
|
|
|
WHERE r.ymd_date BETWEEN #{startDate}
|
|
|
AND #{endDate}
|
|
|
AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
@@ -178,8 +178,18 @@
|
|
|
sum(r.exception_count) AS exceptionCount
|
|
|
FROM core_safety_task r
|
|
|
INNER JOIN core_safecheck_plan p ON r.plan_id = p.id
|
|
|
- WHERE r.ymd_date BETWEEN #{startDate}
|
|
|
- AND #{endDate}
|
|
|
+ WHERE ((
|
|
|
+ #{startDate} <![CDATA[<=]]> r.plan_start_time
|
|
|
+ and #{endDate} >= r.plan_start_time
|
|
|
+ )
|
|
|
+ or (
|
|
|
+ #{startDate} <![CDATA[<=]]> r.plan_end_time
|
|
|
+ and #{endDate} >= r.plan_end_time
|
|
|
+ )
|
|
|
+ or (
|
|
|
+ #{startDate} >= r.plan_start_time
|
|
|
+ and #{endDate} <![CDATA[<=]]> r.plan_end_time
|
|
|
+ ))
|
|
|
AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
GROUP BY p.check_type
|
|
|
</select>
|
|
|
@@ -197,8 +207,18 @@
|
|
|
SELECT count(0) AS total,
|
|
|
sum(r.STATUS = 3) AS completed
|
|
|
FROM core_drill_task r
|
|
|
- WHERE r.start_date BETWEEN #{startDate}
|
|
|
- AND #{endDate}
|
|
|
+ WHERE ((
|
|
|
+ #{startDate} <![CDATA[<=]]> r.start_date
|
|
|
+ and #{endDate} >= r.start_date
|
|
|
+ )
|
|
|
+ or (
|
|
|
+ #{startDate} <![CDATA[<=]]> r.end_date
|
|
|
+ and #{endDate} >= r.end_date
|
|
|
+ )
|
|
|
+ or (
|
|
|
+ #{startDate} >= r.start_date
|
|
|
+ and #{endDate} <![CDATA[<=]]> r.end_date
|
|
|
+ ))
|
|
|
AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectSyntheticQuestion" resultType="com.xunmei.core.board.dto.app.AppSyntheticQuestionDto">
|
|
|
@@ -217,10 +237,10 @@
|
|
|
(q.reform_status = 11, 1, 0)) AS reformedCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.src_type = 1 AND q.src_task_type != 6, 1, 0)) AS resumptionCount,
|
|
|
+ (q.src_type = 1 AND (q.src_task_type = 1 or q.src_task_type = 2 or q.src_task_type = 3), 1, 0)) AS resumptionCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.src_type = 1 AND q.src_task_type != 6 AND q.reform_status = 11, 1,
|
|
|
+ (q.src_type = 1 AND (q.src_task_type = 1 or q.src_task_type = 2 or q.src_task_type = 3) AND q.reform_status = 11, 1,
|
|
|
0)) resumptionReformedCount,
|
|
|
sum(
|
|
|
IF
|
|
|
@@ -256,9 +276,10 @@
|
|
|
</select>
|
|
|
<select id="selectSyntheticEdu" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
SELECT count(0) as total, sum(`status` = 2) as completed
|
|
|
- from core_edu_training_task
|
|
|
- where start_date BETWEEN #{startDate} and #{endDate}
|
|
|
- AND org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
+ from core_edu_training_task t
|
|
|
+ inner join core_edu_training_plan p on t.plan_id =p.id and p.plan_cycle < 4
|
|
|
+ where t.start_date BETWEEN #{startDate} and #{endDate}
|
|
|
+ AND t.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectSyntheticInout" resultType="com.xunmei.core.board.vo.app.AppSyntheticInOutVo">
|
|
|
SELECT COUNT(*) as total,
|
|
|
@@ -273,9 +294,10 @@
|
|
|
and o.path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectSyntheticMonitor" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
- SELECT count(0) as total, sum(`status` = 2) as completed
|
|
|
- from core_monitoring_retrieval_task
|
|
|
- where ymd_date BETWEEN '2023-11-1' and '2023-11-30'
|
|
|
- and org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
+ SELECT count(0) as total, sum(t.`status` = 2) as completed
|
|
|
+ from core_monitoring_retrieval_task t
|
|
|
+ inner join core_monitoring_retrieval_plan p on t.plan_id =p.id and p.plan_cycle < 4
|
|
|
+ where t.ymd_date BETWEEN #{startDate} and #{endDate}
|
|
|
+ and t.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
</mapper>
|