From f9b2f057a596b46e521bc4bf136b5ed2169fd76d Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Tue, 30 Jan 2024 18:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AB=E9=A1=B9=E4=BD=9C=E4=B8=9Abug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datasource/map/MapEightMapper.java | 52 +- .../service/map/impl/MapEightServiceImpl.java | 81 +- .../mybatis/datasource/map/MapEightMapper.xml | 1558 +++++++++-------- 3 files changed, 896 insertions(+), 795 deletions(-) diff --git a/src/main/java/com/zcloud/mapper/datasource/map/MapEightMapper.java b/src/main/java/com/zcloud/mapper/datasource/map/MapEightMapper.java index f8fe4c5f..b4fc09d5 100644 --- a/src/main/java/com/zcloud/mapper/datasource/map/MapEightMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/map/MapEightMapper.java @@ -15,7 +15,7 @@ import java.util.Map; public interface MapEightMapper { - List getCorpinfoIds(String[] ArrayDATA_IDS); + List getCorpinfoIds(String[] ArrayDATA_IDS); /** * 获取柱状图 @@ -359,11 +359,11 @@ public interface MapEightMapper { */ List listAllMeasuresCUTROADOrder(PageData pd); - /** - * 动火获取字典展示 - * @param shuzu - * @return - */ + /** + * 动火获取字典展示 + * @param shuzu + * @return + */ List getListDongHuo(List shuzu); /** @@ -397,5 +397,45 @@ public interface MapEightMapper { List findByHOISTINGAcceptuserId(PageData pd); List findByHOISTINGAcceptuserIds(PageData pd); + + /**有限空间作业查询 + * @param pd + * @throws Exception + */ + PageData findByIdCONFINEDSPACEOrder(PageData pd); + + /**有限空间作业措施查询 + * @param pd + * @throws Exception + */ + List listAllMeasuresCONFINEDSPACEOrder(PageData pd); + + /** + * 有限空间 + * @param pd + * @return + */ + List listAllCONFINEDSPACEOrder(PageData pd); + + /** + * 有限空间 + * @param pd + * @return + */ + List findByIdCONFINEDSPACEAcceptuser(PageData pd); + + /** + * 有限空间 + * @param pd + * @return + */ + List findByIdCONFINEDSPACEAcceptusers(PageData pd); + + /** + * 有限空间气体检测 + * @param pd + * @return + */ + PageData findByIdCONFINEDSPACEGasWH(PageData pd); } diff --git a/src/main/java/com/zcloud/service/map/impl/MapEightServiceImpl.java b/src/main/java/com/zcloud/service/map/impl/MapEightServiceImpl.java index bd1316c3..b2286731 100644 --- a/src/main/java/com/zcloud/service/map/impl/MapEightServiceImpl.java +++ b/src/main/java/com/zcloud/service/map/impl/MapEightServiceImpl.java @@ -3,6 +3,7 @@ package com.zcloud.service.map.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.map.MapEightMapper; +import com.zcloud.service.bus.CorpInfoService; import com.zcloud.service.map.MapEightService; import com.zcloud.util.Tools; import org.apache.commons.lang.StringUtils; @@ -12,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 说明:实时地图八项工作 @@ -26,8 +28,8 @@ public class MapEightServiceImpl implements MapEightService { @Autowired private MapEightMapper mapEightMapper; - @Override - public List getCorpinfoIds(PageData pd) { + @Override + public List getCorpinfoIds(PageData pd) { String area = pd.getString("AREA"); if(StringUtils.isNotBlank(area)){ String[] ArrayDATA_IDS = area.split(","); @@ -39,12 +41,12 @@ public class MapEightServiceImpl implements MapEightService { return mapEightMapper.getCorpinfoIds(ArrayDATA_IDS); } return new ArrayList<>(); - } + } - @Override + @Override public Object getEcharts(PageData pd) { Map returnMap = new HashMap<>(); - String errInfo = "success"; + String errInfo = "success"; Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); @@ -108,28 +110,28 @@ public class MapEightServiceImpl implements MapEightService { @Override public List listAllHighRiskWorkLocation(PageData pd) throws Exception { - List r = new ArrayList<>(); - String typeStr = pd.getString("TYPE"); - //动火 - if(StringUtils.equals(typeStr,"HOTWORK")){ + List r = new ArrayList<>(); + String typeStr = pd.getString("TYPE"); + //动火 + if(StringUtils.equals(typeStr,"HOTWORK")){ // r = mapEightMapper.getHOTWORKHighRiskWorkLocation(pd); r = mapEightMapper.getHOTWORKHighRiskWorkLocationCfd(pd); - //临时用电 - }else if(StringUtils.equals(typeStr,"ELECTRICITY")){ - r = mapEightMapper.getELECTRICITYHighRiskWorkLocation(pd); - //盲板 - }else if(StringUtils.equals(typeStr,"BLINDBOARD")){ - r = mapEightMapper.getBLINDBOARDHighRiskWorkLocation(pd); - // 高处 - }else if(StringUtils.equals(typeStr,"HIGHWORK")){ - r = mapEightMapper.getHIGHWORKHighRiskWorkLocation(pd); - //有限空间 - }else if(StringUtils.equals(typeStr,"CONFINEDSPACE")){ - r = mapEightMapper.getCONFINEDSPACEHighRiskWorkLocation(pd); - //吊装 - }else if(StringUtils.equals(typeStr,"HOISTING")){ - r = mapEightMapper.getHOISTINGHighRiskWorkLocation(pd); - } + //临时用电 + }else if(StringUtils.equals(typeStr,"ELECTRICITY")){ + r = mapEightMapper.getELECTRICITYHighRiskWorkLocationOrder(pd); + //盲板 + }else if(StringUtils.equals(typeStr,"BLINDBOARD")){ + r = mapEightMapper.getBLINDBOARDHighRiskWorkLocationOrder(pd); + // 高处 + }else if(StringUtils.equals(typeStr,"HIGHWORK")){ + r = mapEightMapper.getHIGHWORKHighRiskWorkLocationOrder(pd); + //有限空间 + }else if(StringUtils.equals(typeStr,"CONFINEDSPACE")){ + r = mapEightMapper.getCONFINEDSPACEHighRiskWorkLocationOrder(pd); + //吊装 + }else if(StringUtils.equals(typeStr,"HOISTING")){ + r = mapEightMapper.getHOISTINGHighRiskWorkLocationOrder(pd); + } return r; } @@ -352,7 +354,7 @@ public class MapEightServiceImpl implements MapEightService { }else if(StringUtils.equals(typeStr,"BLINDBOARD")){ pd.put("BLINDBOARD_ID",idStr); pd = mapEightMapper.findByIdBLINDBOARDOrder(pd); - map.put("measuresList", mapEightMapper.listAllMeasuresBLINDBOARDOrder(pd)); + map.put("measuresList", mapEightMapper.listAllMeasuresBLINDBOARDOrder(pd)); PageData Info = mapEightMapper.findByIdJWDOrder(pd); pd.put("TYPE",105);//盲板位置图 pd.put("FOREIGN_KEY",pd.getString("BLINDBOARD_ID")); @@ -368,12 +370,13 @@ public class MapEightServiceImpl implements MapEightService { map.put("imgList1",mapEightMapper.findByHIGHWORKAcceptuserId(pd)); map.put("imgList",mapEightMapper.findByHIGHWORKAcceptuserIds(pd)); }else if(StringUtils.equals(typeStr,"CONFINEDSPACE")){ - //没有有限空间作业 - //pd.put("CONFINEDSPACE_ID",idStr); - //pd = mapEightMapper.findByIdCONFINEDSPACE(pd); - pd = new PageData(); - map.put("measuresList", null); - map.put("gasList", null); + pd.put("CONFINEDSPACE_ID",idStr); + pd = mapEightMapper.findByIdCONFINEDSPACEOrder(pd); //根据ID读取 + map.put("measuresList", mapEightMapper.listAllMeasuresCONFINEDSPACEOrder(pd)); + map.put("gasList", mapEightMapper.listAllCONFINEDSPACEOrder(pd)); + map.put("gas", mapEightMapper.findByIdCONFINEDSPACEGasWH(pd)); + map.put("imgList",mapEightMapper.findByIdCONFINEDSPACEAcceptusers(pd)); + map.put("imgList1",mapEightMapper.findByIdCONFINEDSPACEAcceptuser(pd)); }else if(StringUtils.equals(typeStr,"HOISTING")){ pd.put("HOISTING_ID",idStr); pd = mapEightMapper.findByIdHOISTINGOrder(pd); @@ -569,18 +572,18 @@ public class MapEightServiceImpl implements MapEightService { } } pd.put("specialUserList", specialUserList); - return pd; + return pd; } - private PageData dianhuo(PageData pd){ - if(StringUtils.isBlank(pd.getString("HOT_WORK_METHOD_NAME"))){ - String zidian = pd.getString("HOT_WORK_METHOD_ID"); - List shuzu = Arrays.asList(zidian.split(",")); + private PageData dianhuo(PageData pd){ + if(StringUtils.isBlank(pd.getString("HOT_WORK_METHOD_NAME"))){ + String zidian = pd.getString("HOT_WORK_METHOD_ID"); + List shuzu = Arrays.asList(zidian.split(",")); List wenzi = mapEightMapper.getListDongHuo(shuzu); String pinjie = String.join(",",wenzi); pd.put("HOT_WORK_METHOD_NAME",pinjie); } - return pd; - } + return pd; + } } diff --git a/src/main/resources/mybatis/datasource/map/MapEightMapper.xml b/src/main/resources/mybatis/datasource/map/MapEightMapper.xml index 4d0f9ebc..fadc2b02 100644 --- a/src/main/resources/mybatis/datasource/map/MapEightMapper.xml +++ b/src/main/resources/mybatis/datasource/map/MapEightMapper.xml @@ -67,24 +67,26 @@ AND CORPINFO_ID IN - #{item} + #{item} GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) UNION ALL + SELECT STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) CREATTIME, - '0' AS cutroadCount, + '0' AS hotworkapplicationCount, count( 1 ) blindboardCount, - '0' breakgroundCount, + '0' confinedspaceCount, '0' highworkCount, '0' hoistingCount, '0' electricityCount FROM - bus_blindboard + gf_blindboard WHERE DATE_SUB( CURDATE(), INTERVAL 4 DAY )<= STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) and ISDELETE = '0' + and APPLY_STATUS != '0' and CORPINFO_ID = #{CORPINFO_ID} @@ -96,19 +98,21 @@ GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) UNION ALL + SELECT STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) CREATTIME, '0' cutroadCount, '0' blindboardCount, - count( 1 ) breakgroundCount, + count( 1 ) confinedspaceCount, '0' highworkCount, '0' hoistingCount, '0' electricityCount FROM - bus_confinedspace + gf_confinedspace WHERE DATE_SUB( CURDATE(), INTERVAL 4 DAY )<= STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) and ISDELETE = '0' + and APPLY_STATUS != '0' and CORPINFO_ID = #{CORPINFO_ID} @@ -120,19 +124,21 @@ GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) UNION ALL + SELECT STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) CREATTIME, - '0' cutroadCount, + '0' hotworkapplicationCount, '0' blindboardCount, - '0' breakgroundCount, + '0' confinedspaceCount, count( 1 ) highworkCount, '0' hoistingCount, '0' electricityCount FROM - bus_highwork + gf_highwork WHERE DATE_SUB( CURDATE(), INTERVAL 4 DAY )<= STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) and ISDELETE = '0' + and APPLY_STATUS != '0' and CORPINFO_ID = #{CORPINFO_ID} @@ -144,19 +150,22 @@ GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) UNION ALL + + SELECT STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) CREATTIME, - '0' cutroadCount, + '0' hotworkapplicationCount, '0' blindboardCount, - '0' breakgroundCount, + '0' confinedspaceCount, '0' highworkCount, count( 1 ) hoistingCount, '0' electricityCount FROM - bus_hoisting + gf_hoisting WHERE DATE_SUB( CURDATE(), INTERVAL 4 DAY )<= STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) and ISDELETE = '0' + and APPLY_STATUS != '0' and CORPINFO_ID = #{CORPINFO_ID} @@ -168,49 +177,53 @@ GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) UNION ALL + + SELECT STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) CREATTIME, - '0' cutroadCount, + '0' hotworkapplicationCount, '0' blindboardCount, - '0' breakgroundCount, + '0' confinedspaceCount, '0' highworkCount, '0' hoistingCount, count( 1 ) electricityCount FROM - bus_electricity + gf_electricity WHERE DATE_SUB( CURDATE(), INTERVAL 4 DAY )<= STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) and ISDELETE = '0' + and APPLY_STATUS != '0' and CORPINFO_ID = #{CORPINFO_ID} - + AND CORPINFO_ID IN - + #{item} GROUP BY STR_TO_DATE( CREATTIME, '%Y-%m-%d' ) + ) s GROUP BY s.CREATTIME ) h ON h.CREATTIME = t.click_date order by t.click_date - + SELECT * FROM - (SELECT + (SELECT f.HOTWORK_ID ID, f.CHECK_NO WORK_NUMBER, '动火作业' WORK_TYPE, @@ -504,31 +409,38 @@ GROUP BY f.HOTWORK_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.electricity_ID ID, - f.CHECK_NO WORK_NUMBER, - '临时用电作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '待确认' - when '2' then '待审批' - when '3' then '已归档' - when '4' then '已验收' - when '-1' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.APPLY_USER_ID - when '1' then f.ASSURE_USER_ID - when '2' then f.APPROVE_USER_ID - when '3' then f.ACCEPT_USER_ID - when '-1' then f.APPLY_USER_ID - END NEXT_USER_ID, + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.electricity_ID ID, + f.CHECK_NO WORK_NUMBER, + '临时用电作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '用电单位待审核' + when '3' then '配送电单位待审核' + when '4' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.APPLY_USER_ID + when '1' then f.CONFIRM_USER_ID + when '2' then f.AUDIT_USER_ID + when '3' then f.APPROVE_USER_ID + when '4' then f.ACCEPT_USER_ID + when '-1' then f.APPLY_USER_ID + when '-2' then f.APPLY_USER_ID + when '-3' then f.APPLY_USER_ID + when '-4' then f.APPLY_USER_ID + when '-5' then f.APPLY_USER_ID + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_electricity f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('3','4') - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_electricity f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '5' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -538,32 +450,37 @@ #{pd.ids[${index}]} - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.blindboard_ID ID, - f.CHECK_NO WORK_NUMBER, - '盲板作业' WORK_TYPE, - case f.APPLY_STATUS - when '1' then '待确认' - when '2' then '待审批' - when '3' then '已归档' - when '4' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '1' then bb.OPERATION_UNIT_PERSONCHARGE - when '2' then bb.CORPINFO_APPROVER - when '3' then f.APPLY_USER_ID - when '4' then f.APPLY_USER_ID - END NEXT_USER_ID, + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.blindboard_ID ID, + f.CHECK_NO WORK_NUMBER, + '盲板作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '4' then '所在单位待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.APPLY_USER_ID + when '1' then f.CONSTRUCTION_USER_ID + when '4' then f.LEADER_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then APPLY_USER_ID + when '-5' then APPLY_USER_ID + when '-6' then APPLY_USER_ID + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_blindboard f - LEFT JOIN bus_blindboardinfo bb ON bb.BLINDBOARD_ID = f.BLINDBOARD_ID - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('3','4') - AND date_format(now(),'%Y-%m-%d %H:%i') >= bb.BOARD_INSTALL_TIME AND bb.BOARD_DISASSEMBLE_TIME >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_blindboard f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -573,39 +490,44 @@ #{pd.ids[${index}]} - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.HIGHWORK_ID ID, - f.CHECK_NO WORK_NUMBER, - '高处作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '待确认' - when '2' then '待审核' - when '3' then '待审批' - when '4' then '已归档' - when '5' then '已验收' - when '-2' then '确认打回' - when '-3' then '审核打回' - when '-4' then '审批打回' - when '55' then '待验收' - END STATUS_NAME, - case f.APPLY_STATUS - when '1' then f.CONSTRUCTION_USER_ID - when '2' then f.AUDIT_USER_ID - when '3' then f.APPROVE_USER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '55' then f.ACCEPT_USER_ID - END NEXT_USER_ID, + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.HIGHWORK_ID ID, + f.CHECK_NO WORK_NUMBER, + '高处作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '所在单位待审核' + when '3' then '审核部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.CONSTRUCTION_USER_ID + when '2' then f.LEADER_USER_ID + when '3' then f.AUDIT_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then f.CREATOR + when '-3' then f.CREATOR + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_highwork f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('4','5','55','-5') - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_highwork f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -615,44 +537,34 @@ #{pd.ids[${index}]} - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.confinedspace_ID ID, - f.WORK_PERMIT_NUMBER WORK_NUMBER, - '有限空间作业' WORK_TYPE, - case f.APPLY_STATUS - when '1' then '待采样' - when '2' then '作业单位责任人确认' - when '3' then '作业现场责任人审核' - when '4' then '管理单位责任人审批' - when '5' then '作业单位责任人验收' - when '6' then '管理单位责任人验收' - when '-2' then '作业单位责任人确认打回' - when '-3' then '作业现场责任人审核打回' - when '-4' then '管理单位责任人审批打回' - when '-5' then '作业单位责任人验收打回' - when '-6' then '管理单位责任人验收打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '1' then f.SAMPLING_ANALYST_ID - when '2' then f.WORK_UNIT_MANAGER_ID - when '3' then f.JOB_SITE_MANAGER_ID - when '4' then f.MANAGEMENT_UNIT_ID - when '5' then f.WORK_UNIT_MANAGER_ID - when '6' then f.MANAGEMENT_UNIT_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '-5' then f.CREATOR - when '-6' then f.CREATOR - END NEXT_USER_ID, + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.confinedspace_ID ID, + f.CHECK_NO WORK_NUMBER, + '有限空间作业' WORK_TYPE, + case f.APPLY_STATUS + when '1' then '作业负责人待审核' + when '4' then '所在单位待审核' + when '5' then '待验收' + when '-4' then '作业负责人审核打回' + when '-5' then '所在单位审核打回' + when '-6' then '验收打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '1' then f.CONFIRM_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_confinedspace f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '7' - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_confinedspace f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -662,40 +574,44 @@ #{pd.ids[${index}]} - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.hoisting_ID ID, - f.NUMBERING WORK_NUMBER, - '吊装作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '待确认' - when '2' then '待审核' - when '3' then '待审批' - when '4' then '已归档' - when '5' then '已验收' - when '-2' then '确认打回' - when '-3' then '审核打回' - when '-4' then '审批打回' - when '55' then '待验收' - END STATUS_NAME, - case f.APPLY_STATUS - when '1' then f.CONSTRUCTION_JOB_MANAGER_ID - when '2' then f.WORK_UNIT_MANAGER_ID - when '3' then f.BRANCH_APPROVER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '55' then f.ACCEPTOR_ID - END NEXT_USER_ID, + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.hoisting_ID ID, + f.CHECK_NO WORK_NUMBER, + '吊装作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业指挥待审核' + when '2' then '所在单位待审核' + when '3' then '审核部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.LEADER_USER_ID + when '2' then f.CONSTRUCTION_USER_ID + when '3' then f.AUDIT_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then f.CREATOR + when '-3' then f.CREATOR + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_hoisting f - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('4','5','55','-5') - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.JOB_START_TIME AND f.JOB_END_TIME >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_hoisting f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -705,9 +621,9 @@ #{pd.ids[${index}]} - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - ) f + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + ) f ORDER BY f.OPERATTIME DESC @@ -715,17 +631,17 @@ SELECT - 'ELECTRICITY' TYPE, - f.ELECTRICITY_ID id, - CONCAT_WS("", '临时用电作业 编号:', f.CHECK_NO) NAME, - f.WORK_LONGITUDE LONGITUDE, - f.WORK_LATITUDE LATITUDE, - './bi/images/map/electricity.png' IMAGE_FILE, + 'ELECTRICITY' TYPE, + f.ELECTRICITY_ID id, + CONCAT_WS("", '临时用电作业 编号:', f.CHECK_NO) NAME, + f.WORK_LONGITUDE LONGITUDE, + f.WORK_LATITUDE LATITUDE, + './bi/images/map/electricity.png' IMAGE_FILE, f.CORPINFO_ID, f.CHECK_NO as MAP_POINT_NAME FROM bus_electricity f WHERE f.ISDELETE = '0' AND f.WORK_LONGITUDE IS NOT NULL AND f.WORK_LATITUDE IS NOT NULL - AND f.APPLY_STATUS NOT IN ('3','4') - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + AND f.APPLY_STATUS NOT IN ('3','4') + AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') and f.CORPINFO_ID = #{CORPINFO_ID} @@ -764,7 +680,7 @@ SELECT - 'HIGHWORK' TYPE, - f.HIGHWORK_ID id, - CONCAT_WS("", '高处作业 编号:', f.CHECK_NO) NAME, - f.WORK_LONGITUDE LONGITUDE, - f.WORK_LATITUDE LATITUDE, - './bi/images/map/highwork.png' IMAGE_FILE, - f.CORPINFO_ID, - f.CHECK_NO as MAP_POINT_NAME - FROM bus_highwork f WHERE f.ISDELETE = '0' AND f.WORK_LONGITUDE IS NOT NULL AND f.WORK_LATITUDE IS NOT NULL - AND f.APPLY_STATUS NOT IN ('4','5','55','-5') - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + 'HIGHWORK' TYPE, + f.HIGHWORK_ID id, + CONCAT_WS("", '高处作业 编号:', f.CHECK_NO) NAME, + f.WORK_LONGITUDE LONGITUDE, + f.WORK_LATITUDE LATITUDE, + './bi/images/map/highwork.png' IMAGE_FILE, + f.CORPINFO_ID, + f.CHECK_NO as MAP_POINT_NAME + FROM bus_highwork f WHERE f.ISDELETE = '0' AND f.WORK_LONGITUDE IS NOT NULL AND f.WORK_LATITUDE IS NOT NULL + AND f.APPLY_STATUS NOT IN ('4','5','55','-5') + AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') and f.CORPINFO_ID = #{CORPINFO_ID} @@ -814,57 +730,6 @@ - - - - - - - SELECT * FROM - (SELECT - f.HOTWORKAPPLICATION_ID ID, - f.JOB_NUMBER WORK_NUMBER, - '动火作业' WORK_TYPE, - case f.STATE - when 1 then '动火单位负责人确认' - when 2 then '项目发包单位签发' - when 3 then '现场管辖单位负责人' - when 4 then '动火许可签发单位' - when 5 then '安全总监审批' - when 6 then '现场负责人' - when 7 then '动火前' - when 8 then '现场负责人确认' - when 9 then '动火后' - when 10 then '延时监火' - when 11 then '归档' - when 21 then '动火操作人' - when 22 then '监护人' - when 24 then '气体检测人' - when -1 then '审核不通过' - when -2 then '特级动火不通过' - when -3 then '未完成 关闭归档' - when -4 then '延期' - when -5 then '已打回' - when -6 then '超期' - when 30 then '动火负责人确认' - when 31 then '项目主管初审' - when 32 then '项目监管部门负责人' - when 33 then '分公司安全总监审批' - when 34 then '分公司主要负责人' - when 35 then '安全监督部初审' - when 36 then '安委会办公室' - when 37 then '安全总监审批' - END STATUS_NAME, - IF(f.STATE = 10,IFNULL(od.`NAME`,IFNULL(GROUP_CONCAT(REPLACE(u.NAME,'/',',')),IFNULL(qu.`NAME`,''))),IFNULL(GROUP_CONCAT(REPLACE(u.NAME,'/',',')),IFNULL(qu.`NAME`,''))) USER_NAME, - - DATE_FORMAT(ifnull(f.OPERATTIME,f.CREATTIME),'%Y-%m-%d %H:%i:%s') OPERATTIME - FROM bus_hotworkapplication f - LEFT JOIN bus_hotworkapplicationuser hu ON hu.FOREIGN_KEY = f.HOTWORKAPPLICATION_ID AND hu.STATE = f.STATE - LEFT JOIN sys_user u ON u.USER_ID = hu.USER_ID - LEFT JOIN oa_department od ON od.DEPARTMENT_ID = hu.USER_ID - LEFT JOIN `qa-gwj-regulatory`.sys_user qu on qu.USER_ID = hu.USER_ID - WHERE f.ISDELETE = '0' AND f.STATE >= 0 and f.STATE != 11 + (SELECT + f.HOTWORKAPPLICATION_ID ID, + f.JOB_NUMBER WORK_NUMBER, + '动火作业' WORK_TYPE, + case f.STATE + when 1 then '动火单位负责人确认' + when 2 then '项目发包单位签发' + when 3 then '现场管辖单位负责人' + when 4 then '动火许可签发单位' + when 5 then '安全总监审批' + when 6 then '现场负责人' + when 7 then '动火前' + when 8 then '现场负责人确认' + when 9 then '动火后' + when 10 then '延时监火' + when 11 then '归档' + when 21 then '动火操作人' + when 22 then '监护人' + when 24 then '气体检测人' + when -1 then '审核不通过' + when -2 then '特级动火不通过' + when -3 then '未完成 关闭归档' + when -4 then '延期' + when -5 then '已打回' + when -6 then '超期' + when 30 then '动火负责人确认' + when 31 then '项目主管初审' + when 32 then '项目监管部门负责人' + when 33 then '分公司安全总监审批' + when 34 then '分公司主要负责人' + when 35 then '安全监督部初审' + when 36 then '安委会办公室' + when 37 then '安全总监审批' + END STATUS_NAME, + IF(f.STATE = 10,IFNULL(od.`NAME`,IFNULL(GROUP_CONCAT(REPLACE(u.NAME,'/',',')),IFNULL(qu.`NAME`,''))),IFNULL(GROUP_CONCAT(REPLACE(u.NAME,'/',',')),IFNULL(qu.`NAME`,''))) USER_NAME, + + DATE_FORMAT(ifnull(f.OPERATTIME,f.CREATTIME),'%Y-%m-%d %H:%i:%s') OPERATTIME + FROM bus_hotworkapplication f + LEFT JOIN bus_hotworkapplicationuser hu ON hu.FOREIGN_KEY = f.HOTWORKAPPLICATION_ID AND hu.STATE = f.STATE + LEFT JOIN sys_user u ON u.USER_ID = hu.USER_ID + LEFT JOIN oa_department od ON od.DEPARTMENT_ID = hu.USER_ID + LEFT JOIN `qa-gwj-regulatory`.sys_user qu on qu.USER_ID = hu.USER_ID + WHERE f.ISDELETE = '0' AND f.STATE >= 0 and f.STATE != 11 and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2126,165 +1972,118 @@ - GROUP BY f.HOTWORKAPPLICATION_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.electricity_ID ID, - f.CHECK_NO WORK_NUMBER, - '临时用电作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业负责人待审核' - when '2' then '用电单位待审核' - when '3' then '配送电单位待审核' - when '4' then '待验收' - when '-2' then '已打回' - when '-3' then '已打回' - when '-4' then '已打回' - when '-5' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.APPLY_USER_ID - when '1' then f.CONFIRM_USER_ID - when '2' then f.AUDIT_USER_ID - when '3' then f.APPROVE_USER_ID - when '4' then f.ACCEPT_USER_ID - when '-1' then f.APPLY_USER_ID - when '-2' then f.APPLY_USER_ID - when '-3' then f.APPLY_USER_ID - when '-4' then f.APPLY_USER_ID - when '-5' then f.APPLY_USER_ID - END NEXT_USER_ID, - ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_electricity f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '5' - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - AND f.CORPINFO_ID IN - - #{pd.ids[${index}]} - - - - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.blindboard_ID ID, - f.CHECK_NO WORK_NUMBER, - '盲板作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业负责人待审核' - when '4' then '所在单位待审核' - when '5' then '待验收' - when '-2' then '已打回' - when '-5' then '已打回' - when '-6' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.APPLY_USER_ID - when '1' then f.CONSTRUCTION_USER_ID - when '4' then f.LEADER_USER_ID - when '5' then f.ACCEPT_USER_ID - when '-2' then APPLY_USER_ID - when '-5' then APPLY_USER_ID - when '-6' then APPLY_USER_ID - END NEXT_USER_ID, - ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_blindboard f - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '6' - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - AND f.CORPINFO_ID IN - - #{pd.ids[${index}]} - - - - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.HIGHWORK_ID ID, - f.CHECK_NO WORK_NUMBER, - '高处作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业负责人待审核' - when '2' then '所在单位待审核' - when '3' then '审核部门待审核' - when '4' then '审批部门待审核' - when '5' then '待验收' - when '-2' then '已打回' - when '-3' then '已打回' - when '-4' then '已打回' - when '-5' then '已打回' - when '-6' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.CREATOR - when '1' then f.CONSTRUCTION_USER_ID - when '2' then f.LEADER_USER_ID - when '3' then f.AUDIT_USER_ID - when '4' then f.APPROVE_USER_ID - when '5' then f.ACCEPT_USER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '-5' then f.CREATOR - when '-6' then f.CREATOR - END NEXT_USER_ID, - ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_highwork f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - AND f.CORPINFO_ID IN - - #{pd.ids[${index}]} - - - - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL + GROUP BY f.HOTWORKAPPLICATION_ID + UNION ALL SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME FROM (SELECT - f.confinedspace_ID ID, - f.WORK_PERMIT_NUMBER WORK_NUMBER, - '有限空间作业' WORK_TYPE, + f.electricity_ID ID, + f.CHECK_NO WORK_NUMBER, + '临时用电作业' WORK_TYPE, case f.APPLY_STATUS - when '1' then '待采样' - when '2' then '作业单位责任人确认' - when '3' then '作业现场责任人审核' - when '4' then '管理单位责任人审批' - when '5' then '作业单位责任人验收' - when '6' then '管理单位责任人验收' - when '-2' then '作业单位责任人确认打回' - when '-3' then '作业现场责任人审核打回' - when '-4' then '管理单位责任人审批打回' - when '-5' then '作业单位责任人验收打回' - when '-6' then '管理单位责任人验收打回' + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '用电单位待审核' + when '3' then '配送电单位待审核' + when '4' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' END STATUS_NAME, case f.APPLY_STATUS - when '1' then f.SAMPLING_ANALYST_ID - when '2' then f.WORK_UNIT_MANAGER_ID - when '3' then f.JOB_SITE_MANAGER_ID - when '4' then f.MANAGEMENT_UNIT_ID - when '5' then f.WORK_UNIT_MANAGER_ID - when '6' then f.MANAGEMENT_UNIT_ID + when '0' then f.APPLY_USER_ID + when '1' then f.CONFIRM_USER_ID + when '2' then f.AUDIT_USER_ID + when '3' then f.APPROVE_USER_ID + when '4' then f.ACCEPT_USER_ID + when '-1' then f.APPLY_USER_ID + when '-2' then f.APPLY_USER_ID + when '-3' then f.APPLY_USER_ID + when '-4' then f.APPLY_USER_ID + when '-5' then f.APPLY_USER_ID + END NEXT_USER_ID, + ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME + FROM gf_electricity f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '5' + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + AND f.CORPINFO_ID IN + + #{pd.ids[${index}]} + + + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.blindboard_ID ID, + f.CHECK_NO WORK_NUMBER, + '盲板作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '4' then '所在单位待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.APPLY_USER_ID + when '1' then f.CONSTRUCTION_USER_ID + when '4' then f.LEADER_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then APPLY_USER_ID + when '-5' then APPLY_USER_ID + when '-6' then APPLY_USER_ID + END NEXT_USER_ID, + ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME + FROM gf_blindboard f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '6' + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + AND f.CORPINFO_ID IN + + #{pd.ids[${index}]} + + + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.HIGHWORK_ID ID, + f.CHECK_NO WORK_NUMBER, + '高处作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '所在单位待审核' + when '3' then '审核部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.CONSTRUCTION_USER_ID + when '2' then f.LEADER_USER_ID + when '3' then f.AUDIT_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID when '-2' then f.CREATOR when '-3' then f.CREATOR when '-4' then f.CREATOR @@ -2292,8 +2091,44 @@ when '-6' then f.CREATOR END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM bus_confinedspace f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '7' - AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') + FROM gf_highwork f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + AND f.CORPINFO_ID IN + + #{pd.ids[${index}]} + + + + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.confinedspace_ID ID, + f.CHECK_NO WORK_NUMBER, + '有限空间作业' WORK_TYPE, + case f.APPLY_STATUS + when '1' then '作业负责人待审核' + when '4' then '所在单位待审核' + when '5' then '待验收' + when '-4' then '作业负责人审核打回' + when '-5' then '所在单位审核打回' + when '-6' then '验收打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '1' then f.CONFIRM_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, + ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME + FROM gf_confinedspace f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2305,42 +2140,42 @@ ) f LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.hoisting_ID ID, - f.CHECK_NO WORK_NUMBER, - '吊装作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业指挥待审核' - when '2' then '所在单位待审核' - when '3' then '审核部门待审核' - when '4' then '审批部门待审核' - when '5' then '待验收' - when '-2' then '已打回' - when '-3' then '已打回' - when '-4' then '已打回' - when '-5' then '已打回' - when '-6' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.CREATOR - when '1' then f.LEADER_USER_ID - when '2' then f.CONSTRUCTION_USER_ID - when '3' then f.AUDIT_USER_ID - when '4' then f.APPROVE_USER_ID - when '5' then f.ACCEPT_USER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '-5' then f.CREATOR - when '-6' then f.CREATOR - END NEXT_USER_ID, + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.hoisting_ID ID, + f.CHECK_NO WORK_NUMBER, + '吊装作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业指挥待审核' + when '2' then '所在单位待审核' + when '3' then '审核部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.LEADER_USER_ID + when '2' then f.CONSTRUCTION_USER_ID + when '3' then f.AUDIT_USER_ID + when '4' then f.APPROVE_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then f.CREATOR + when '-3' then f.CREATOR + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_hoisting f - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' + FROM gf_hoisting f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2351,45 +2186,45 @@ - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.BREAKGROUND_ID ID, - f.CHECK_NO WORK_NUMBER, - '动土作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业负责人待审核' - when '2' then '所在单位待审核' - when '3' then '有关部门待审核' - when '4' then '审批部门待审核' - when '5' then '待验收' - when '-2' then '已打回' - when '-3' then '已打回' - when '-4' then '已打回' - when '-5' then '已打回' - when '-6' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.CREATOR - when '1' then f.CONSTRUCTION_USER_ID - when '2' then f.PRODUCTION_USER_ID - when '3' then f.SAFETY_USER_ID - when '4' then f.LEADER_USER_ID - when '5' then f.ACCEPT_USER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '-5' then f.CREATOR - when '-6' then f.CREATOR - END NEXT_USER_ID, + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.BREAKGROUND_ID ID, + f.CHECK_NO WORK_NUMBER, + '动土作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '所在单位待审核' + when '3' then '有关部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.CONSTRUCTION_USER_ID + when '2' then f.PRODUCTION_USER_ID + when '3' then f.SAFETY_USER_ID + when '4' then f.LEADER_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then f.CREATOR + when '-3' then f.CREATOR + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_breakground f - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' + FROM gf_breakground f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2400,45 +2235,45 @@ - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - UNION ALL - SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME - FROM - (SELECT - f.CUTROAD_ID ID, - f.CHECK_NO WORK_NUMBER, - '断路作业' WORK_TYPE, - case f.APPLY_STATUS - when '0' then '待提交' - when '1' then '作业负责人待审核' - when '2' then '所在单位待审核' - when '3' then '消防、安全管理部门待审核' - when '4' then '审批部门待审核' - when '5' then '待验收' - when '-2' then '已打回' - when '-3' then '已打回' - when '-4' then '已打回' - when '-5' then '已打回' - when '-6' then '已打回' - END STATUS_NAME, - case f.APPLY_STATUS - when '0' then f.CREATOR - when '1' then f.CONSTRUCTION_USER_ID - when '2' then f.PRODUCTION_USER_ID - when '3' then f.SAFETY_USER_ID - when '4' then f.LEADER_USER_ID - when '5' then f.ACCEPT_USER_ID - when '-2' then f.CREATOR - when '-3' then f.CREATOR - when '-4' then f.CREATOR - when '-5' then f.CREATOR - when '-6' then f.CREATOR - END NEXT_USER_ID, + UNION ALL + SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME + FROM + (SELECT + f.CUTROAD_ID ID, + f.CHECK_NO WORK_NUMBER, + '断路作业' WORK_TYPE, + case f.APPLY_STATUS + when '0' then '待提交' + when '1' then '作业负责人待审核' + when '2' then '所在单位待审核' + when '3' then '消防、安全管理部门待审核' + when '4' then '审批部门待审核' + when '5' then '待验收' + when '-2' then '已打回' + when '-3' then '已打回' + when '-4' then '已打回' + when '-5' then '已打回' + when '-6' then '已打回' + END STATUS_NAME, + case f.APPLY_STATUS + when '0' then f.CREATOR + when '1' then f.CONSTRUCTION_USER_ID + when '2' then f.PRODUCTION_USER_ID + when '3' then f.SAFETY_USER_ID + when '4' then f.LEADER_USER_ID + when '5' then f.ACCEPT_USER_ID + when '-2' then f.CREATOR + when '-3' then f.CREATOR + when '-4' then f.CREATOR + when '-5' then f.CREATOR + when '-6' then f.CREATOR + END NEXT_USER_ID, ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME - FROM gf_cutroad f - WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' + FROM gf_cutroad f + WHERE f.ISDELETE = '0' AND f.APPLY_STATUS !='6' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2449,9 +2284,9 @@ - ) f - LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID - ) f + ) f + LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID + ) f ORDER BY f.OPERATTIME DESC @@ -2479,9 +2314,9 @@ - + select - `NAME` + `NAME` from - sys_dictionaries + sys_dictionaries where - DICTIONARIES_ID in + DICTIONARIES_ID in #{item} @@ -3704,4 +3538,228 @@ f.HOISTING_ID = #{HOISTING_ID} and f.CORPINFO_ID = #{CORPINFO_ID} and f.ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID} order by f.ACCEPT_CONFESS_USER_SIGNER_TIME asc + + + + + + + + + + + + + +