|
|
|
@ -95,12 +95,10 @@ |
|
|
|
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count |
|
|
|
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count |
|
|
|
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid |
|
|
|
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid |
|
|
|
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status |
|
|
|
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status |
|
|
|
LEFT JOIN tht_timeline tt ON tt.business_id = hdb.business_id |
|
|
|
|
|
|
|
WHERE |
|
|
|
WHERE |
|
|
|
1 = 1 |
|
|
|
1 = 1 |
|
|
|
AND hdb.status = '10' |
|
|
|
AND hdb.status = '10' |
|
|
|
AND hdr.nid is not null |
|
|
|
AND hdr.nid is not null |
|
|
|
AND tt.operator = #{nuserid} |
|
|
|
|
|
|
|
AND COALESCE(hdb.approve_status,'0') not IN('0','-1') AND hdb.approve_status is not null |
|
|
|
AND COALESCE(hdb.approve_status,'0') not IN('0','-1') AND hdb.approve_status is not null |
|
|
|
<if test="cdepartmentid != null"> |
|
|
|
<if test="cdepartmentid != null"> |
|
|
|
AND hdr.belong_xq like concat(concat(#{cdepartmentid}::text,'%')) |
|
|
|
AND hdr.belong_xq like concat(concat(#{cdepartmentid}::text,'%')) |
|
|
|
@ -152,10 +150,9 @@ |
|
|
|
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count |
|
|
|
ON hdb.business_id = hdr.business_id AND hdb.pc_count = hdr.pc_count |
|
|
|
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid |
|
|
|
LEFT JOIN department dp ON hdb.handle_dept = dp.cdepartmentid |
|
|
|
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status |
|
|
|
LEFT JOIN enum_type et ON et.ENUMTYPEID = '6601' AND et.enumvalue = hdb.status |
|
|
|
LEFT JOIN tht_timeline tt ON tt.business_id = hdb.business_id |
|
|
|
|
|
|
|
WHERE |
|
|
|
WHERE |
|
|
|
tt.operator = #{nuserid} |
|
|
|
1 = 1 |
|
|
|
AND tt.title = '隐患上报' |
|
|
|
AND hdr.pc_operator = #{nuserid} |
|
|
|
AND hdb.status = '10' |
|
|
|
AND hdb.status = '10' |
|
|
|
AND hdr.nid is not null |
|
|
|
AND hdr.nid is not null |
|
|
|
AND hdb.approve_status != '0' AND hdb.approve_status != '-1' |
|
|
|
AND hdb.approve_status != '0' AND hdb.approve_status != '-1' |
|
|
|
@ -245,14 +242,10 @@ |
|
|
|
WHEN now() AT TIME ZONE 'Asia/Shanghai' >= t1.planEndTime THEN 1 --超期 |
|
|
|
WHEN now() AT TIME ZONE 'Asia/Shanghai' >= t1.planEndTime THEN 1 --超期 |
|
|
|
END AS time_status |
|
|
|
END AS time_status |
|
|
|
, t1.* |
|
|
|
, t1.* |
|
|
|
-- , EXTRACT(EPOCH FROM NOW() - t1.planEndTime) AS timeDiffEnd |
|
|
|
|
|
|
|
-- , EXTRACT(EPOCH FROM t1.planEndTime - NOW() ) AS timeDiffStart |
|
|
|
|
|
|
|
, floor(EXTRACT(EPOCH FROM(now() AT TIME ZONE 'Asia/Shanghai' - planEndTime))/(1440*60)) delayDay |
|
|
|
, floor(EXTRACT(EPOCH FROM(now() AT TIME ZONE 'Asia/Shanghai' - planEndTime))/(1440*60)) delayDay |
|
|
|
, ceil(mod(ceil(EXTRACT(EPOCH FROM(now() AT TIME ZONE 'Asia/Shanghai' -planEndTime)))::INTEGER , 1440*60)::FLOAT/3600) delayHour |
|
|
|
, ceil(mod(ceil(EXTRACT(EPOCH FROM(now() AT TIME ZONE 'Asia/Shanghai' -planEndTime)))::INTEGER , 1440*60)::FLOAT/3600) delayHour |
|
|
|
, floor(EXTRACT(EPOCH FROM(planEndTime -now() AT TIME ZONE 'Asia/Shanghai'))/(1440*60)) nearDay |
|
|
|
, floor(EXTRACT(EPOCH FROM(planEndTime -now() AT TIME ZONE 'Asia/Shanghai'))/(1440*60)) nearDay |
|
|
|
, ceil(mod(ceil(EXTRACT(EPOCH FROM(planEndTime -now() AT TIME ZONE 'Asia/Shanghai')))::INTEGER , 1440*60)::FLOAT/3600) nearHour |
|
|
|
, ceil(mod(ceil(EXTRACT(EPOCH FROM(planEndTime -now() AT TIME ZONE 'Asia/Shanghai')))::INTEGER , 1440*60)::FLOAT/3600) nearHour |
|
|
|
-- , now() - t1.planEndTime as timeDiffEnd |
|
|
|
|
|
|
|
-- , now() - t1.nearEndTime as timeDiffStart |
|
|
|
|
|
|
|
]]> |
|
|
|
]]> |
|
|
|
FROM (SELECT hdb.nid |
|
|
|
FROM (SELECT hdb.nid |
|
|
|
, hdb.name |
|
|
|
, hdb.name |
|
|
|
@ -285,9 +278,6 @@ |
|
|
|
AND et.enumvalue = hdb.status |
|
|
|
AND et.enumvalue = hdb.status |
|
|
|
LEFT JOIN bis_section bs ON hdr.section_code = bs.section_code |
|
|
|
LEFT JOIN bis_section bs ON hdr.section_code = bs.section_code |
|
|
|
LEFT JOIN tht_param_config tpc ON tpc.param_code = 'THT_PC_ROAD_XT' |
|
|
|
LEFT JOIN tht_param_config tpc ON tpc.param_code = 'THT_PC_ROAD_XT' |
|
|
|
<if test="classification != ''"> |
|
|
|
|
|
|
|
LEFT JOIN tht_timeline tt ON tt.business_id = hdb.business_id |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
WHERE |
|
|
|
WHERE |
|
|
|
hdb.status = #{status} |
|
|
|
hdb.status = #{status} |
|
|
|
AND hdr.nid is not null |
|
|
|
AND hdr.nid is not null |
|
|
|
@ -303,16 +293,12 @@ |
|
|
|
<if test="search != null and search != ''"> |
|
|
|
<if test="search != null and search != ''"> |
|
|
|
AND hdb.name like concat(concat('%',#{search}),'%') |
|
|
|
AND hdb.name like concat(concat('%',#{search}),'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="classification == 1"> |
|
|
|
|
|
|
|
AND tt.operator = #{nuserId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="classification == 2"> |
|
|
|
<if test="classification == 2"> |
|
|
|
AND tt.title = '隐患上报' |
|
|
|
AND hdr.pc_operator = #{nuserId} |
|
|
|
AND tt.operator = #{nuserId} |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="classification == 3"> |
|
|
|
<if test="classification == 3"> |
|
|
|
AND tt.title != '隐患上报' |
|
|
|
AND hdr.pc_operator != #{nuserId} |
|
|
|
AND tt.operator = #{nuserId} |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
) t1 |
|
|
|
) t1 |
|
|
|
ORDER BY time_status, planEndTime DESC |
|
|
|
ORDER BY time_status, planEndTime DESC |
|
|
|
@ -574,7 +560,8 @@ |
|
|
|
<update id="updateDangerRoad"> |
|
|
|
<update id="updateDangerRoad"> |
|
|
|
update tht_hidden_danger_road |
|
|
|
update tht_hidden_danger_road |
|
|
|
set hd_flag = #{hdFlag} |
|
|
|
set hd_flag = #{hdFlag} |
|
|
|
, pc_end_time = CURRENT_TIMESTAMP,last_mod_date = NOW() |
|
|
|
,last_mod_date = NOW() |
|
|
|
|
|
|
|
, pc_operator = #{operator} |
|
|
|
where business_id = #{businessId} |
|
|
|
where business_id = #{businessId} |
|
|
|
and pc_count = #{pcCount} |
|
|
|
and pc_count = #{pcCount} |
|
|
|
</update> |
|
|
|
</update> |
|
|
|
|