|
|
@@ -130,7 +130,11 @@
|
|
|
<if test="res.roleId!=null and res.roleId.size>0">
|
|
|
and r.parent_plan_id in
|
|
|
(select distinct plan_id from core_resumption_plan_to_role pr
|
|
|
- inner join core_resumption_plan p on pr.plan_id=p.id and p.parent_id =-1 and p.deleted=0)
|
|
|
+ inner join core_resumption_plan p on pr.plan_id=p.id and p.parent_id =-1 and p.deleted=0
|
|
|
+ where pr.role_id in
|
|
|
+ <foreach collection="res.roleId" item="roleId" open="(" close=")" separator=",">
|
|
|
+ #{roleId}
|
|
|
+ </foreach>)
|
|
|
</if>
|
|
|
<if test="res.dateTime != null ">
|
|
|
and r.plan_start_time <= #{res.startTime} and r.plan_end_time>= #{res.endTime}
|
|
|
@@ -336,23 +340,24 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="saveResumptionExceptionList">
|
|
|
- insert into core_safety_exception_data (data_id, org_id, org_name, org_path, data_source, data_time, create_time,
|
|
|
- extra_field1, extra_field2)
|
|
|
- SELECT r.id as dataId,
|
|
|
- r.org_id as orgId,
|
|
|
- r.org_name as orgName,
|
|
|
- r.org_path as orgPath,
|
|
|
- 'core_resumption' as dataSource,
|
|
|
- r.ymd_date as dataTime,
|
|
|
- now() as createTime,
|
|
|
- r.plan_id as extraField1,
|
|
|
- p.plan_cycle as extraField2
|
|
|
+ insert into core_safety_exception_data (data_id, org_id, org_name, org_path, data_source, data_time,
|
|
|
+ create_time,
|
|
|
+ extra_field1, extra_field2)
|
|
|
+ SELECT r.id as dataId,
|
|
|
+ r.org_id as orgId,
|
|
|
+ r.org_name as orgName,
|
|
|
+ r.org_path as orgPath,
|
|
|
+ 'core_resumption' as dataSource,
|
|
|
+ r.ymd_date as dataTime,
|
|
|
+ now() as createTime,
|
|
|
+ r.plan_id as extraField1,
|
|
|
+ p.plan_cycle as extraField2
|
|
|
FROM core_resumption r 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)
|
|
|
+ (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)
|
|
|
+ (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}
|