|
|
@@ -108,32 +108,23 @@
|
|
|
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
|
|
|
+ sum(if(o.type = 4, oh.ga382021, 0)) as bankingGA382021,
|
|
|
+ sum(if(o.type = 4, oh.ga382015, 0)) as bankingGA382015,
|
|
|
+ sum(if(o.type = 5, oh.ga382021, 0)) as offATMGA382021,
|
|
|
+ sum(if(o.type = 5, oh.ga382015 , 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,
|
|
|
- IF
|
|
|
- (standard = 1, 1, 0) AS ga382021,
|
|
|
-
|
|
|
-
|
|
|
- IF
|
|
|
- (standard = 2, 1, 0) AS ga382015
|
|
|
-
|
|
|
+ sum(standard = 1) AS ga382021,
|
|
|
+ sum(standard = 2) AS ga382015
|
|
|
FROM sys_org_physical_defense_construction
|
|
|
WHERE type = 1
|
|
|
OR type = 3
|
|
|
@@ -141,8 +132,7 @@
|
|
|
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
|
|
|
+ AND ( o.type = 4
|
|
|
OR o.type = 5)
|
|
|
</select>
|
|
|
<select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
|
|
|
@@ -176,9 +166,7 @@
|
|
|
<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
|
|
|
+ sum(r.STATUS = 3) AS completed
|
|
|
FROM core_drill_task r
|
|
|
WHERE r.start_date BETWEEN #{startDate}
|
|
|
AND #{endDate}
|