|
|
@@ -2,14 +2,14 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xunmei.core.board.mapper.AppCockpitMapper">
|
|
|
<select id="selectOrgOverview" resultType="com.xunmei.core.board.vo.app.AppOverviewVo">
|
|
|
- SELECT sum(IF(o.type = 3, 1, 0)) as hangsheCount,
|
|
|
- sum(IF(o.type = 4, 1, 0)) as bankingCount,
|
|
|
- sum(IF(o.type = 6, 1, 0)) as centerStoreCount,
|
|
|
- sum(o.type = 8 || oe.business_library=1) as bankingStoreCount,
|
|
|
- sum(IF(o.type = 5, 1, 0)) as offlineATMCount,
|
|
|
- sum(oe.self_service_bank =1) as onlineATMCount,
|
|
|
- sum(oe.lobby_equipment) as lobbyDeviceCount,
|
|
|
- sum(oe.wall_penetrating_equipment) as throughwallDeviceCount
|
|
|
+ SELECT sum(IF(o.type = 3, 1, 0)) as hangsheCount,
|
|
|
+ sum(IF(o.type = 4, 1, 0)) as bankingCount,
|
|
|
+ sum(IF(o.type = 6, 1, 0)) as centerStoreCount,
|
|
|
+ sum(o.type = 8 || oe.business_library = 1) as bankingStoreCount,
|
|
|
+ sum(IF(o.type = 5, 1, 0)) as offlineATMCount,
|
|
|
+ sum(oe.self_service_bank = 1) as onlineATMCount,
|
|
|
+ sum(oe.lobby_equipment) as lobbyDeviceCount,
|
|
|
+ sum(oe.wall_penetrating_equipment) as throughwallDeviceCount
|
|
|
from sys_org o
|
|
|
LEFT JOIN sys_org_extend oe on o.id = oe.org_id
|
|
|
WHERE o.deleted = 0
|
|
|
@@ -26,16 +26,20 @@
|
|
|
sum(m.ga382015prev) as ga382015prev
|
|
|
from sys_org o
|
|
|
LEFT JOIN (SELECT org_id,
|
|
|
- sum(standard = 1) AS ga382021,
|
|
|
+ sum(standard = 1) AS ga382021,
|
|
|
sum(IF
|
|
|
- (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0)) AS ga382021current,
|
|
|
+ (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0)) AS ga382021current,
|
|
|
sum(IF
|
|
|
- (standard = 1, IF(date_of_compliance < #{date} and date_of_compliance>=#{prevMonth}, 1, 0), 0)) AS ga382021prev,
|
|
|
- sum(standard = 2) AS ga382015,
|
|
|
+ (standard = 1,
|
|
|
+ IF(date_of_compliance < #{date} and date_of_compliance >= #{prevMonth}, 1,
|
|
|
+ 0), 0)) AS ga382021prev,
|
|
|
+ sum(standard = 2) AS ga382015,
|
|
|
sum(IF
|
|
|
- (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0)) AS ga382015current,
|
|
|
+ (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0)) AS ga382015current,
|
|
|
sum(IF
|
|
|
- (standard = 2, IF(date_of_compliance < #{date} and date_of_compliance>=#{prevMonth}, 1, 0), 0)) AS ga382015prev
|
|
|
+ (standard = 2,
|
|
|
+ IF(date_of_compliance < #{date} and date_of_compliance >= #{prevMonth}, 1,
|
|
|
+ 0), 0)) AS ga382015prev
|
|
|
FROM sys_org_physical_defense_construction
|
|
|
WHERE type = 1
|
|
|
OR type = 3
|
|
|
@@ -46,12 +50,12 @@
|
|
|
and o.path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOverViewResumptionTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
- SELECT sum(if(t.ymd_date >= #{date}, 1, 0)) as total,
|
|
|
+ SELECT sum(if(t.ymd_date >= #{date}, 1, 0)) as total,
|
|
|
sum(if(t.ymd_date >= #{date}, (if(t.`status` = 3, 1, 0)), 0)) as completed,
|
|
|
- sum(if(t.ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ sum(if(t.ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(t.ymd_date < #{date}, (if(t.`status` = 3, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_resumption t
|
|
|
- inner join core_resumption_plan p on t.plan_id=p.id and p.plan_cycle < 5
|
|
|
+ inner join core_resumption_plan p on t.plan_id = p.id and p.plan_cycle < 5
|
|
|
WHERE t.ymd_date >= #{prevdate}
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
@@ -62,43 +66,46 @@
|
|
|
sum(if(t.ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(t.ymd_date < #{date}, (if(t.`status` = 3, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_safety_task t
|
|
|
- INNER JOIN core_safecheck_plan p on t.plan_id = p.id and p.check_type = 3
|
|
|
+ INNER JOIN core_safecheck_plan p on t.plan_id = p.id and p.check_type = 3
|
|
|
WHERE ymd_date >= #{prevdate}
|
|
|
and org_path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOverViewEduTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
- SELECT sum(if(t.start_date >= #{date}, 1, 0)) as total,
|
|
|
- sum(if(t.start_date >= #{date} and t.`status` = 2, 1, 0)) as completed,
|
|
|
- sum(if(t.start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ SELECT sum(if(t.start_date >= #{date}, 1, 0)) as total,
|
|
|
+ sum(if(t.start_date >= #{date} and t.`status` = 2, 1, 0)) as completed,
|
|
|
+ sum(if(t.start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(t.start_date < #{date} and t.`status` = 2, 1, 0)) as prevcompleted
|
|
|
FROM core_edu_training_task t
|
|
|
- left join core_edu_training_plan p on t.plan_id =p.id
|
|
|
- WHERE t.start_date >= #{prevdate} and t.start_date <=#{end}
|
|
|
+ left join core_edu_training_plan p on t.plan_id = p.id
|
|
|
+ WHERE t.start_date >= #{prevdate}
|
|
|
+ and t.start_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.start_date >= #{date}, 1, 0)) as total,
|
|
|
+ SELECT sum(if(t.start_date >= #{date}, 1, 0)) as total,
|
|
|
sum(if(t.start_date >= #{date}, (if(t.`status` = 4, 1, 0)), 0)) as completed,
|
|
|
- sum(if(t.start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ sum(if(t.start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(t.start_date < #{date}, (if(t.`status` = 4, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_drill_task t
|
|
|
- left join core_drill_plan p on t.plan_id=p.id
|
|
|
- WHERE t.start_date >= #{prevdate} and t.start_date <=#{end}
|
|
|
+ left join core_drill_plan p on t.plan_id = p.id
|
|
|
+ WHERE t.start_date >= #{prevdate}
|
|
|
+ and t.start_date <= #{end}
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
and (p.plan_cycle < 5 or t.plan_id is null)
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOverViewMonitorTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
- SELECT sum(if(t.ymd_date >= #{date}, 1, 0)) as total,
|
|
|
+ SELECT sum(if(t.ymd_date >= #{date}, 1, 0)) as total,
|
|
|
sum(if(t.ymd_date >= #{date} and t.`status` = 2, 1, 0)) as completed,
|
|
|
- sum(if(t.ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
- sum(if(t.ymd_date < #{date} and t.`status` = 2, 1, 0)) as prevcompleted
|
|
|
+ sum(if(t.ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ sum(if(t.ymd_date < #{date} and t.`status` = 2, 1, 0)) as prevcompleted
|
|
|
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 >= #{prevdate} and t.ymd_date < #{end}
|
|
|
+ inner join core_monitoring_retrieval_plan p on t.plan_id = p.id and p.plan_cycle < 4
|
|
|
+ WHERE t.ymd_date >= #{prevdate}
|
|
|
+ and t.ymd_date < #{end}
|
|
|
and t.org_path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOverViewQuestionInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
@@ -110,52 +117,55 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOrgBaseInfo" resultType="com.xunmei.core.board.dto.app.AppOrgBaseInfoDto">
|
|
|
- SELECT count(0) as total,
|
|
|
- sum(if(oh.org_id is null, 1, 0)) as unreachedCount,
|
|
|
- sum(if(o.type = 4, 1, 0)) as bankingCount,
|
|
|
- sum(if(o.type = 4 and oe.self_service_bank=1, 1, 0)) as onlineATMCount,
|
|
|
- sum(if(o.type = 5, 1, 0)) as offATMCount,
|
|
|
- sum(if(o.type = 4 and oh.banking2021>0 and oh.banking2021 is not null, 1, 0)) as bankingGA382021,
|
|
|
- sum(if(o.type = 4 and oh.banking2015>0 and oh.banking2015 is not null,1, 0)) as bankingGA382015,
|
|
|
- sum(if(o.type = 4 and oe.self_service_bank=1 and oh.online2021>0 and oh.online2021 is not null,1, 0)) as onlineGA382021,
|
|
|
- sum(if(o.type = 4 and oe.self_service_bank=1 and oh.online2015>0 and oh.online2015 is not null,1, 0)) as onlineGA382015,
|
|
|
- sum(if(o.type = 5 and oh.offline2021>0 and oh.offline2021 is not null,1, 0)) as offATMGA382021,
|
|
|
- sum(if(o.type = 5 and oh.offline2015>0 and oh.offline2015 is not null,1 , 0)) as offATMGA382015,
|
|
|
- sum(oe.business_library_type = 1) as businessLibraryOne,
|
|
|
- sum(oe.business_library_type = 2) as businessLibraryTwo,
|
|
|
- sum(oe.business_library_type = 3) as businessLibraryThree,
|
|
|
- sum(oe.business_library_type = 4) as businessLibraryFour,
|
|
|
- sum(if(oe.askari = 1, 1, 0)) as orgWithSecurityCount,
|
|
|
- sum(if(o.type = 4, oe.lobby_equipment,0)) as bankingObbyDeviceCount,
|
|
|
- sum(if(o.type = 4, oe.wall_penetrating_equipment,0)) as bankingWallDeviceCount,
|
|
|
- sum(if(o.type = 5, oe.lobby_equipment,0)) as offATMObbyDeviceCount,
|
|
|
- sum(if(o.type = 5, oe.wall_penetrating_equipment,0)) as offATMWallDeviceCount
|
|
|
+ SELECT count(0) as total,
|
|
|
+ sum(if(oh.org_id is null, 1, 0)) as unreachedCount,
|
|
|
+ sum(if(o.type = 4, 1, 0)) as bankingCount,
|
|
|
+ sum(if(o.type = 4 and oe.self_service_bank = 1, 1, 0)) as onlineATMCount,
|
|
|
+ sum(if(o.type = 5, 1, 0)) as offATMCount,
|
|
|
+ sum(if(o.type = 4 and oh.banking2021 > 0 and oh.banking2021 is not null, 1, 0)) as bankingGA382021,
|
|
|
+ sum(if(o.type = 4 and oh.banking2015 > 0 and oh.banking2015 is not null, 1, 0)) as bankingGA382015,
|
|
|
+ sum(if(o.type = 4 and oe.self_service_bank = 1 and oh.online2021 > 0 and oh.online2021 is not null, 1,
|
|
|
+ 0)) as onlineGA382021,
|
|
|
+ sum(if(o.type = 4 and oe.self_service_bank = 1 and oh.online2015 > 0 and oh.online2015 is not null, 1,
|
|
|
+ 0)) as onlineGA382015,
|
|
|
+ sum(if(o.type = 5 and oh.offline2021 > 0 and oh.offline2021 is not null, 1, 0)) as offATMGA382021,
|
|
|
+ sum(if(o.type = 5 and oh.offline2015 > 0 and oh.offline2015 is not null, 1, 0)) as offATMGA382015,
|
|
|
+ sum(oe.business_library_type = 1) as businessLibraryOne,
|
|
|
+ sum(oe.business_library_type = 2) as businessLibraryTwo,
|
|
|
+ sum(oe.business_library_type = 3) as businessLibraryThree,
|
|
|
+ sum(oe.business_library_type = 4) as businessLibraryFour,
|
|
|
+ sum(if(oe.askari = 1, 1, 0)) as orgWithSecurityCount,
|
|
|
+ sum(if(o.type = 4, oe.lobby_equipment, 0)) as bankingObbyDeviceCount,
|
|
|
+ sum(if(o.type = 4, oe.wall_penetrating_equipment, 0)) as bankingWallDeviceCount,
|
|
|
+ sum(if(o.type = 5, oe.lobby_equipment, 0)) as offATMObbyDeviceCount,
|
|
|
+ sum(if(o.type = 5, oe.wall_penetrating_equipment, 0)) as offATMWallDeviceCount
|
|
|
FROM sys_org o
|
|
|
LEFT JOIN (select org_id,
|
|
|
banking2021,
|
|
|
- if(banking2015>0 and banking2021=0,1,0) as banking2015,
|
|
|
- if(online2021 >0 or banking2021>0 ,1,0) as online2021,
|
|
|
- if((online2015>0 or banking2015>0) and online2021=0 and banking2021=0 ,1,0) as online2015,
|
|
|
+ if(banking2015 > 0 and banking2021 = 0, 1, 0) as banking2015,
|
|
|
+ if(online2021 > 0 or banking2021 > 0, 1, 0) as online2021,
|
|
|
+ if((online2015 > 0 or banking2015 > 0) and online2021 = 0 and banking2021 = 0, 1,
|
|
|
+ 0) as online2015,
|
|
|
offline2021,
|
|
|
- if(offline2015>0 and offline2021=0,1,0) as offline2015
|
|
|
- from (
|
|
|
- SELECT org_id,
|
|
|
- sum(type=1 and standard = 1) banking2021,
|
|
|
- sum(type=1 and standard = 2) banking2015,
|
|
|
- sum(type=2 and standard = 1) online2021,
|
|
|
- sum(type=2 and standard = 2) online2015,
|
|
|
- sum(type=3 and standard = 1) offline2021,
|
|
|
- sum(type=3 and standard = 2) offline2015
|
|
|
- FROM sys_org_physical_defense_construction
|
|
|
- WHERE type = 1 or type=2
|
|
|
- OR type = 3
|
|
|
- GROUP BY org_id) t1) oh ON o.id = oh.org_id
|
|
|
+ if(offline2015 > 0 and offline2021 = 0, 1, 0) as offline2015
|
|
|
+ from (SELECT org_id,
|
|
|
+ sum(type = 1 and standard = 1) banking2021,
|
|
|
+ sum(type = 1 and standard = 2) banking2015,
|
|
|
+ sum(type = 2 and standard = 1) online2021,
|
|
|
+ sum(type = 2 and standard = 2) online2015,
|
|
|
+ sum(type = 3 and standard = 1) offline2021,
|
|
|
+ sum(type = 3 and standard = 2) offline2015
|
|
|
+ FROM sys_org_physical_defense_construction
|
|
|
+ WHERE type = 1
|
|
|
+ or type = 2
|
|
|
+ OR type = 3
|
|
|
+ GROUP BY org_id) t1) oh ON o.id = oh.org_id
|
|
|
LEFT JOIN sys_org_extend oe on o.id = oe.org_id
|
|
|
WHERE o.deleted = 0
|
|
|
and o.is_lock = 0
|
|
|
and o.path like concat(#{orgPath}, '%')
|
|
|
- AND ( o.type = 4
|
|
|
- OR o.type = 5)
|
|
|
+ AND (o.type = 4
|
|
|
+ OR o.type = 5)
|
|
|
</select>
|
|
|
<select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
SELECT p.plan_type,
|
|
|
@@ -165,7 +175,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 and p.plan_cycle < 5
|
|
|
+ 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}, '%')
|
|
|
@@ -179,94 +189,108 @@
|
|
|
(r.STATUS = 3, 1, 0)) AS completed,
|
|
|
sum(r.exception_count) AS exceptionCount
|
|
|
FROM core_safety_task r
|
|
|
- left JOIN core_safecheck_plan p ON r.plan_id = p.id
|
|
|
+ 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
|
|
|
- ))
|
|
|
+ #{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>
|
|
|
-<!-- <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">-->
|
|
|
-<!-- SELECT r.type as plan_type,-->
|
|
|
-<!-- count(0) AS total,-->
|
|
|
-<!-- sum(r.STATUS = 3) AS completed-->
|
|
|
-<!-- FROM core_drill_task r-->
|
|
|
-<!-- WHERE r.start_date BETWEEN #{startDate}-->
|
|
|
-<!-- AND #{endDate}-->
|
|
|
-<!-- AND r.org_path LIKE CONCAT(#{orgPath}, '%')-->
|
|
|
-<!-- GROUP BY r.type-->
|
|
|
-<!-- </select>-->
|
|
|
- <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
- 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
|
|
|
- ))
|
|
|
- AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
- </select>
|
|
|
+ <!-- <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">-->
|
|
|
+ <!-- SELECT r.type as plan_type,-->
|
|
|
+ <!-- count(0) AS total,-->
|
|
|
+ <!-- sum(r.STATUS = 3) AS completed-->
|
|
|
+ <!-- FROM core_drill_task r-->
|
|
|
+ <!-- WHERE r.start_date BETWEEN #{startDate}-->
|
|
|
+ <!-- AND #{endDate}-->
|
|
|
+ <!-- AND r.org_path LIKE CONCAT(#{orgPath}, '%')-->
|
|
|
+ <!-- GROUP BY r.type-->
|
|
|
+ <!-- </select>-->
|
|
|
+ <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
+ 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
|
|
|
+ ))
|
|
|
+ AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
<select id="selectSyntheticQuestion" resultType="com.xunmei.core.board.dto.app.AppSyntheticQuestionDto">
|
|
|
SELECT sum(
|
|
|
IF
|
|
|
- (q.confirm_status >= 2, 1, 0)) AS confirmedCount,
|
|
|
- sum(qf.count) AS dissentCount,
|
|
|
+ (q.confirm_status >= 2, 1, 0)) AS confirmedCount,
|
|
|
+ sum(qf.count) AS dissentCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.confirm_status = 3 AND q.reform_status IS NULL, 1, 0)) AS cancelCount,
|
|
|
+ (q.confirm_status = 3 AND q.reform_status IS NULL, 1, 0)) AS cancelCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.confirm_status = 2, 1, 0)) AS waitReformCount,
|
|
|
+ (q.confirm_status = 2, 1, 0)) AS waitReformCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.reform_status = 11, 1, 0)) AS reformedCount,
|
|
|
+ (q.reform_status = 11, 1, 0)) AS reformedCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (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,
|
|
|
+ (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 = 1 or q.src_task_type = 2 or q.src_task_type = 3) AND q.reform_status = 11, 1,
|
|
|
- 0)) resumptionReformedCount,
|
|
|
+ (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
|
|
|
- (q.src_type = 1 AND q.src_task_type = 6, 1, 0)) AS offATMResumptionCount,
|
|
|
+ (q.src_type = 1 AND q.src_task_type = 6, 1, 0)) AS offATMResumptionCount,
|
|
|
sum(
|
|
|
IF
|
|
|
(q.src_type = 1 AND q.src_task_type = 6 AND q.reform_status = 11, 1,
|
|
|
- 0)) offATMResumptionReformedCount,
|
|
|
+ 0)) offATMResumptionReformedCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.src_type = 2, 1, 0)) AS safetyCheckCount,
|
|
|
+ (q.src_type = 2, 1, 0)) AS safetyCheckCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.src_type = 2 AND q.reform_status = 11, 1, 0)) safetyCheckReformedCount,
|
|
|
+ (q.src_type = 2 AND q.reform_status = 11, 1, 0)) safetyCheckReformedCount,
|
|
|
sum(
|
|
|
IF
|
|
|
- (q.confirm_status >= 2 AND q.src_type = 2, 1, 0)) AS safetyCheckConfirmedCount
|
|
|
+ (q.confirm_status >= 2 AND q.src_type = 2, 1, 0)) AS safetyCheckConfirmedCount,
|
|
|
+ sum(if(q.confirm_status != 3 and q.reform_deadline <= #{today}, 1, 0)) as overdueCount
|
|
|
FROM core_question q
|
|
|
LEFT JOIN (SELECT question_id, count(0) AS count
|
|
|
FROM core_question_flow
|
|
|
WHERE execute_step = 1
|
|
|
AND execute_status = 1
|
|
|
GROUP BY question_id) qf ON q.id = qf.question_id
|
|
|
- WHERE q.submit_time BETWEEN #{startDate} AND #{endDate}
|
|
|
+ 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
|
|
|
+ ))
|
|
|
AND q.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOverDueQuestionCount" resultType="java.lang.Integer">
|
|
|
@@ -279,10 +303,10 @@
|
|
|
<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 t
|
|
|
- left join core_edu_training_plan p on t.plan_id =p.id
|
|
|
+ left join core_edu_training_plan p on t.plan_id = p.id
|
|
|
where t.start_date BETWEEN #{startDate} and #{endDate}
|
|
|
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="selectSyntheticInout" resultType="com.xunmei.core.board.vo.app.AppSyntheticInOutVo">
|
|
|
SELECT COUNT(*) as total,
|
|
|
@@ -299,7 +323,7 @@
|
|
|
<select id="selectSyntheticMonitor" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
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
|
|
|
+ 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>
|