首页统计每日工作接口和bug修复
parent
f475638fbd
commit
8cdb06f8db
|
@ -11,6 +11,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import com.zcloud.aspect.DockAnnotation;
|
import com.zcloud.aspect.DockAnnotation;
|
||||||
import com.zcloud.entity.system.User;
|
import com.zcloud.entity.system.User;
|
||||||
|
import com.zcloud.service.bus.*;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.fop.render.afp.modca.PageDescriptor;
|
import org.apache.fop.render.afp.modca.PageDescriptor;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
@ -29,14 +30,6 @@ import com.hp.hpl.sparta.xpath.ThisNodeTest;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.service.bus.CheckRecordService;
|
|
||||||
import com.zcloud.service.bus.IdentificationPartsService;
|
|
||||||
import com.zcloud.service.bus.ListCheckItemService;
|
|
||||||
import com.zcloud.service.bus.ListDisableTimeService;
|
|
||||||
import com.zcloud.service.bus.ListManagerService;
|
|
||||||
import com.zcloud.service.bus.ListStatisticsService;
|
|
||||||
import com.zcloud.service.bus.RecordItemService;
|
|
||||||
import com.zcloud.service.bus.RiskPointService;
|
|
||||||
import com.zcloud.service.system.DepartmentService;
|
import com.zcloud.service.system.DepartmentService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,6 +60,8 @@ public class ListManagerController extends BaseController {
|
||||||
private IdentificationPartsService identificationPartsService;
|
private IdentificationPartsService identificationPartsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ListDisableTimeService listdisabletimeService;
|
private ListDisableTimeService listdisabletimeService;
|
||||||
|
@Autowired
|
||||||
|
private HiddenService hiddenService;
|
||||||
|
|
||||||
/**新增
|
/**新增
|
||||||
* @param
|
* @param
|
||||||
|
@ -1173,6 +1168,20 @@ public class ListManagerController extends BaseController {
|
||||||
wjcNum++;
|
wjcNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||||
|
PageData forBi = hiddenService.findForBi(pd);
|
||||||
|
boolean flag = true;
|
||||||
|
if (forBi!=null) {
|
||||||
|
for (Object key : forBi.keySet()) {
|
||||||
|
if ((Long)forBi.get(key) > 0) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
forBi = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.put("countMap",forBi);
|
||||||
map.put("yjcNum", yjcNum);
|
map.put("yjcNum", yjcNum);
|
||||||
map.put("wjcNum", wjcNum);
|
map.put("wjcNum", wjcNum);
|
||||||
map.put("varList", varList);
|
map.put("varList", varList);
|
||||||
|
|
|
@ -206,9 +206,12 @@ public class MapController extends BaseController {
|
||||||
//人闸机
|
//人闸机
|
||||||
PageData personCount = gateMachineInfoService.peopleCount(pageData);
|
PageData personCount = gateMachineInfoService.peopleCount(pageData);
|
||||||
if (personCount!=null){
|
if (personCount!=null){
|
||||||
data.put("personInCount", personCount.get("inCount"));
|
int inCount = Integer.parseInt(personCount.getString("inCount"));
|
||||||
data.put("personOutCount", personCount.get("outCount"));
|
int outCount = Integer.parseInt(personCount.getString("outCount"));
|
||||||
data.put("personUnkownCount", personCount.get("noCount"));
|
int onSiteCount = Math.max(inCount - outCount, 0);
|
||||||
|
data.put("personInCount", inCount);
|
||||||
|
data.put("personOutCount", outCount);
|
||||||
|
data.put("personOnSiteCount", onSiteCount);
|
||||||
}
|
}
|
||||||
//车闸机
|
//车闸机
|
||||||
pageData.put("GATE_AREA_TYPE", 1);
|
pageData.put("GATE_AREA_TYPE", 1);
|
||||||
|
|
|
@ -361,5 +361,6 @@ public interface HiddenMapper{
|
||||||
//公司检查统计数据
|
//公司检查统计数据
|
||||||
List<PageData> getExcelGsc(PageData pd);
|
List<PageData> getExcelGsc(PageData pd);
|
||||||
|
|
||||||
|
PageData findForBi(PageData pageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -449,5 +449,7 @@ public interface HiddenService{
|
||||||
public List<PageData> findBySource(Integer sourceNumber);
|
public List<PageData> findBySource(Integer sourceNumber);
|
||||||
|
|
||||||
Map<String,Object> getExcelMap(PageData pageData);
|
Map<String,Object> getExcelMap(PageData pageData);
|
||||||
|
|
||||||
|
public PageData findForBi(PageData pageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -936,5 +936,10 @@ public class HiddenServiceImpl implements HiddenService{
|
||||||
map.put("allBuMenHjZg",allBuMenHjZg);
|
map.put("allBuMenHjZg",allBuMenHjZg);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData findForBi(PageData pageData) {
|
||||||
|
return hiddenMapper.findForBi(pageData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,21 +98,22 @@
|
||||||
|
|
||||||
<select id="getDetailById" parameterType="pd" resultType="pd">
|
<select id="getDetailById" parameterType="pd" resultType="pd">
|
||||||
SELECT
|
SELECT
|
||||||
f.FID,
|
f.FID,
|
||||||
f.FNAME,
|
f.FNAME,
|
||||||
CONCAT_WS( '--', f.LATITUDE, f.LONGITUDE ) LONGTITUDEANDLATITUDE,
|
CONCAT_WS( '--', f.LATITUDE, f.LONGITUDE ) LONGTITUDEANDLATITUDE,
|
||||||
f.LATITUDE,
|
f.LATITUDE,
|
||||||
f.LONGITUDE,
|
f.LONGITUDE,
|
||||||
ba.FVALUE,
|
f.FNAME AS EQUIPMENTNAME,
|
||||||
ba.FTIME,
|
al.FVALUE,
|
||||||
ba.FVALUE as WINDSPEED,
|
al.FTIME,
|
||||||
f.FNAME AS EQUIPMENTNAME,
|
al.FVALUE AS WINDSPEED,
|
||||||
ba.FTIME as OPERATTIME
|
al.FTIME AS OPERATTIME
|
||||||
FROM
|
FROM
|
||||||
bus_anemometer_machine f
|
bus_anemometer_machine f
|
||||||
LEFT JOIN ( SELECT FNAME,FVALUE, MAX( FTIME ) as FTIME FROM bus_anemometer_local GROUP BY FNAME ) ba on f.FNAME =ba.FNAME
|
LEFT JOIN ( SELECT MAX( FTIME ) AS FTIME,FNAME FROM bus_anemometer_local GROUP BY FNAME ) ba ON f.FNAME = ba.FNAME
|
||||||
|
LEFT JOIN bus_anemometer_local al ON f.FNAME = al.FNAME and al.FTIME = ba.FTIME
|
||||||
WHERE
|
WHERE
|
||||||
f.FNAME = #{FNAME}
|
f.FNAME = #{FNAME}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -3135,6 +3135,678 @@ WHERE
|
||||||
and h.CREATTIME <![CDATA[ >= ]]> #{startTime}
|
and h.CREATTIME <![CDATA[ >= ]]> #{startTime}
|
||||||
and h.CREATTIME <![CDATA[ <= ]]> #{endTime}
|
and h.CREATTIME <![CDATA[ <= ]]> #{endTime}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findForBi" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
CAST(count1.CONFIRM_COUNT AS SIGNED) CONFIRM_COUNT,
|
||||||
|
CAST(count2.RECTIFICATION_COUNT AS SIGNED) RECTIFICATION_COUNT,
|
||||||
|
CAST(count3.DELAY_COUNT AS SIGNED) DELAY_COUNT,
|
||||||
|
CAST(count4.CHECK_COUNT AS SIGNED) CHECK_COUNT,
|
||||||
|
CAST(count5.SPECIAL_COUNT AS SIGNED) SPECIAL_COUNT,
|
||||||
|
CAST(count6.INSPECTION_COUNT AS SIGNED) INSPECTION_COUNT,
|
||||||
|
CAST(count7.INSPECTIONED_COUNT AS SIGNED) INSPECTIONED_COUNT,
|
||||||
|
CAST(count8.ASSIGN_COUNT AS SIGNED) ASSIGN_COUNT,
|
||||||
|
CAST(count8.ASSIGN_HIDDEN_COUNT AS SIGNED) ASSIGN_HIDDEN_COUNT,
|
||||||
|
CAST(count9.ACCEPT_COUNT AS SIGNED) ACCEPT_COUNT,
|
||||||
|
CAST(count9.ACCEPT_HIDDEN_COUNT AS SIGNED) ACCEPT_HIDDEN_COUNT,
|
||||||
|
CAST(count10.FIRECHECK_COUNT AS SIGNED) FIRECHECK_COUNT,
|
||||||
|
CAST(count11.PUNISH_COUNT AS SIGNED) PUNISH_COUNT,
|
||||||
|
CAST(count12.OUTSOURCED_COUNT AS SIGNED) OUTSOURCED_COUNT,
|
||||||
|
CAST(count13.PROMISE_SINGED AS SIGNED) PROMISE_SINGED,
|
||||||
|
CAST(count14.RESPONSOBILITY_SINGED AS SIGNED) RESPONSOBILITY_SINGED,
|
||||||
|
CAST(count15.CONFINEDSPACE_COUNT AS SIGNED) CONFINEDSPACE_COUNT,
|
||||||
|
CAST(count15.BLINDBOARD_COUNT AS SIGNED) BLINDBOARD_COUNT,
|
||||||
|
CAST(count15.BREAKGROUND_COUNT AS SIGNED) BREAKGROUND_COUNT,
|
||||||
|
CAST(count15.HIGHWORK_COUNT AS SIGNED) HIGHWORK_COUNT,
|
||||||
|
CAST(count15.HOSTING_COUNT AS SIGNED) HOSTING_COUNT,
|
||||||
|
CAST(count15.ELECTRICITY_COUNT AS SIGNED) ELECTRICITY_COUNT,
|
||||||
|
CAST(count15.CUTROAD_COUNT AS SIGNED) CUTROAD_COUNT,
|
||||||
|
CAST(count15.HOTWORK_COUNT AS SIGNED) HOTWORK_COUNT
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( DISTINCT h.HIDDEN_ID ) CONFIRM_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN bus_hidden h ON h.CONFIRM_USER = f.USER_ID
|
||||||
|
AND h.STATE = '-2'
|
||||||
|
AND h.ISDELETE = '0'
|
||||||
|
AND h.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
ORDER BY
|
||||||
|
h.CREATTIME DESC
|
||||||
|
) count1,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( DISTINCT h.HIDDEN_ID ) RECTIFICATION_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN bus_hidden h ON h.RECTIFICATIONOR = f.USER_ID
|
||||||
|
AND h.STATE = '1'
|
||||||
|
AND h.ISDELETE = '0'
|
||||||
|
AND h.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
ORDER BY
|
||||||
|
h.CREATTIME DESC
|
||||||
|
) count2,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( DISTINCT he.HIDDENEXAMINE_ID ) DELAY_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN bus_hidden h ON h.CONFIRM_USER = f.USER_ID
|
||||||
|
AND h.state = '1'
|
||||||
|
AND h.ISDELETE = '0'
|
||||||
|
AND h.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
LEFT JOIN BUS_HIDDENEXAMINE he ON he.HIDDEN_ID = h.HIDDEN_ID
|
||||||
|
AND he.TYPE = '2'
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
ORDER BY
|
||||||
|
h.CREATTIME DESC
|
||||||
|
) count3,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
IFNULL(COUNT(DISTINCT h.HIDDEN_ID),0) CHECK_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN bus_hiddencheck hc ON hc.USER_ID = f.USER_ID
|
||||||
|
LEFT JOIN bus_hidden h ON h.HIDDEN_ID = hc.HIDDEN_ID
|
||||||
|
AND h.STATE = '2'
|
||||||
|
AND h.ISDELETE = '0'
|
||||||
|
AND h.STATE NOT IN ( '0', '7', '8', '100', '101', '102' )
|
||||||
|
AND h.HIDDENLEVEL != 'hiddenLevel2002'
|
||||||
|
AND h.HIDDENLEVEL != 'hiddenLevel1001'
|
||||||
|
AND h.HIDDENLEVEL != 'jdyh001'
|
||||||
|
AND h.HIDDENLEVEL NOT IN ( 'hiddenLevel2002', 'hiddenLevel1001', 'jdyh001' )
|
||||||
|
AND h.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
AND ( SELECT count( 1 ) FROM BUS_HIDDENCHECK bh WHERE bh.HIDDEN_ID = h.HIDDEN_ID AND bh.USER_ID = #{USER_ID} ) > 0
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
ORDER BY
|
||||||
|
h.CREATTIME DESC
|
||||||
|
) count4,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( DISTINCT he.HIDDENEXAMINE_ID ) SPECIAL_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN bus_hidden h ON h.CONFIRM_USER = f.USER_ID
|
||||||
|
AND h.state = '7'
|
||||||
|
AND h.ISDELETE = '0'
|
||||||
|
AND h.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
LEFT JOIN BUS_HIDDENEXAMINE he ON he.HIDDEN_ID = h.HIDDEN_ID
|
||||||
|
AND he.TYPE = '1'
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
ORDER BY
|
||||||
|
h.CREATTIME DESC
|
||||||
|
) count5,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT bi.INSPECTION_ID) as INSPECTION_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_USER_ID = f.USER_ID
|
||||||
|
AND si.ISDELETE = '0' AND si.INSPECTION_USER_SIGN_TIME is null
|
||||||
|
LEFT JOIN bus_inspection_safetyenvironmental bi ON bi.INSPECTION_ID = si.INSPECTION_ID AND (bi.INSPECTION_STATUS = '0' or bi.INSPECTION_STATUS = '1' )
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count6,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT se.INSPECTION_ID) INSPECTIONED_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_USER_ID = f.USER_ID
|
||||||
|
AND si.ISDELETE = '0'
|
||||||
|
LEFT JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL se ON (se.INSPECTION_ID = si.INSPECTION_ID or se.INSPECTED_DEPARTMENT_ID IN ( f.DEPARTMENT_ID ) ) AND se.INSPECTION_STATUS = '2' AND se.ISDELETE = '0' AND se.CORPINFO_ID = #{CORPINFO_ID} AND
|
||||||
|
SE.INSPECTED_SITEUSER_ID = #{USER_ID}
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count7,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT bi.INSPECTION_ID) ASSIGN_COUNT, COUNT(DISTINCT h.HIDDEN_ID) ASSIGN_HIDDEN_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_inspection_safetyenvironmental bi ON (
|
||||||
|
bi.INSPECTION_ORIGINATOR_ID = f.USER_ID
|
||||||
|
OR bi.INSPECTED_SITEUSER_ID = f.USER_ID
|
||||||
|
OR EXISTS ( SELECT 1 FROM bus_inspection_safetyenvironmental_inspector sii WHERE sii.INSPECTION_USER_ID = f.USER_ID AND sii.INSPECTION_ID = bi.INSPECTION_ID )
|
||||||
|
)
|
||||||
|
AND bi.INSPECTION_STATUS = '3'
|
||||||
|
AND bi.ISDELETE = '0'
|
||||||
|
LEFT JOIN bus_hidden h ON h.FOREIGN_ID = bi.INSPECTION_ID AND h.STATE = '101' AND (h.FINAL_CHECK IS NULL or h.FINAL_CHECK = '2')
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count8,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT bi.INSPECTION_ID) ACCEPT_COUNT, COUNT(DISTINCT h.HIDDEN_ID) ACCEPT_HIDDEN_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_inspection_safetyenvironmental bi ON (
|
||||||
|
bi.INSPECTION_ORIGINATOR_ID = f.USER_ID
|
||||||
|
OR bi.INSPECTED_SITEUSER_ID = f.USER_ID
|
||||||
|
OR EXISTS ( SELECT 1 FROM bus_inspection_safetyenvironmental_inspector sii WHERE sii.INSPECTION_USER_ID = f.USER_ID AND sii.INSPECTION_ID = bi.INSPECTION_ID )
|
||||||
|
)
|
||||||
|
AND bi.INSPECTION_STATUS = '6'
|
||||||
|
AND bi.ISDELETE = '0'
|
||||||
|
LEFT JOIN bus_hidden h ON h.FOREIGN_ID = bi.INSPECTION_ID AND (h.STATE = '4' OR h.STATE = '8') AND (h.FINAL_CHECK IS NULL or h.FINAL_CHECK = '2')
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count9,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
IFNULL( COUNT( DISTINCT bf.FIRE_CHECK_ID ), 0 ) FIRECHECK_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_fire_checklist bf ON bf.DEPARTMENT_ID IN ( f.DEPARTMENT_ID )
|
||||||
|
AND bf.ISDELETE = 0
|
||||||
|
AND bf.STATE = 0
|
||||||
|
AND bf.FIRE_CHECK_ID NOT IN ( SELECT FIRE_CHECK_ID FROM bus_fire_checklist
|
||||||
|
LEFT JOIN (SELECT GROUP_CONCAT( DISTINCT FIRE_CHECK_ID SEPARATOR ',' ) ids FROM bus_fire_record WHERE CREATOR = #{USER_ID} AND PHONE_REPEAT = '0') bfr ON 1= 1
|
||||||
|
WHERE FIND_IN_SET( FIRE_CHECK_ID, bfr.ids ))
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count10,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
ifnull( sum(cfsl.co), 0 ) AS PUNISH_COUNT
|
||||||
|
FROM
|
||||||
|
`qa-cmt-regulatory`.BUS_OUTSOURCED f
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
PUN.OUTSOURCED_ID,
|
||||||
|
COUNT( DISTINCT PUN.HIDDEN_ID ) co
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
f.HIDDEN_ID,
|
||||||
|
ifnull( bo.OUTSOURCED_ID, boai.OUTSOURCED_ID ) OUTSOURCED_ID
|
||||||
|
FROM
|
||||||
|
`qa-cmt-prevention`.BUS_KEYPROJECT_HIDDEN f
|
||||||
|
LEFT JOIN `qa-cmt-prevention`.bus_keyprojectcheck keycheck ON keycheck.KEYPROJECTCHECK_ID = f.FOREIGN_ID
|
||||||
|
LEFT JOIN `qa-cmt-regulatory`.BUS_OUTSOURCED bo ON keycheck.OUTSOURCED_ID = bo.OUTSOURCED_ID
|
||||||
|
LEFT JOIN `qa-cmt-regulatory`.BUS_OUTSOURCED boai ON f.FOREIGN_ID = boai.OUTSOURCED_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.SOURCE IN ( '4', '5', '1' )
|
||||||
|
AND ifnull( bo.OUTSOURCED_ID, boai.OUTSOURCED_ID ) IS NOT NULL
|
||||||
|
AND f.ISPUNISH IS NULL
|
||||||
|
) PUN
|
||||||
|
GROUP BY
|
||||||
|
PUN.OUTSOURCED_ID
|
||||||
|
) cfsl ON cfsl.OUTSOURCED_ID = f.OUTSOURCED_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.PUNISH_THE_PERSON LIKE CONCAT( CONCAT( '%', #{USER_ID} ), '%' )
|
||||||
|
AND f.STATE = '1'
|
||||||
|
) count11,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT o.OUTSOURCED_ID) OUTSOURCED_COUNT
|
||||||
|
FROM
|
||||||
|
SYS_USER f
|
||||||
|
LEFT JOIN `qa-cmt-regulatory`.bus_outsourced o ON o.CREATOR = f.USER_ID AND o.STATE = '-1'
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count12,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
count( DISTINCT e.PROMISE_ID ) PROMISE_SINGED
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_corppromise_people c ON c.USER_ID = f.USER_ID
|
||||||
|
AND c.ISSIGN = 0
|
||||||
|
AND c.ISPROMISE_PEOPLE = '0'
|
||||||
|
AND c.ISDELETE = '0'
|
||||||
|
LEFT JOIN bus_corppromise e ON e.PROMISE_ID = c.PROMISE_ID AND ( e.PROMISE_ID IS NULL OR e.STATE != '1' )
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count13,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
count( DISTINCT e.RESPONSIBILITY_ID ) RESPONSOBILITY_SINGED
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_corpresponsibility_people c ON c.USER_ID = f.USER_ID
|
||||||
|
AND c.ISSIGN = 0
|
||||||
|
AND c.ISRESPONSIBILITY_PEOPLE = '0'
|
||||||
|
AND c.ISDELETE = '0'
|
||||||
|
LEFT JOIN bus_corpresponsibility e ON e.RESPONSIBILITY_ID = c.RESPONSIBILITY_ID
|
||||||
|
AND ( e.RESPONSIBILITY_ID IS NULL OR e.STATE != '1' )
|
||||||
|
WHERE
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) count14,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
a.COUNTBACK + a.COUNTCONFIRM + a.COUNTGUARDIAN + a.COUNTAUDIT + a.COUNTAPPROVE + a.COUNTACCEPT + a.COUNTANALYZE + a.COUNTCONFESS + a.COUNTACCEPTCONFESS
|
||||||
|
) CONFINEDSPACE_COUNT,
|
||||||
|
(
|
||||||
|
b.COUNTBACK + b.COUNTCONSTRUCTION + b.COUNTPRODUCTION + b.COUNTSAFETY + b.COUNTLEADER + b.COUNTACCEPT + b.COUNTGUARDIAN + b.COUNTCONFESS + b.COUNTACCEPTCONFESS
|
||||||
|
) BLINDBOARD_COUNT,
|
||||||
|
(
|
||||||
|
c.COUNTBACK + c.COUNTCONSTRUCTION + c.COUNTPRODUCTION + c.COUNTSAFETY + c.COUNTLEADER + c.COUNTACCEPT + c.COUNTGUARDIAN + c.COUNTCONFESS + c.COUNTACCEPTCONFESS
|
||||||
|
) BREAKGROUND_COUNT,
|
||||||
|
(
|
||||||
|
d.COUNTBACK + d.COUNTCONSTRUCTION + d.COUNTLEADER + d.COUNTAUDIT + d.COUNTAPPROVE + d.COUNTACCEPT + d.COUNTGUARDIAN + d.COUNTCONFESS + d.COUNTACCEPTCONFESS
|
||||||
|
) HIGHWORK_COUNT,
|
||||||
|
(
|
||||||
|
e.COUNTBACK + e.COUNTLEADER + e.COUNTCONSTRUCTION + e.COUNTAUDIT + e.COUNTAPPROVE + e.COUNTACCEPT + e.COUNTGUARDIAN + e.COUNTCONFESS + e.COUNTACCEPTCONFESS
|
||||||
|
) HOSTING_COUNT,
|
||||||
|
(
|
||||||
|
f.COUNTBACK + f.COUNTCONFIRM + f.COUNTAUDIT + f.COUNTAPPROVE + f.COUNTACCEPT + f.COUNTANALYZE + f.COUNTGUARDIAN + f.COUNTCONFESS + f.COUNTACCEPTCONFESS
|
||||||
|
) ELECTRICITY_COUNT,
|
||||||
|
(
|
||||||
|
g.COUNTBACK + g.COUNTCONSTRUCTION + g.COUNTPRODUCTION + g.COUNTSAFETY + g.COUNTLEADER + g.COUNTACCEPT + g.COUNTGUARDIAN + g.COUNTCONFESS + g.COUNTACCEPTCONFESS
|
||||||
|
) CUTROAD_COUNT,
|
||||||
|
h.HOTWORK_COUNT HOTWORK_COUNT
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONFIRM_USER_ID = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTCONFIRM,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.GUARDIAN_USER_ID = #{USER_ID} AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN f.CONFINEDSPACE_ID END ) COUNTGUARDIAN,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTAUDIT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTAPPROVE,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTACCEPT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0 AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.CONFINEDSPACE_ID END ) COUNTANALYZE,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.CONFINEDSPACE_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_CONFINEDSPACE_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.CONFINEDSPACE_ID = f.CONFINEDSPACE_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.CONFINEDSPACE_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_CONFINEDSPACE f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) a,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTCONSTRUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.PRODUCTION_USER_ID = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTPRODUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.SAFETY_USER_ID = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTSAFETY,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.LEADER_USER_ID = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTLEADER,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.BLINDBOARD_ID END ) COUNTACCEPT,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.BLINDBOARD_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.BLINDBOARD_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_BLINDBOARD_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.BLINDBOARD_ID = f.BLINDBOARD_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.BLINDBOARD_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_BLINDBOARD f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) b,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTCONSTRUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.PRODUCTION_USER_ID = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTPRODUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.SAFETY_USER_ID = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTSAFETY,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.LEADER_USER_ID = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTLEADER,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.BREAKGROUND_ID END ) COUNTACCEPT,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.BREAKGROUND_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.BREAKGROUND_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_BREAKGROUND_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.BREAKGROUND_ID = f.BREAKGROUND_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.BREAKGROUND_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_BREAKGROUND f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) c,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTCONSTRUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTLEADER,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTAUDIT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTAPPROVE,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HIGHWORK_ID END ) COUNTACCEPT,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.HIGHWORK_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.HIGHWORK_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_HIGHWORK_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.HIGHWORK_ID = f.HIGHWORK_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.HIGHWORK_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_HIGHWORK f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) d,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.HOISTING_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.LEADER_USER_ID = #{USER_ID} THEN f.HOISTING_ID END ) COUNTLEADER,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.HOISTING_ID END ) COUNTCONSTRUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.HOISTING_ID END ) COUNTAUDIT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HOISTING_ID END ) COUNTAPPROVE,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HOISTING_ID END ) COUNTACCEPT,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.HOISTING_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.HOISTING_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_HOISTING_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.HOISTING_ID = f.HOISTING_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.HOISTING_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_HOISTING f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) e,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONFIRM_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTCONFIRM,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTAUDIT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTAPPROVE,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTACCEPT,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END ) COUNTANALYZE,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '5' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.ELECTRICITY_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '5' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.ELECTRICITY_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '5' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_ELECTRICITY_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.ELECTRICITY_ID = f.ELECTRICITY_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.ELECTRICITY_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_ELECTRICITY f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) f,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
COUNT( CASE WHEN ( f.APPLY_STATUS + 0 ) <![CDATA[ < ]]> 1 AND f.CREATOR = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTBACK,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '1' AND f.CONSTRUCTION_USER_ID = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTCONSTRUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '2' AND f.PRODUCTION_USER_ID = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTPRODUCTION,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '3' AND f.SAFETY_USER_ID = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTSAFETY,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '4' AND f.LEADER_USER_ID = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTLEADER,
|
||||||
|
COUNT( CASE WHEN f.APPLY_STATUS = '5' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.CUTROAD_ID END ) COUNTACCEPT,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.GUARDIAN_USER_ID = #{USER_ID}
|
||||||
|
AND f.GUARDIAN_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.CUTROAD_ID
|
||||||
|
END
|
||||||
|
) COUNTGUARDIAN,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND f.CONFESS_USER_SIGNER_TIME IS NULL THEN
|
||||||
|
f.CUTROAD_ID
|
||||||
|
END
|
||||||
|
) COUNTCONFESS,
|
||||||
|
COUNT(
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN f.APPLY_STATUS <![CDATA[ < ]]> '6' AND f.APPLY_STATUS > 0
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID}
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
GF_CUTROAD_ACCEPTUSER m
|
||||||
|
WHERE
|
||||||
|
m.CUTROAD_ID = f.CUTROAD_ID
|
||||||
|
AND m.CORPINFO_ID = f.CORPINFO_ID
|
||||||
|
AND f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID
|
||||||
|
) THEN
|
||||||
|
f.CUTROAD_ID
|
||||||
|
END
|
||||||
|
) COUNTACCEPTCONFESS
|
||||||
|
FROM
|
||||||
|
GF_CUTROAD f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
) g,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
ifnull( count( DISTINCT h.HOTWORKAPPLICATION_ID ), 0 ) AS HOTWORK_COUNT
|
||||||
|
FROM
|
||||||
|
sys_user f
|
||||||
|
LEFT JOIN bus_hotworkapplicationuser hu ON f.USER_ID = hu.USER_ID
|
||||||
|
LEFT JOIN bus_hotworkapplication h ON hu.FOREIGN_KEY = h.HOTWORKAPPLICATION_ID AND h.ISDELETE = '0'
|
||||||
|
AND h.STATE >= 0
|
||||||
|
AND h.STATE != 11
|
||||||
|
AND hu.STATE = h.STATE
|
||||||
|
WHERE
|
||||||
|
f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
AND
|
||||||
|
f.USER_ID = #{USER_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.USER_ID
|
||||||
|
) h
|
||||||
|
) count15
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -530,6 +530,18 @@
|
||||||
and
|
and
|
||||||
f.CORPINFO_ID = #{CORPINFO_ID}
|
f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="roleLevel != null and roleLevel != ''"><!-- 权限显示 -->
|
||||||
|
<choose>
|
||||||
|
<when test='roleLevel == "0"'>
|
||||||
|
</when>
|
||||||
|
<when test='roleLevel == "1"'>
|
||||||
|
and f.DEPARTMENT_ID in (#{DEPARTMENT_ID})
|
||||||
|
</when>
|
||||||
|
<when test='roleLevel == "2"'>
|
||||||
|
and f.USER_ID = #{USER_ID}
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
<if test="DEPARTMENT_IDS != null and DEPARTMENT_IDS != ''"><!-- 关键词检索 -->
|
<if test="DEPARTMENT_IDS != null and DEPARTMENT_IDS != ''"><!-- 关键词检索 -->
|
||||||
and
|
and
|
||||||
(
|
(
|
||||||
|
|
|
@ -115,8 +115,8 @@
|
||||||
LEFT JOIN mk_gate_area mga ON mga.GATE_AREA_ID = f.ENTRANCESYSCODE
|
LEFT JOIN mk_gate_area mga ON mga.GATE_AREA_ID = f.ENTRANCESYSCODE
|
||||||
WHERE
|
WHERE
|
||||||
mga.LONGITUDE IS NOT NULL
|
mga.LONGITUDE IS NOT NULL
|
||||||
<if test="CROSSTIME != null and CROSSTIME != ''">
|
<if test="eventTime != null and eventTime != ''">
|
||||||
and f.CROSSTIME >= #{CROSSTIME}
|
and f.CROSSTIME >= #{eventTime}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -61,15 +61,14 @@
|
||||||
|
|
||||||
<select id="perpleCount" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData" >
|
<select id="perpleCount" resultType="com.zcloud.entity.PageData" parameterType="com.zcloud.entity.PageData" >
|
||||||
SELECT
|
SELECT
|
||||||
sum( CASE WHEN f.inAndOutType = '1' THEN 1 ELSE 0 END ) AS inCount,
|
sum( CASE WHEN f.devName like '%入%' THEN 1 ELSE 0 END ) AS inCount,
|
||||||
sum( CASE WHEN f.inAndOutType = '0' THEN 1 ELSE 0 END ) AS outCount,
|
sum( CASE WHEN f.devName like '%出%' THEN 1 ELSE 0 END ) AS outCount
|
||||||
sum( CASE WHEN f.inAndOutType = '-1' THEN 1 ELSE 0 END ) AS noCount
|
|
||||||
FROM
|
FROM
|
||||||
mk_gate_person_machine_info f
|
mk_gate_person_machine_info f
|
||||||
LEFT JOIN mk_gate_machine mgm ON f.doorIndexCode = mgm.EQUIPMENTID
|
LEFT JOIN mk_gate_machine mgm ON f.doorIndexCode = mgm.EQUIPMENTID
|
||||||
LEFT JOIN mk_gate_area mga ON mga.GATE_AREA_ID = mgm.GATE_AREA_ID
|
LEFT JOIN mk_gate_area mga ON mga.GATE_AREA_ID = mgm.GATE_AREA_ID
|
||||||
WHERE
|
WHERE
|
||||||
mga.LONGITUDE IS NOT NULL
|
mga.LONGITUDE IS NOT NULL
|
||||||
<if test="eventTime != null and eventTime != ''">
|
<if test="eventTime != null and eventTime != ''">
|
||||||
and f.eventTime >= #{eventTime}
|
and f.eventTime >= #{eventTime}
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue