|
|
@@ -82,20 +82,20 @@
|
|
|
WHERE t.end_date >= #{date}
|
|
|
and t.end_date <= #{end}
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
- and (p.plan_cycle < 4 or t.plan_id is null)
|
|
|
+ <!-- and (p.plan_cycle < 4 or t.plan_id is null) -->
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOverViewDrillTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
SELECT sum(if(t.end_date >= #{date}, 1, 0)) as total,
|
|
|
- sum(if(t.end_date >= #{date}, (if(t.`status` = 4, 1, 0)), 0)) as completed,
|
|
|
+ sum(if(t.end_date >= #{date}, (if(t.`status` = 3 or t.`status` = 2, 1, 0)), 0)) as completed,
|
|
|
sum(if(t.end_date < #{date}, 1, 0)) as prevTotal,
|
|
|
- sum(if(t.end_date < #{date}, (if(t.`status` = 4, 1, 0)), 0)) as prevcompleted
|
|
|
+ sum(if(t.end_date < #{date}, (if(t.`status` = 3 or t.`status` = 2, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_drill_task t
|
|
|
left join core_drill_plan p on t.plan_id = p.id
|
|
|
- WHERE t.end_date >= #{prevdate}
|
|
|
+ WHERE t.end_date >= #{date}
|
|
|
and t.end_date <= #{end}
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
- and (p.plan_cycle < 5 or t.plan_id is null)
|
|
|
+ <!-- and (p.plan_cycle < 5 or t.plan_id is null) -->
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOverViewMonitorTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
@@ -110,7 +110,7 @@
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOverViewQuestionInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
- SELECT sum(if(confirm_status >= 2, 1, 0)) as total,
|
|
|
+ SELECT sum(if(confirm_status >= 2 and reform_status is not null, 1, 0)) as total,
|
|
|
sum(if(reform_status = 11, 1, 0)) as completed
|
|
|
FROM core_question
|
|
|
WHERE submit_time >= #{date}
|
|
|
@@ -191,18 +191,10 @@
|
|
|
sum(r.exception_count) AS exceptionCount
|
|
|
FROM core_safety_task r
|
|
|
left JOIN core_safecheck_plan p ON r.plan_id = p.id
|
|
|
- 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
|
|
|
- ))
|
|
|
+ WHERE (
|
|
|
+ #{startDate} <![CDATA[<=]]> r.plan_end_time
|
|
|
+ and #{endDate} >= r.plan_end_time
|
|
|
+ )
|
|
|
AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
GROUP BY p.check_type
|
|
|
</select>
|
|
|
@@ -220,18 +212,10 @@
|
|
|
SELECT count(0) AS total,
|
|
|
sum(r.STATUS = 3) AS completed
|
|
|
FROM core_drill_task r
|
|
|
- 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
|
|
|
- ))
|
|
|
+ WHERE (
|
|
|
+ #{startDate} <![CDATA[<=]]> r.end_date
|
|
|
+ and #{endDate} >= r.end_date
|
|
|
+ )
|
|
|
AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectSyntheticQuestion" resultType="com.xunmei.core.board.dto.app.AppSyntheticQuestionDto">
|
|
|
@@ -278,18 +262,10 @@
|
|
|
(q.confirm_status >= 2 AND q.reform_status IS NOT NULL AND q.src_type = 2, 1, 0)) AS safetyCheckConfirmedCount,
|
|
|
sum(if(q.reform_status = 10 and q.reform_deadline <= #{today}, 1, 0)) as overdueCount
|
|
|
FROM core_question q
|
|
|
- WHERE ((
|
|
|
- #{startDate} <![CDATA[<=]]> q.submit_time
|
|
|
- and #{endDate} >= q.submit_time
|
|
|
- )
|
|
|
- or (
|
|
|
- #{startDate} <![CDATA[<=]]> q.reform_deadline
|
|
|
- and #{endDate} >= q.reform_deadline
|
|
|
- )
|
|
|
- or (
|
|
|
- #{startDate} >= q.submit_time
|
|
|
- and #{endDate} <![CDATA[<=]]> q.reform_deadline
|
|
|
- ))
|
|
|
+ WHERE (
|
|
|
+ #{startDate} <![CDATA[<=]]> q.reform_deadline
|
|
|
+ and #{endDate} >= q.reform_deadline
|
|
|
+ )
|
|
|
AND q.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOverDueQuestionCount" resultType="java.lang.Integer">
|