|
|
@@ -800,10 +800,146 @@ and
|
|
|
FROM
|
|
|
sys_org_physical_defense_construction a
|
|
|
LEFT JOIN sys_org_extend b ON a.org_id = b.org_id LEFT JOIN sys_org c ON c.id=b.org_id
|
|
|
- WHERE c.type=4 and c.path like concat(concat(#{orgPath}),'%')
|
|
|
+ WHERE c.type=4 and c.path like concat(#{orgPath}, '%')
|
|
|
GROUP BY
|
|
|
a.org_id
|
|
|
</select>
|
|
|
+ <select id="getReachNumber" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ IFNULL( SUM( IF ( a.standard IN ( 1, 2 ), 1, 0 )), 0 )
|
|
|
+ FROM
|
|
|
+ sys_org_physical_defense_construction a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE b.type=4 and b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getOwnership" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ IFNULL( SUM( IF ( a.ownership = 2, 1, 0 )), 0 )
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE b.type=4 and b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getOutside" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ IFNULL( SUM( IF ( a.outside_area = 1, 1, 0 )), 0 )
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ where
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getLibrary" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ COUNT(a.business_library_type ) as total,
|
|
|
+ sum(IF(a.business_library_type=1,1,0)) AS one,
|
|
|
+ SUM(IF(a.business_library_type=2,1,0)) as two,
|
|
|
+ SUM(IF(a.business_library_type=3,1,0)) AS three,
|
|
|
+ SUM(IF(a.business_library_type=4,1,0)) AS four
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ where
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getCollectLibrary" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( a.safe_box = 1, 1, 0 ))
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getOnLine" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( a.type = 3, 1, 0 )) AS onLineTotal,
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( a.type = 3 AND a.standard =1, 1, 0 )) AS onLineReachNumber
|
|
|
+ FROM
|
|
|
+ sys_org_physical_defense_construction a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getDeparture" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( a.type = 4, 1, 0 )) AS departureTotal,
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( a.type = 4 AND a.standard = 1, 1, 0 )) AS departureReachNumber
|
|
|
+ FROM
|
|
|
+ sys_org_physical_defense_construction a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getSelfEquipment" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM( a.lobby_equipment ) AS onLineLobbyImplement,
|
|
|
+ SUM( a.wall_penetrating_equipment ) AS onLineThroughWalls,
|
|
|
+ SUM( a.detached_lobby_equipment ) AS departureLobbyImplement,
|
|
|
+ SUM( a.detached_wall_penetrating_equipment ) AS departureThroughWalls,
|
|
|
+ SUM( a.lobby_equipment ) + SUM( a.wall_penetrating_equipment ) + SUM( a.detached_lobby_equipment ) + SUM( a.detached_wall_penetrating_equipment ) AS selfServiceDevicesTotal
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ WHERE
|
|
|
+ b.path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getCenterConstruction" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ IF
|
|
|
+ ( a.construction_time IS NULL, '', SUBSTR( a.construction_time, 1, 4 ) ) AS centerConstructionTime,
|
|
|
+ IF
|
|
|
+ ( a.last_update_time IS NULL, '', SUBSTR( a.last_update_time, 1, 4 ) ) AS transformTime,
|
|
|
+ a.platform_brand AS brand
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+WHERE b.id=#{orgId}
|
|
|
+ </select>
|
|
|
+ <select id="getCamera" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ COUNT( 1 ) AS cameraTotal,
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( definition = 1, 1, 0 )) AS definitionNumber
|
|
|
+ FROM
|
|
|
+ sys_device
|
|
|
+ WHERE
|
|
|
+ del_flag=0 AND
|
|
|
+ device_type =2 AND org_path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getRemote" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM( a.cash_adding_room ) AS cashAddingRoom,
|
|
|
+ SUM( a.remote_count ) AS remoteCount
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+where org_path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
+ <select id="getDuty" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( duty_mode = 2, 1, 0 )) AS localDutyNetworkNumber,
|
|
|
+ SUM(
|
|
|
+ IF
|
|
|
+ ( duty_mode = 1, 1, 0 )) AS remoteDutyNetworkNumber
|
|
|
+ FROM
|
|
|
+ sys_org_extend a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ where org_path LIKE concat(#{orgPath}, '%')
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|