|
|
@@ -5,11 +5,11 @@
|
|
|
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(IF(o.type = 8, 1, 0)) as bankingStoreCount,
|
|
|
+ sum(o.type = 8 || oe.business_library=1) as bankingStoreCount,
|
|
|
sum(IF(o.type = 5, 1, 0)) as offlineATMCount,
|
|
|
- sum(IF(oe.self_service_bank is not null, 1, 0)) as onlineATMCount,
|
|
|
- sum(IF(oe.lobby_equipment is not null, oe.lobby_equipment, 0)) as lobbyDeviceCount,
|
|
|
- sum(IF(oe.wall_penetrating_equipment = 4, oe.wall_penetrating_equipment, 0)) as throughwallDeviceCount
|
|
|
+ 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
|
|
|
@@ -17,27 +17,25 @@
|
|
|
and o.path like concat(#{orgPath}, '%')
|
|
|
</select>
|
|
|
<select id="selectOrgGa38" resultType="com.xunmei.core.board.dto.app.AppGA38InfoDto">
|
|
|
- SELECT count(0) as total,
|
|
|
- sum(m.ga382021) as ga382021,
|
|
|
+ SELECT count(0) as total,
|
|
|
+ sum(m.ga382021) as ga382021,
|
|
|
sum(m.ga382021current) as ga382021current,
|
|
|
- sum(m.ga382021prev) as ga382021prev,
|
|
|
- sum(m.ga382015) as ga382015,
|
|
|
+ sum(m.ga382021prev) as ga382021prev,
|
|
|
+ sum(m.ga382015) as ga382015,
|
|
|
sum(m.ga382015current) as ga382015current,
|
|
|
- sum(m.ga382021prev) as ga382021prev
|
|
|
+ sum(m.ga382015prev) as ga382015prev
|
|
|
from sys_org o
|
|
|
LEFT JOIN (SELECT org_id,
|
|
|
- IF
|
|
|
- (standard = 1, 1, 0) AS ga382021,
|
|
|
- IF
|
|
|
- (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0) AS ga382021current,
|
|
|
- IF
|
|
|
- (standard = 1, IF(date_of_compliance < #{date}, 1, 0), 0) AS ga382021prev,
|
|
|
- IF
|
|
|
- (standard = 2, 1, 0) AS ga382015,
|
|
|
- IF
|
|
|
- (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0) AS ga382015current,
|
|
|
- IF
|
|
|
- (standard = 2, IF(date_of_compliance < #{date}, 1, 0), 0) AS ga382015prev
|
|
|
+ sum(standard = 1) AS ga382021,
|
|
|
+ sum(IF
|
|
|
+ (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,
|
|
|
+ sum(IF
|
|
|
+ (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
|
|
|
FROM sys_org_physical_defense_construction
|
|
|
WHERE type = 1
|
|
|
OR type = 3
|
|
|
@@ -50,7 +48,7 @@
|
|
|
<select id="selectOverViewResumptionTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
SELECT sum(if(ymd_date >= #{date}, 1, 0)) as total,
|
|
|
sum(if(ymd_date >= #{date}, (if(`status` = 3, 1, 0)), 0)) as completed,
|
|
|
- sum(if(ymd_date < #{date}, 1, 0)) as prevcount,
|
|
|
+ sum(if(ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(ymd_date < #{date}, (if(`status` = 3, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_resumption
|
|
|
WHERE ymd_date >= #{prevdate}
|
|
|
@@ -58,21 +56,21 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOverViewSafetyCheckTaskInfo" 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 prevcount,
|
|
|
+ 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(start_date >= #{date}, 1, 0)) as total,
|
|
|
- sum(if(start_date >= #{date}, (if(`status` = 4, 1, 0)), 0)) as completed,
|
|
|
- sum(if(start_date < #{date}, 1, 0)) as prevcount,
|
|
|
- sum(if(start_date < #{date}, (if(`status` = 4, 1, 0)), 0)) as prevcompleted
|
|
|
+ sum(if(start_date >= #{date}, (if(`status` = 2, 1, 0)), 0)) as completed,
|
|
|
+ sum(if(start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ sum(if(start_date < #{date}, (if(`status` = 2, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_edu_training_task
|
|
|
WHERE start_date >= #{prevdate}
|
|
|
and org_path like concat(#{orgPath}, '%')
|
|
|
@@ -81,7 +79,7 @@
|
|
|
<select id="selectOverViewDrillTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
SELECT sum(if(start_date >= #{date}, 1, 0)) as total,
|
|
|
sum(if(start_date >= #{date}, (if(`status` = 4, 1, 0)), 0)) as completed,
|
|
|
- sum(if(start_date < #{date}, 1, 0)) as prevcount,
|
|
|
+ sum(if(start_date < #{date}, 1, 0)) as prevTotal,
|
|
|
sum(if(start_date < #{date}, (if(`status` = 4, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_drill_task
|
|
|
WHERE start_date >= #{prevdate}
|
|
|
@@ -90,9 +88,9 @@
|
|
|
|
|
|
<select id="selectOverViewMonitorTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
|
|
|
SELECT sum(if(ymd_date >= #{date}, 1, 0)) as total,
|
|
|
- sum(if(ymd_date >= #{date}, (if(`status` = 3, 1, 0)), 0)) as completed,
|
|
|
- sum(if(ymd_date < #{date}, 1, 0)) as prevcount,
|
|
|
- sum(if(ymd_date < #{date}, (if(`status` = 3, 1, 0)), 0)) as prevcompleted
|
|
|
+ sum(if(ymd_date >= #{date}, (if(`status` = 2, 1, 0)), 0)) as completed,
|
|
|
+ sum(if(ymd_date < #{date}, 1, 0)) as prevTotal,
|
|
|
+ sum(if(ymd_date < #{date}, (if(`status` = 2, 1, 0)), 0)) as prevcompleted
|
|
|
FROM core_monitoring_retrieval_task
|
|
|
WHERE ymd_date >= #{prevdate}
|
|
|
and org_path like concat(#{orgPath}, '%')
|
|
|
@@ -106,79 +104,162 @@
|
|
|
</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=5,1,0)) as offATMCount,
|
|
|
- sum(if(o.type=4 and oh.ga382021 is not null,1,0)) as bankingGA382021 ,
|
|
|
- sum(if(o.type=4 and oh.ga382015 is not null,1,0)) as bankingGA382015 ,
|
|
|
- sum(if(o.type=5 and oh.ga382021 is not null,1,0)) as offATMGA382021 ,
|
|
|
- sum(if(o.type=5 and oh.ga382015 is not null,1,0)) as offATMGA382015,
|
|
|
- sum(if(oe.business_library_type=1,1,0)) as businessLibraryOne,
|
|
|
- sum(if(oe.business_library_type=2,1,0)) as businessLibraryTwo,
|
|
|
- sum(if(oe.business_library_type=3,1,0)) as businessLibraryThree,
|
|
|
- sum(if(oe.business_library_type=4,1,0)) as businessLibraryFour,
|
|
|
- sum(if(oe.askari=1,1,0)) as orgWithSecurityCount,
|
|
|
- sum(if(o.type=4 and oe.lobby_equipment is not null,oe.lobby_equipment,0)) as bankingObbyDeviceCount,
|
|
|
- sum(if(o.type=4 and oe.wall_penetrating_equipment is not null,oe.wall_penetrating_equipment,0)) as bankingWallDeviceCount,
|
|
|
- sum(if(o.type=5 and oe.lobby_equipment is not null,oe.lobby_equipment,0)) as offATMObbyDeviceCount,
|
|
|
- sum(if(o.type=5 and oe.wall_penetrating_equipment is not null,oe.wall_penetrating_equipment,0)) as offATMWallDeviceCount
|
|
|
- FROM
|
|
|
- sys_org o
|
|
|
- LEFT JOIN (SELECT org_id,
|
|
|
+ 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 = 5, 1, 0)) as offATMCount,
|
|
|
+ sum(if(o.type = 4 and oh.ga382021 is not null, 1, 0)) as bankingGA382021,
|
|
|
+ sum(if(o.type = 4 and oh.ga382015 is not null, 1, 0)) as bankingGA382015,
|
|
|
+ sum(if(o.type = 5 and oh.ga382021 is not null, 1, 0)) as offATMGA382021,
|
|
|
+ sum(if(o.type = 5 and oh.ga382015 is not null, 1, 0)) as offATMGA382015,
|
|
|
+ sum(if(oe.business_library_type = 1, 1, 0)) as businessLibraryOne,
|
|
|
+ sum(if(oe.business_library_type = 2, 1, 0)) as businessLibraryTwo,
|
|
|
+ sum(if(oe.business_library_type = 3, 1, 0)) as businessLibraryThree,
|
|
|
+ sum(if(oe.business_library_type = 4, 1, 0)) as businessLibraryFour,
|
|
|
+ sum(if(oe.askari = 1, 1, 0)) as orgWithSecurityCount,
|
|
|
+ sum(if(o.type = 4 and oe.lobby_equipment is not null, oe.lobby_equipment,
|
|
|
+ 0)) as bankingObbyDeviceCount,
|
|
|
+ sum(if(o.type = 4 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
|
|
|
+ 0)) as bankingWallDeviceCount,
|
|
|
+ sum(if(o.type = 5 and oe.lobby_equipment is not null, oe.lobby_equipment,
|
|
|
+ 0)) as offATMObbyDeviceCount,
|
|
|
+ sum(if(o.type = 5 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
|
|
|
+ 0)) as offATMWallDeviceCount
|
|
|
+ FROM sys_org o
|
|
|
+ LEFT JOIN (SELECT org_id,
|
|
|
IF
|
|
|
- (standard = 1, 1, 0) AS ga382021,
|
|
|
+ (standard = 1, 1, 0) AS ga382021,
|
|
|
|
|
|
|
|
|
IF
|
|
|
- (standard = 2, 1, 0) AS ga382015
|
|
|
+ (standard = 2, 1, 0) AS ga382015
|
|
|
|
|
|
FROM sys_org_physical_defense_construction
|
|
|
WHERE type = 1
|
|
|
OR type = 3
|
|
|
GROUP BY org_id) oh ON o.id = oh.org_id
|
|
|
- LEFT JOIN sys_org_extend oe on o.id=oe.org_id
|
|
|
- WHERE
|
|
|
- o.deleted = 0 and path like concat(#{orgPath}, '%')
|
|
|
+ LEFT JOIN sys_org_extend oe on o.id = oe.org_id
|
|
|
+ WHERE o.deleted = 0
|
|
|
+ and path like concat(#{orgPath}, '%')
|
|
|
AND (
|
|
|
o.type = 4
|
|
|
OR o.type = 5)
|
|
|
</select>
|
|
|
<select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
- SELECT
|
|
|
- p.plan_type,
|
|
|
- count( 0 ) AS total,
|
|
|
- sum(
|
|
|
- IF
|
|
|
- ( 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
|
|
|
- WHERE
|
|
|
- r.ymd_date BETWEEN #{startDate}
|
|
|
- AND #{endDate}
|
|
|
- AND r.org_path LIKE CONCAT( #{orgPath}, '%' )
|
|
|
- GROUP BY
|
|
|
- p.plan_type
|
|
|
+ SELECT p.plan_type,
|
|
|
+ count(0) AS total,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (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
|
|
|
+ WHERE r.ymd_date BETWEEN #{startDate}
|
|
|
+ AND #{endDate}
|
|
|
+ AND r.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
+ GROUP BY p.plan_type
|
|
|
</select>
|
|
|
<select id="selectSyntheticSafetyCheck" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
- SELECT
|
|
|
- p.plan_type,
|
|
|
- count( 0 ) AS total,
|
|
|
- sum(
|
|
|
- IF
|
|
|
- ( r.STATUS = 3, 1, 0 )) AS completed,
|
|
|
- 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}
|
|
|
- AND r.org_path LIKE CONCAT( #{orgPath}, '%' )
|
|
|
- GROUP BY
|
|
|
- p.plan_type
|
|
|
+ SELECT p.check_type as plan_type,
|
|
|
+ count(0) AS total,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (r.STATUS = 3, 1, 0)) AS completed,
|
|
|
+ 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}
|
|
|
+ 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(
|
|
|
+ IF
|
|
|
+ (r.STATUS = 3, 1, 0)) 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="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,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.confirm_status = 3 AND q.reform_status IS NULL, 1, 0)) AS cancelCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.confirm_status = 2, 1, 0)) AS waitReformCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.reform_status = 11, 1, 0)) AS reformedCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.src_type = 1 AND q.src_task_type != 6, 1, 0)) AS resumptionCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.src_type = 1 AND q.src_task_type != 6 AND q.reform_status = 11, 1,
|
|
|
+ 0)) resumptionReformedCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (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,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (q.src_type = 2, 1, 0)) AS safetyCheckCount,
|
|
|
+ sum(
|
|
|
+ IF
|
|
|
+ (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
|
|
|
+ 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}
|
|
|
+ AND q.org_path LIKE CONCAT(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="selectOverDueQuestionCount" resultType="java.lang.Integer">
|
|
|
+ SELECT count(0)
|
|
|
+ FROM core_question
|
|
|
+ WHERE reform_deadline BETWEEN '2023-10-01 00:00:00' AND '2023-11-30 23:59'
|
|
|
+ and reform_status != 11
|
|
|
+ and confirm_status != 3
|
|
|
+ </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}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="selectSyntheticInout" resultType="com.xunmei.core.board.vo.app.AppSyntheticInOutVo">
|
|
|
+ SELECT COUNT(*) as total,
|
|
|
+ sum(l.type = 1) as department,
|
|
|
+ sum(l.type = 2) as temporary,
|
|
|
+ sum(l.type = 3) as emergency
|
|
|
+ FROM core_out_in_record r
|
|
|
+ INNER JOIN core_introduce_letter l ON r.letter_id = l.id
|
|
|
+ INNER JOIN sys_org o ON r.org_id = o.id
|
|
|
+ where arrival_time >= #{startDate}
|
|
|
+ AND arrival_time <= #{endDate}
|
|
|
+ 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>
|
|
|
</mapper>
|