|  | @@ -806,6 +806,7 @@ and
 | 
	
		
			
				|  |  |                                      ( LOCATE( 3, GROUP_CONCAT( standard ))> 0, 1, 0 ))= 2
 | 
	
		
			
				|  |  |                     AND date_of_compliance LIKE concat(#{year}, '%')
 | 
	
		
			
				|  |  |              ) AND b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="selectConstructionDetail" resultType="com.xunmei.system.util.ConstructionDetailExport">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -847,6 +848,7 @@ and
 | 
	
		
			
				|  |  |                                      LEFT JOIN sys_org b on a.org_id = b.id
 | 
	
		
			
				|  |  |          where 1=1
 | 
	
		
			
				|  |  |            AND b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            AND b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getOwnership" resultType="java.lang.Integer">
 | 
	
	
		
			
				|  | @@ -855,7 +857,7 @@ and
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              sys_org_extend a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org b ON a.org_id = b.id
 | 
	
		
			
				|  |  | -        WHERE b.type=4 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +        WHERE b.type=4 and b.deleted = 0 and b.is_lock = 0 and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getOutside" resultType="java.lang.Integer">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -864,7 +866,10 @@ and
 | 
	
		
			
				|  |  |              sys_org_extend a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org b ON a.org_id = b.id
 | 
	
		
			
				|  |  |                  where
 | 
	
		
			
				|  |  | -            b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +                1=1
 | 
	
		
			
				|  |  | +                and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +                and b.is_lock = 0
 | 
	
		
			
				|  |  | +                and b.deleted = 0
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getLibrary" resultType="java.util.Map">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -877,7 +882,10 @@ and
 | 
	
		
			
				|  |  |              sys_org_extend a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org b ON a.org_id = b.id
 | 
	
		
			
				|  |  |          where
 | 
	
		
			
				|  |  | -            b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +        1=1
 | 
	
		
			
				|  |  | +        and    b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +        and b.is_lock = 0
 | 
	
		
			
				|  |  | +        and b.deleted = 0
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getCollectLibrary" resultType="java.lang.Integer">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -888,7 +896,10 @@ and
 | 
	
		
			
				|  |  |              sys_org_extend a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org b ON a.org_id = b.id
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  | -              b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +          1=1
 | 
	
		
			
				|  |  | +        and    b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +        and b.is_lock = 0
 | 
	
		
			
				|  |  | +        and b.deleted = 0
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getOnLine" resultType="java.util.Map">
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -900,12 +911,16 @@ and
 | 
	
		
			
				|  |  |                      sys_org a
 | 
	
		
			
				|  |  |                          LEFT JOIN sys_org_extend b ON a.id = b.org_id
 | 
	
		
			
				|  |  |                  WHERE
 | 
	
		
			
				|  |  | -                    a.path LIKE concat( #{orgPath}, '%' )) AS onLineTotal,
 | 
	
		
			
				|  |  | +                    1=1
 | 
	
		
			
				|  |  | +                    AND a.deleted = 0
 | 
	
		
			
				|  |  | +                    and a.is_lock = 0
 | 
	
		
			
				|  |  | +                    and a.path LIKE concat( #{orgPath}, '%' )) AS onLineTotal,
 | 
	
		
			
				|  |  |              (
 | 
	
		
			
				|  |  |                  select SUM(a.size) from (select org_id,if(count(1) > 0,1,0) as size from  sys_org_physical_defense_construction where standard =1 and type = 2 GROUP BY org_id) a
 | 
	
		
			
				|  |  |                                              LEFT JOIN sys_org b on a.org_id = b.id
 | 
	
		
			
				|  |  |                  where 1=1
 | 
	
		
			
				|  |  |                    AND b.deleted = 0
 | 
	
		
			
				|  |  | +                  and b.is_lock = 0
 | 
	
		
			
				|  |  |                    AND b.path LIKE concat(#{orgPath}, '%' )) AS onLineReachNumber
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              DUAL
 | 
	
	
		
			
				|  | @@ -921,6 +936,7 @@ and
 | 
	
		
			
				|  |  |                  WHERE
 | 
	
		
			
				|  |  |                      type = 5
 | 
	
		
			
				|  |  |                    AND deleted = 0
 | 
	
		
			
				|  |  | +                  AND is_lock = 0
 | 
	
		
			
				|  |  |                    AND path LIKE concat( #{orgPath}, '%' )) AS departureTotal,
 | 
	
		
			
				|  |  |              (
 | 
	
		
			
				|  |  |                select SUM(a.size) from (select org_id,if(count(1) > 0,1,0) as size from
 | 
	
	
		
			
				|  | @@ -928,6 +944,7 @@ and
 | 
	
		
			
				|  |  |                    LEFT JOIN sys_org b on a.org_id = b.id
 | 
	
		
			
				|  |  |                    where 1=1
 | 
	
		
			
				|  |  |                    AND b.deleted = 0
 | 
	
		
			
				|  |  | +                  and b.is_lock = 0
 | 
	
		
			
				|  |  |                    AND b.path LIKE concat(#{orgPath}, '%' )) AS departureReachNumber
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              DUAL
 | 
	
	
		
			
				|  | @@ -942,10 +959,10 @@ and
 | 
	
		
			
				|  |  |          from (
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                   select
 | 
	
		
			
				|  |  | -                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.path LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
 | 
	
		
			
				|  |  | -                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
 | 
	
		
			
				|  |  | -                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
 | 
	
		
			
				|  |  | -                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
 | 
	
		
			
				|  |  | +                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
 | 
	
		
			
				|  |  | +                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
 | 
	
		
			
				|  |  | +                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
 | 
	
		
			
				|  |  | +                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
 | 
	
		
			
				|  |  |                   from dual
 | 
	
		
			
				|  |  |               ) t
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -958,7 +975,7 @@ and
 | 
	
		
			
				|  |  |              IFNULL( b.hd_camera_count, 0 ) AS hdCameraCount,
 | 
	
		
			
				|  |  |              IFNULL( b.total_camera_count, 0 ) AS totalCameraCount
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  | -            ( SELECT id FROM sys_org WHERE type = 10 AND path LIKE concat( #{orgPath}, '%' ) ORDER BY create_time DESC LIMIT 0, 1 ) a
 | 
	
		
			
				|  |  | +            ( SELECT id FROM sys_org WHERE type = 10 and is_lock = 0 and deleted = 0 AND path LIKE concat( #{orgPath}, '%' ) ORDER BY create_time DESC LIMIT 0, 1 ) a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org_extend b ON a.id = b.org_id
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getCamera" resultType="java.util.Map">
 | 
	
	
		
			
				|  | @@ -972,6 +989,7 @@ and
 | 
	
		
			
				|  |  |              a.del_flag = 0
 | 
	
		
			
				|  |  |            AND a.device_type = 2
 | 
	
		
			
				|  |  |            AND b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            AND b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getRemote" resultType="java.util.Map">
 | 
	
	
		
			
				|  | @@ -986,6 +1004,7 @@ and
 | 
	
		
			
				|  |  |            and b.type != 10
 | 
	
		
			
				|  |  |            and a.remote_control = 1
 | 
	
		
			
				|  |  |            and b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getDuty" resultType="java.util.Map">
 | 
	
	
		
			
				|  | @@ -998,6 +1017,7 @@ and
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              1=1
 | 
	
		
			
				|  |  |            and b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getCertificate" resultType="java.util.Map">
 | 
	
	
		
			
				|  | @@ -1018,12 +1038,16 @@ and
 | 
	
		
			
				|  |  |                    AND b.certificate_work = '1'
 | 
	
		
			
				|  |  |                    AND a.is_manage = 'Y'
 | 
	
		
			
				|  |  |                    AND c.deleted = 0
 | 
	
		
			
				|  |  | +                  and c.is_lock = 0
 | 
	
		
			
				|  |  |                    AND c.path LIKE concat(#{orgPath}, '%')) AS certificatePeopleNumber
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              sys_org_extend a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org b ON a.org_id = b.id
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  | -            b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +            1=1
 | 
	
		
			
				|  |  | +            AND b.deleted = 0
 | 
	
		
			
				|  |  | +            and b.is_lock = 0
 | 
	
		
			
				|  |  | +            and b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getSafe" resultType="java.lang.Integer">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -1034,6 +1058,8 @@ and
 | 
	
		
			
				|  |  |                  LEFT JOIN core_safecheck_plan c ON a.plan_id = c.id
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              a.deleted = 0
 | 
	
		
			
				|  |  | +          AND b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            AND c.check_type =3
 | 
	
		
			
				|  |  |  and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |   AND a.ymd_date BETWEEN #{startTime} and #{endTime}
 | 
	
	
		
			
				|  | @@ -1108,7 +1134,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |              sys_user_information a
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_user b ON a.user_id = b.id
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org c ON b.org_id = c.id
 | 
	
		
			
				|  |  | -        WHERE c.deleted = 0 and  a.alone_dept='Y' and b.is_manage = 'Y' AND c.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  | +        WHERE c.deleted = 0 and c.is_lock = 0 and  a.alone_dept='Y' and b.is_manage = 'Y' AND c.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getManager" resultType="java.lang.Integer">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
	
		
			
				|  | @@ -1120,6 +1146,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              1 = 1
 | 
	
		
			
				|  |  |            AND c.deleted = 0
 | 
	
		
			
				|  |  | +          and c.is_lock = 0
 | 
	
		
			
				|  |  |            AND a.is_full_time = #{isFull}
 | 
	
		
			
				|  |  |            AND a.duties in ('1','2','3')
 | 
	
		
			
				|  |  |            AND b.is_manage = 'Y'
 | 
	
	
		
			
				|  | @@ -1135,6 +1162,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              1 = 1
 | 
	
		
			
				|  |  |            AND c.deleted = 0
 | 
	
		
			
				|  |  | +          and c.is_lock = 0
 | 
	
		
			
				|  |  |            AND a.certificate_work = 1
 | 
	
		
			
				|  |  |            AND a.duties in ('1','2','3')
 | 
	
		
			
				|  |  |            AND b.is_manage = 'Y'
 | 
	
	
		
			
				|  | @@ -1151,6 +1179,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              a.duties = #{duties}
 | 
	
		
			
				|  |  |            and c.deleted = 0
 | 
	
		
			
				|  |  | +          and c.is_lock = 0
 | 
	
		
			
				|  |  |            AND b.is_manage = 'Y'
 | 
	
		
			
				|  |  |            AND c.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -1166,6 +1195,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              a.duties IN ( 2, 4, 5 )
 | 
	
		
			
				|  |  |            AND c.deleted = 0
 | 
	
		
			
				|  |  | +          and c.is_lock = 0
 | 
	
		
			
				|  |  |            AND b.is_manage = 'Y'
 | 
	
		
			
				|  |  |            AND c.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -1178,6 +1208,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              a.type = #{type}
 | 
	
		
			
				|  |  |            AND a.sign_level = #{level}
 | 
	
		
			
				|  |  | +          AND b.deleted = 0
 | 
	
		
			
				|  |  | +          and b.is_lock = 0
 | 
	
		
			
				|  |  |            AND b.path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getJointHeadToNetwork" resultType="java.lang.Integer">
 | 
	
	
		
			
				|  | @@ -1196,6 +1228,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |          LEFT JOIN sys_org_extend b  on a.id = b.org_id
 | 
	
		
			
				|  |  |          WHERE 1=1
 | 
	
		
			
				|  |  |            and (b.inner_count > 0 or b.outside_count > 0)
 | 
	
		
			
				|  |  | +          and a.deleted = 0
 | 
	
		
			
				|  |  | +          and a.is_lock = 0
 | 
	
		
			
				|  |  |            and a.path LIKE concat( #{orgPath}, '%' )
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="getHeadSafeCheckNumber" resultType="java.lang.Integer">
 | 
	
	
		
			
				|  | @@ -1217,6 +1251,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |                  LEFT JOIN sys_org c ON c.id = a.org_id
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              b.check_type = 1
 | 
	
		
			
				|  |  | +            AND c.deleted = 0
 | 
	
		
			
				|  |  | +            and c.is_lock = 0
 | 
	
		
			
				|  |  |  --           AND c.type = 4
 | 
	
		
			
				|  |  |            AND a.org_path LIKE concat(#{orgPath}, '%')
 | 
	
		
			
				|  |  |      </select>
 |