|  | @@ -125,7 +125,7 @@
 | 
	
		
			
				|  |  |      <select id="findResumptionApp" resultType="com.xunmei.core.resumption.vo.ResumptionAppVo">
 | 
	
		
			
				|  |  |          select r.id,r.plan_start_time,plan_end_time,r.status,p.plan_name,p.plan_cycle
 | 
	
		
			
				|  |  |          from core_resumption r
 | 
	
		
			
				|  |  | -        inner join core_resumption_plan p on r.plan_id = p.id and p.deleted=0
 | 
	
		
			
				|  |  | +        inner join core_resumption_plan p on r.plan_id = p.id and p.deleted=0 and p.plan_status=1
 | 
	
		
			
				|  |  |          where r.org_id=#{res.orgId}
 | 
	
		
			
				|  |  |          <if test="res.roleId!=null and res.roleId.size>0">
 | 
	
		
			
				|  |  |              and r.parent_plan_id in
 | 
	
	
		
			
				|  | @@ -133,7 +133,7 @@
 | 
	
		
			
				|  |  |              inner join core_resumption_plan p on pr.plan_id=p.id and p.parent_id =-1 and p.deleted=0)
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="res.dateTime != null ">
 | 
	
		
			
				|  |  | -            and  r.plan_start_time <= #{res.dateTime} and r.plan_end_time>= #{res.dateTime}
 | 
	
		
			
				|  |  | +            and r.plan_start_time <= #{res.dateTime} and r.plan_end_time>= #{res.dateTime}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="selectAllByPlanStartTime" resultType="com.xunmei.core.resumption.domain.Resumption">
 | 
	
	
		
			
				|  | @@ -231,78 +231,86 @@
 | 
	
		
			
				|  |  |                   left join sys_area ar on ar.id = a.area_id and ar.del_flag = '0'
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="selectCurUserTaskList" resultType="com.xunmei.common.core.domain.panel.vo.PanelListVo">
 | 
	
		
			
				|  |  | -        select distinct t.id              as id,
 | 
	
		
			
				|  |  | -                        name              as taskName,
 | 
	
		
			
				|  |  | -                        t.plan_start_time as startTime,
 | 
	
		
			
				|  |  | -                        t.plan_end_time   as endTime,
 | 
	
		
			
				|  |  | -                        t.status
 | 
	
		
			
				|  |  | +        select distinct t.id as id,
 | 
	
		
			
				|  |  | +        name as taskName,
 | 
	
		
			
				|  |  | +        t.plan_start_time as startTime,
 | 
	
		
			
				|  |  | +        t.plan_end_time as endTime,
 | 
	
		
			
				|  |  | +        t.status
 | 
	
		
			
				|  |  |          from core_resumption t
 | 
	
		
			
				|  |  |          where t.org_id = #{request.orgId}
 | 
	
		
			
				|  |  | -          and t.plan_id in (select pr.plan_id
 | 
	
		
			
				|  |  | -                            from core_resumption_plan_to_role pr
 | 
	
		
			
				|  |  | -                                     inner join core_resumption_plan p
 | 
	
		
			
				|  |  | -                                                on pr.plan_id = p.id and p.deleted = 0 and p.plan_status = 1)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -          and t.status in (1, 2)
 | 
	
		
			
				|  |  | -          and ((
 | 
	
		
			
				|  |  | -                           #{request.startTime}   <![CDATA[<=]]> t.plan_start_time
 | 
	
		
			
				|  |  | -                       and #{request.endTime} >= t.plan_start_time
 | 
	
		
			
				|  |  | -                   )
 | 
	
		
			
				|  |  | -            or (
 | 
	
		
			
				|  |  | -                           #{request.startTime}    <![CDATA[<=]]> t.plan_end_time
 | 
	
		
			
				|  |  | -                       and #{request.endTime} >= t.plan_end_time
 | 
	
		
			
				|  |  | -                   )
 | 
	
		
			
				|  |  | -            or (
 | 
	
		
			
				|  |  | -                           #{request.startTime} >= t.plan_start_time
 | 
	
		
			
				|  |  | -                       and #{request.endTime}  <![CDATA[<=]]> t.plan_end_time
 | 
	
		
			
				|  |  | -                   ))
 | 
	
		
			
				|  |  | +        and t.plan_id in (select pr.plan_id
 | 
	
		
			
				|  |  | +        from core_resumption_plan_to_role pr
 | 
	
		
			
				|  |  | +        inner join core_resumption_plan p
 | 
	
		
			
				|  |  | +        on pr.plan_id = p.id and p.deleted = 0 and p.plan_status = 1
 | 
	
		
			
				|  |  | +        <if test="request.roleIdList!=null and request.roleIdList.size()>0">
 | 
	
		
			
				|  |  | +            and pr.role_id in
 | 
	
		
			
				|  |  | +            <foreach collection="request.roleIdList" item="roleId" open="(" close=")" separator=",">
 | 
	
		
			
				|  |  | +                #{roleId}
 | 
	
		
			
				|  |  | +            </foreach>
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        )
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        and t.status in (1, 2)
 | 
	
		
			
				|  |  | +        and ((
 | 
	
		
			
				|  |  | +        #{request.startTime}   <![CDATA[<=]]> t.plan_start_time
 | 
	
		
			
				|  |  | +        and #{request.endTime} >= t.plan_start_time
 | 
	
		
			
				|  |  | +        )
 | 
	
		
			
				|  |  | +        or (
 | 
	
		
			
				|  |  | +        #{request.startTime}    <![CDATA[<=]]> t.plan_end_time
 | 
	
		
			
				|  |  | +        and #{request.endTime} >= t.plan_end_time
 | 
	
		
			
				|  |  | +        )
 | 
	
		
			
				|  |  | +        or (
 | 
	
		
			
				|  |  | +        #{request.startTime} >= t.plan_start_time
 | 
	
		
			
				|  |  | +        and #{request.endTime}  <![CDATA[<=]]> t.plan_end_time
 | 
	
		
			
				|  |  | +        ))
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findResumptionExceptionList"
 | 
	
		
			
				|  |  |              resultType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyExceptionData">
 | 
	
		
			
				|  |  | -        SELECT r.id              as dataId,
 | 
	
		
			
				|  |  | -               r.org_id          as orgId,
 | 
	
		
			
				|  |  | -               r.plan_id         as extraField1,
 | 
	
		
			
				|  |  | -               p.plan_cycle      as extraField2,
 | 
	
		
			
				|  |  | -               r.ymd_date        as dataTime,
 | 
	
		
			
				|  |  | -               'core_resumption' as dataSource,
 | 
	
		
			
				|  |  | -               now()             as createTime
 | 
	
		
			
				|  |  | +        SELECT r.id as dataId,
 | 
	
		
			
				|  |  | +        r.org_id as orgId,
 | 
	
		
			
				|  |  | +        r.plan_id as extraField1,
 | 
	
		
			
				|  |  | +        p.plan_cycle as extraField2,
 | 
	
		
			
				|  |  | +        r.ymd_date as dataTime,
 | 
	
		
			
				|  |  | +        'core_resumption' as dataSource,
 | 
	
		
			
				|  |  | +        now() as createTime
 | 
	
		
			
				|  |  |          FROM core_resumption r
 | 
	
		
			
				|  |  | -                 inner join core_resumption_plan p on r.plan_id = p.id
 | 
	
		
			
				|  |  | +        inner join core_resumption_plan p on r.plan_id = p.id
 | 
	
		
			
				|  |  |          where p.plan_exec in (2, 3, 4)<!--营业前中后-->
 | 
	
		
			
				|  |  | -          and p.plan_cycle IN (SELECT cycle
 | 
	
		
			
				|  |  | -                               FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | -                               WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | -                               GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | -          AND exec_org_type IN (SELECT org_type
 | 
	
		
			
				|  |  | -                                FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | -                                WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | -                                GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | -          and ymd_year =#{year}
 | 
	
		
			
				|  |  | -          and ymd_quarter=#{quarter}
 | 
	
		
			
				|  |  | -          and ymd_month=#{month}
 | 
	
		
			
				|  |  | -          and status in (4)
 | 
	
		
			
				|  |  | -          and role_id =#{roleId}
 | 
	
		
			
				|  |  | +        and p.plan_cycle IN (SELECT cycle
 | 
	
		
			
				|  |  | +        FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | +        WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | +        GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | +        AND exec_org_type IN (SELECT org_type
 | 
	
		
			
				|  |  | +        FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | +        WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | +        GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | +        and ymd_year =#{year}
 | 
	
		
			
				|  |  | +        and ymd_quarter=#{quarter}
 | 
	
		
			
				|  |  | +        and ymd_month=#{month}
 | 
	
		
			
				|  |  | +        and status in (4)
 | 
	
		
			
				|  |  | +        and role_id =#{roleId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findResumptionListNew"
 | 
	
		
			
				|  |  |              resultType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyExceptionData">
 | 
	
		
			
				|  |  | -        SELECT r.id              as dataId,
 | 
	
		
			
				|  |  | -        r.org_id          as orgId,
 | 
	
		
			
				|  |  | -        r.plan_id         as extraField1,
 | 
	
		
			
				|  |  | -        p.plan_cycle      as extraField2,
 | 
	
		
			
				|  |  | -        r.ymd_date        as dataTime,
 | 
	
		
			
				|  |  | +        SELECT r.id as dataId,
 | 
	
		
			
				|  |  | +        r.org_id as orgId,
 | 
	
		
			
				|  |  | +        r.plan_id as extraField1,
 | 
	
		
			
				|  |  | +        p.plan_cycle as extraField2,
 | 
	
		
			
				|  |  | +        r.ymd_date as dataTime,
 | 
	
		
			
				|  |  |          'core_resumption' as dataSource,
 | 
	
		
			
				|  |  | -        now()             as createTime
 | 
	
		
			
				|  |  | +        now() as createTime
 | 
	
		
			
				|  |  |          FROM core_resumption r
 | 
	
		
			
				|  |  | -                inner join core_resumption_plan p on r.plan_id = p.id
 | 
	
		
			
				|  |  | +        inner join core_resumption_plan p on r.plan_id = p.id
 | 
	
		
			
				|  |  |          where p.plan_exec in (2, 3, 4)
 | 
	
		
			
				|  |  |          and p.plan_cycle IN (SELECT cycle FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | -                                WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | -                                GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | +        WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | +        GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  |          AND exec_org_type IN (SELECT org_type FROM core_safety_index_calculate_rule a
 | 
	
		
			
				|  |  | -                                WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | -                                GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  | +        WHERE a.type_code = 1004
 | 
	
		
			
				|  |  | +        GROUP BY org_type,cycle)
 | 
	
		
			
				|  |  |          and r.status in (4)
 | 
	
		
			
				|  |  |          and role_id =#{roleId}
 | 
	
		
			
				|  |  |          and ymd_date >=#{startTime}
 |