diff --git a/src/main/java/com/zcloud/service/bus/impl/HiddenServiceImpl.java b/src/main/java/com/zcloud/service/bus/impl/HiddenServiceImpl.java index 797788ba..acedb7da 100644 --- a/src/main/java/com/zcloud/service/bus/impl/HiddenServiceImpl.java +++ b/src/main/java/com/zcloud/service/bus/impl/HiddenServiceImpl.java @@ -727,7 +727,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(zcbZc)){ map.put("zcbZcZs",zcbZc.size()); //总数 List zcbZcWc = zcbZc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = zcbZc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = zcbZc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(zcbZcWc)){ map.put("zcbZcZg",zcbZcWc.size()); map.put("zcbZcWwcZg",zcbZc.size()-zcbZcWc.size()); @@ -751,7 +753,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(xcbZc)){ map.put("xcbZcZs",xcbZc.size()); //总数 List xcbZcWc = xcbZc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = xcbZc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = xcbZc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(xcbZcWc)){ map.put("xcbZcZg",xcbZcWc.size()); map.put("xcbZcWwcZg",xcbZc.size()-xcbZcWc.size()); @@ -775,7 +779,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(bzbZc)){ map.put("bzbZcZs",bzbZc.size()); //总数 List bzbZcWc = bzbZc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = bzbZc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = bzbZc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(bzbZcWc)){ map.put("bzbZcZg",bzbZcWc.size()); map.put("bzbZcWwcZg",bzbZc.size()-bzbZcWc.size()); @@ -803,7 +809,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(zcbGsc)){ map.put("zcbGscZs",zcbGsc.size()); //总数 List zcbGscWc = zcbGsc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = zcbGsc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = zcbGsc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(zcbGscWc)){ map.put("zcbGscZg",zcbGscWc.size()); map.put("zcbGscWwcZg",zcbGsc.size()-zcbGscWc.size()); @@ -827,7 +835,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(xcbGsc)){ map.put("xcbGscZs",xcbGsc.size()); //总数 List xcbGscWc = xcbGsc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = xcbGsc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = xcbGsc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(xcbGscWc)){ map.put("xcbGscZg",xcbGscWc.size()); map.put("xcbGscWwcZg",xcbGsc.size()-xcbGscWc.size()); @@ -851,7 +861,9 @@ public class HiddenServiceImpl implements HiddenService{ if(!Tools.isEmpty(bzbGsc)){ map.put("bzbGscZs",bzbGsc.size()); //总数 List bzbGscWc = bzbGsc.stream().filter(item-> StringUtils.equals("4",item.getString("STATE"))).collect(Collectors.toList()); - int zijin = bzbGsc.stream().mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); + int zijin = bzbGsc.stream() + .filter(item -> item.getString("INVESTMENT_FUNDS").matches("\\d+")) + .mapToInt(item-> Integer.parseInt(item.getString("INVESTMENT_FUNDS"))).sum(); if(!Tools.isEmpty(bzbGscWc)){ map.put("bzbGscZg",bzbGscWc.size()); map.put("bzbGscWwcZg",bzbGsc.size()-bzbGscWc.size()); diff --git a/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml b/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml index ff7eefe4..1fc2a485 100644 --- a/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml @@ -2,19 +2,22 @@ - - - BUS_HIDDEN - + + + BUS_HIDDEN + - - - SYS_DICTIONARIES - + + + SYS_DICTIONARIES + - - - f.SOURCE, + + + f + . + SOURCE + , f.RISK_UNIT, f.IDENTIFICATION, f.RISK_DESCR, @@ -67,11 +70,12 @@ f.POSITIONDESC, f.ISRELEVANT - + - - - SOURCE, + + + SOURCE + , RISK_UNIT, IDENTIFICATION, RISK_DESCR, @@ -122,1111 +126,1141 @@ FINAL_CHECKDESCR, POSITIONDESC, ISRELEVANT - + - - - #{SOURCE}, - #{RISK_UNIT}, - #{IDENTIFICATION}, - #{RISK_DESCR}, - #{RISK_POSITION}, - #{LEVEL}, - #{CHECK_CONTENT}, - #{HIDDENDESCR}, - #{HIDDENPART}, - #{CREATOR}, - #{CREATTIME}, - #{RECTIFYDESCR}, - #{RECTIFICATIONTYPE}, - #{RECTIFICATIONOR}, - #{RECTIFICATIONTIME}, - #{HIDDENLEVEL}, - #{STATE}, - #{CHECKDEPT}, - #{CHECKOR}, - #{CHECKTIME}, - #{CHECKDESCR}, - #{ISQUALIFIED}, - #{ISDELETE}, - #{CORPINFO_ID}, - #{HIDDENFINDDEPT}, - #{RECTIFICATIONDEADLINE}, - #{RECTIFICATIONDEPT}, - #{HIDDEN_ID}, - #{CHECKRECORD_ID}, - #{RECORDITEM_ID}, - #{RISKITEM_ID}, - #{REVIEWOR}, - #{REVIEWTIME}, - #{REVIEWDEPT}, - #{LONGITUDE}, - #{LATITUDE}, - #{HAVESCHEME}, - #{HIDDENTYPE}, - #{ISCONFIRM}, - #{CONFIRM_USER}, - #{DISCOVERYTIME}, - getHiddenType(#{HIDDENTYPE}), - #{INVESTMENT_FUNDS}, - #{LISTMANAGER_ID}, - #{FOREIGN_ID}, - #{FINAL_CHECK}, - #{FINAL_CHECKOR}, - #{FINAL_CHECKTIME}, - #{FINAL_CHECKDESCR}, - #{POSITIONDESC}, - #{ISRELEVANT} - + + + #{SOURCE} + , + #{RISK_UNIT}, + #{IDENTIFICATION}, + #{RISK_DESCR}, + #{RISK_POSITION}, + #{LEVEL}, + #{CHECK_CONTENT}, + #{HIDDENDESCR}, + #{HIDDENPART}, + #{CREATOR}, + #{CREATTIME}, + #{RECTIFYDESCR}, + #{RECTIFICATIONTYPE}, + #{RECTIFICATIONOR}, + #{RECTIFICATIONTIME}, + #{HIDDENLEVEL}, + #{STATE}, + #{CHECKDEPT}, + #{CHECKOR}, + #{CHECKTIME}, + #{CHECKDESCR}, + #{ISQUALIFIED}, + #{ISDELETE}, + #{CORPINFO_ID}, + #{HIDDENFINDDEPT}, + #{RECTIFICATIONDEADLINE}, + #{RECTIFICATIONDEPT}, + #{HIDDEN_ID}, + #{CHECKRECORD_ID}, + #{RECORDITEM_ID}, + #{RISKITEM_ID}, + #{REVIEWOR}, + #{REVIEWTIME}, + #{REVIEWDEPT}, + #{LONGITUDE}, + #{LATITUDE}, + #{HAVESCHEME}, + #{HIDDENTYPE}, + #{ISCONFIRM}, + #{CONFIRM_USER}, + #{DISCOVERYTIME}, + getHiddenType + ( + #{HIDDENTYPE} + ), + #{INVESTMENT_FUNDS}, + #{LISTMANAGER_ID}, + #{FOREIGN_ID}, + #{FINAL_CHECK}, + #{FINAL_CHECKOR}, + #{FINAL_CHECKTIME}, + #{FINAL_CHECKDESCR}, + #{POSITIONDESC}, + #{ISRELEVANT} + - - - insert into - - ( - - ) values ( - - ) - + + + insert into + + ( + + ) values ( + + ) + - - - update - - set - ISDELETE = '1' - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + ISDELETE = '1' + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - - - - - - - - - - - - - - - - - - - - RECTIFICATIONDEADLINE = ##{RECTIFICATIONDEADLINE}, - RECTIFICATIONOR = #{RECTIFICATIONOR}, - RECTIFICATIONDEPT= #{RECTIFICATIONDEPT} - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + + + + + + + + + + + + + + + + + + + + RECTIFICATIONDEADLINE = ##{RECTIFICATIONDEADLINE}, + RECTIFICATIONOR = #{RECTIFICATIONOR}, + RECTIFICATIONDEPT= #{RECTIFICATIONDEPT} + where + HIDDEN_ID = #{HIDDEN_ID} + - - update - - set - STATE = #{STATE} - where - HIDDEN_ID = #{HIDDEN_ID} - + + update + + set + STATE = #{STATE} + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - - RISK_UNIT = #{RISK_UNIT}, - - - IDENTIFICATION = #{IDENTIFICATION}, - - - RISK_DESCR = #{RISK_DESCR}, - - - RISK_POSITION = #{RISK_POSITION}, - - - LEVEL = #{LEVEL}, - - - HIDDENTYPE = #{HIDDENTYPE}, - + + + update + + set + + RISK_UNIT = #{RISK_UNIT}, + + + IDENTIFICATION = #{IDENTIFICATION}, + + + RISK_DESCR = #{RISK_DESCR}, + + + RISK_POSITION = #{RISK_POSITION}, + + + LEVEL = #{LEVEL}, + + + HIDDENTYPE = #{HIDDENTYPE}, + - CHECK_CONTENT = #{CHECK_CONTENT}, - HIDDENDESCR = #{HIDDENDESCR}, - HIDDENPART = #{HIDDENPART}, + CHECK_CONTENT = #{CHECK_CONTENT}, + HIDDENDESCR = #{HIDDENDESCR}, + HIDDENPART = #{HIDDENPART}, - - RECTIFYDESCR = #{RECTIFYDESCR}, - - - CONFIRM_USER = #{CONFIRM_USER}, - - - DISCOVERYTIME = #{DISCOVERYTIME}, - - RECTIFICATIONTYPE = #{RECTIFICATIONTYPE}, - HIDDENLEVEL = #{HIDDENLEVEL}, - CHECKDEPT = #{CHECKDEPT}, - CHECKTIME = #{CHECKTIME}, - CHECKDESCR = #{CHECKDESCR}, - ISQUALIFIED = #{ISQUALIFIED}, - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, - HIDDEN_ID = HIDDEN_ID, - RECTIFICATIONOR = #{RECTIFICATIONOR}, - RECTIFICATIONDEPT= #{RECTIFICATIONDEPT}, - HIDDENTYPE2 = #{HIDDENTYPE2}, - ISRELEVANT = #{ISRELEVANT} - where - HIDDEN_ID = #{HIDDEN_ID} - + + RECTIFYDESCR = #{RECTIFYDESCR}, + + + CONFIRM_USER = #{CONFIRM_USER}, + + + DISCOVERYTIME = #{DISCOVERYTIME}, + + RECTIFICATIONTYPE = #{RECTIFICATIONTYPE}, + HIDDENLEVEL = #{HIDDENLEVEL}, + CHECKDEPT = #{CHECKDEPT}, + CHECKTIME = #{CHECKTIME}, + CHECKDESCR = #{CHECKDESCR}, + ISQUALIFIED = #{ISQUALIFIED}, + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, + HIDDEN_ID = HIDDEN_ID, + RECTIFICATIONOR = #{RECTIFICATIONOR}, + RECTIFICATIONDEPT= #{RECTIFICATIONDEPT}, + HIDDENTYPE2 = #{HIDDENTYPE2}, + ISRELEVANT = #{ISRELEVANT} + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - - POSITIONDESC = #{POSITIONDESC} - - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + + POSITIONDESC = #{POSITIONDESC} + + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - - FOREIGN_ID = #{INSPECTION_ID}, - - - HIDDENDESCR = #{HIDDENDESCR}, - - - HIDDENPART = #{HIDDENPART}, - - - HIDDENLEVEL = #{HIDDENLEVEL}, - - - HIDDENTYPE = #{HIDDENTYPE}, - - - LONGITUDE = #{LONGITUDE}, - - - LATITUDE = #{LATITUDE}, - - - DISCOVERYTIME = #{DISCOVERYTIME}, - - - HIDDENFINDDEPT = #{HIDDENFINDDEPT}, - - - CREATOR = #{CREATOR}, - - - SOURCE = #{SOURCE}, - - - STATE = #{STATE}, - - - ISDELETE = #{ISDELETE}, - - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + + FOREIGN_ID = #{INSPECTION_ID}, + + + HIDDENDESCR = #{HIDDENDESCR}, + + + HIDDENPART = #{HIDDENPART}, + + + HIDDENLEVEL = #{HIDDENLEVEL}, + + + HIDDENTYPE = #{HIDDENTYPE}, + + + LONGITUDE = #{LONGITUDE}, + + + LATITUDE = #{LATITUDE}, + + + DISCOVERYTIME = #{DISCOVERYTIME}, + + + HIDDENFINDDEPT = #{HIDDENFINDDEPT}, + + + CREATOR = #{CREATOR}, + + + SOURCE = #{SOURCE}, + + + STATE = #{STATE}, + + + ISDELETE = #{ISDELETE}, + + where + HIDDEN_ID = #{HIDDEN_ID} + - - update - - set - STATE = #{STATE} - - ,FINAL_CHECK = null - - - ,RECTIFYDESCR = null - ,RECTIFICATIONTIME = null - - where - HIDDEN_ID = #{HIDDEN_ID} - - - update - - set - ISCONFIRM = #{ISCONFIRM}, - RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, - RECTIFICATIONOR = #{RECTIFICATIONOR}, - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} - where - HIDDEN_ID = #{HIDDEN_ID} - - - update - - set - HIDDENLEVEL = #{HIDDENLEVEL} - where - HIDDEN_ID = #{HIDDEN_ID} - + + update + + set + STATE = #{STATE} + + ,FINAL_CHECK = null + + + ,RECTIFYDESCR = null + ,RECTIFICATIONTIME = null + + where + HIDDEN_ID = #{HIDDEN_ID} + + + update + + set + ISCONFIRM = #{ISCONFIRM}, + RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, + RECTIFICATIONOR = #{RECTIFICATIONOR}, + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} + where + HIDDEN_ID = #{HIDDEN_ID} + + + update + + set + HIDDENLEVEL = #{HIDDENLEVEL} + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - STATE = (case RECTIFICATIONTYPE when '2' then '-2' when '1' then '-2' end) - where - CHECKRECORD_ID = #{CHECKRECORD_ID} and ISDELETE = '0' - + + + update + + set + STATE = (case RECTIFICATIONTYPE when '2' then '-2' when '1' then '-2' end) + where + CHECKRECORD_ID = #{CHECKRECORD_ID} and ISDELETE = '0' + - - - update - - set - STATE = (case RECTIFICATIONTYPE when '2' then '-2' when '1' then '-2' end) - - , CHECKRECORD_ID = #{CHECKRECORD_ID} - - where - LISTMANAGER_ID = #{LISTMANAGER_ID} - and ( - RECORDITEM_ID is null or RECORDITEM_ID = '' - ) - and ( - RISKITEM_ID is null or RISKITEM_ID = '' - ) - and ISDELETE = '0' - and STATE = '0' - + + + update + + set + STATE = (case RECTIFICATIONTYPE when '2' then '-2' when '1' then '-2' end) + + , CHECKRECORD_ID = #{CHECKRECORD_ID} + + where + LISTMANAGER_ID = #{LISTMANAGER_ID} + and ( + RECORDITEM_ID is null or RECORDITEM_ID = '' + ) + and ( + RISKITEM_ID is null or RISKITEM_ID = '' + ) + and ISDELETE = '0' + and STATE = '0' + - - - - update - - set - RECTIFYDESCR = #{RECTIFYDESCR}, - RECTIFICATIONTIME = #{RECTIFICATIONTIME}, - - - HAVESCHEME = #{HAVESCHEME}, - INVESTMENT_FUNDS = #{INVESTMENT_FUNDS}, - STATE = #{STATE} - where - HIDDEN_ID = #{HIDDEN_ID} - - - - update - - set - - - STATE = '3', - REVIEWTIME = #{REVIEWTIME}, - CHECKDEPT = #{CHECKDEPT} - - - STATE = '1', - RECTIFYDESCR = null, - RECTIFICATIONTIME = null, - REJECTREASON = #{REJECTREASON}, - HAVESCHEME = null - - - where - HIDDEN_ID = #{HIDDEN_ID} - - - - update - - set - - CHECKTIME = #{CHECKTIME}, - - - STATE = '4' - where - HIDDEN_ID = #{HIDDEN_ID} - + + + + update + + set + RECTIFYDESCR = #{RECTIFYDESCR}, + RECTIFICATIONTIME = #{RECTIFICATIONTIME}, + + + HAVESCHEME = #{HAVESCHEME}, + INVESTMENT_FUNDS = #{INVESTMENT_FUNDS}, + STATE = #{STATE} + where + HIDDEN_ID = #{HIDDEN_ID} + + + + update + + set + + + STATE = '3', + REVIEWTIME = #{REVIEWTIME}, + CHECKDEPT = #{CHECKDEPT} + + + STATE = '1', + RECTIFYDESCR = null, + RECTIFICATIONTIME = null, + REJECTREASON = #{REJECTREASON}, + HAVESCHEME = null + + + where + HIDDEN_ID = #{HIDDEN_ID} + + + + update + + set + + CHECKTIME = #{CHECKTIME}, + + + STATE = '4' + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - FINAL_CHECK = #{FINAL_CHECK}, - FINAL_CHECKOR = #{FINAL_CHECKOR}, - FINAL_CHECKTIME = #{FINAL_CHECKTIME}, - FINAL_CHECKDESCR = #{FINAL_CHECKDESCR} - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + FINAL_CHECK = #{FINAL_CHECK}, + FINAL_CHECKOR = #{FINAL_CHECKOR}, + FINAL_CHECKTIME = #{FINAL_CHECKTIME}, + FINAL_CHECKDESCR = #{FINAL_CHECKDESCR} + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - f - set - STATE = '-1' - where - f.RECTIFICATIONDEADLINE != '' - and - DATE_FORMAT( f.RECTIFICATIONDEADLINE,'%Y-%m-%d') < DATE_FORMAT( NOW(),'%Y-%m-%d') - and - f.ISDELETE = '0' - and - f.STATE = '1' - + + + update + + f + set + STATE = '-1' + where + f.RECTIFICATIONDEADLINE != '' + and + DATE_FORMAT( f.RECTIFICATIONDEADLINE,'%Y-%m-%d') < DATE_FORMAT( NOW(),'%Y-%m-%d') + and + f.ISDELETE = '0' + and + f.STATE = '1' + - - - UPDATE - f - SET f.STATE = '1' - WHERE - f.RECTIFICATIONDEADLINE is not null - AND f.RECTIFICATIONDEADLINE != '' - AND DATE_FORMAT( f.RECTIFICATIONDEADLINE,'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d') - AND f.ISDELETE = '0' - AND f.STATE = '-1' - + + + UPDATE + + f + SET f.STATE = '1' + WHERE + f.RECTIFICATIONDEADLINE is not null + AND f.RECTIFICATIONDEADLINE != '' + AND DATE_FORMAT( f.RECTIFICATIONDEADLINE,'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d') + AND f.ISDELETE = '0' + AND f.STATE = '-1' + - - - - - - + select + , + cr.NAME CREATORNAME, + re.NAME RECTIFICATIONORNAME, + ch.NAME CHECKORNAME, + crd.NAME HIDDENFINDDEPTNAME, + red.NAME RECTIFICATIONDEPTNAME, + chd.NAME CHECKDEPTNAME, + lv.NAME HIDDENLEVELNAME, + bc.LIST_NAME, + lv.NAME HIDDENLEVELNAME, + ht.NAME HIDDENTYPENAME, + hiddenType2.NAME HIDDENTYPENAME2, + conUser.NAME as conUserName, + hregion.HIDDENREGION as hregionName, + hregionDept.NAME as hregionDeptName, + hregion.HIDDENREGION as hregionName, + od.DEPARTMENT_ID as confirmDept, + fc.NAME FINAL_CHECKOR_NAME, + isa.INSPECTION_ASSESS_ID, + siu.NAME as acceptName, + isa.ASSESS_SCORE, + isa.ASSESS_PENALTY_AMOUNT + from + + f + left join vi_user_all cr on cr.USER_ID = f.CREATOR + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join sys_user ch on ch.USER_ID = f.CHECKOR + left join sys_user conUser on conUser.USER_ID = f.CONFIRM_USER + left join vi_department_all crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT + left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT + left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT + left join bus_checkrecord bc on bc.CHECKRECORD_ID = f.CHECKRECORD_ID and bc.ISDELETE = 0 + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join ht on f.HIDDENTYPE = ht.BIANMA + left join hiddenType2 on f.HIDDENTYPE2 = + hiddenType2.BIANMA + left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART + left join oa_department hregionDept on hregionDept.DEPARTMENT_ID = conUser.DEPARTMENT_ID + left join sys_user su on su.USER_ID = f.CONFIRM_USER + left join oa_department od on od.DEPARTMENT_ID = su.DEPARTMENT_ID + LEFT JOIN vi_user_all fc ON fc.USER_ID = f.FINAL_CHECKOR + LEFT JOIN vi_user_all siu ON siu.USER_ID = f.CHECKOR + LEFT JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL_ASSESS isa ON isa.HIDDEN_ID = f.HIDDEN_ID and isa.ISDELETE = '0' + where + f.HIDDEN_ID = #{HIDDEN_ID} + group by f.HIDDEN_ID + + + + + + + + + and + f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + and + f.STATE = #{pd.STATE} + + + + + + + and f.SOURCE = '1' + + + and f.SOURCE = '2' + + + and f.SOURCE = '4' + + + and f.SOURCE = '5' + + + and f.SOURCE = '6' + + + + + + and + TO_DAYS(f.CREATTIME) = TO_DAYS(NOW()) + + + and + YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d'),1) = YEARWEEK(NOW(),1) + + + + and f.CREATTIME >= #{pd.STARTTIME} + + + and f.CREATTIME <= #{pd.ENDTIME} + + + + and + DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') + + + and f.CREATTIME BETWEEN #{pd.STARTTIME} and #{pd.ENDTIME} + + + and + YEAR(f.CREATTIME)=YEAR(NOW()) + + + + + and f.STATE != '0' + + + and f.STATE != '4' + + + and f.STATE = '4' + + + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.HIDDENFIND_NAME}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + group by f.hidden_id + order by f.STATE ='16' desc, f.CREATTIME desc + - + select + , + cr.NAME CREATORNAME, + re.NAME RECTIFICATIONORNAME, + ch.NAME CHECKORNAME, + rev.NAME REVIEWORNAME, + crd.NAME HIDDENFINDDEPTNAME, + red.PARENT_ID PID_DEPT_ID, + red.NAME RECTIFICATIONDEPTNAME, + chd.NAME CHECKDEPTNAME, + lv.NAME HIDDENLEVELNAME, + sys.NAME HIDDENTYPENAME, + bh.HIDDENREGION as HIDDENPARTNAME, + conUser.NAME as conUserName, + (select group_concat(chr.NAME) from BUS_HIDDENCHECK bh left join sys_user chr on chr.USER_ID=bh.USER_ID where + bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKNAME + from + + f + left join `qa-cmt-prevention`.`vi_user_all` cr on cr.USER_ID = f.CREATOR + left join `qa-cmt-prevention`.`vi_user_all` re on re.USER_ID = f.RECTIFICATIONOR + left join `qa-cmt-prevention`.`vi_user_all` ch on ch.USER_ID = f.CHECKOR + left join `qa-cmt-prevention`.`vi_user_all` rev on rev.USER_ID = f.REVIEWOR + left join `qa-cmt-prevention`.`vi_user_all` conUser on conUser.USER_ID = f.CONFIRM_USER + left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT + left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT + left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT + left join bus_hiddenregion bh on bh.HIDDENREGION_ID = f.HIDDENPART + left join + + lv + on f.HIDDENLEVEL = lv.BIANMA + left join + + sys + on f.HIDDENTYPE = sys.BIANMA + where f.ISDELETE = '0' and f.STATE != '0' + and f.STATE not in ('5','7','8','100','101','102') + and f.HIDDENLEVEL != 'hiddenLevel2002' and f.HIDDENLEVEL != 'hiddenLevel1001' and f.HIDDENLEVEL != 'jdyh001' + + and f.SOURCE=#{SOURCE} + + + and f.CHECKRECORD_ID is null + + + and f.CORPINFO_ID = #{CORPINFO_ID} + - - and f.CHECKRECORD_ID=#{CHECKRECORD_ID} - - - and - ( - f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - ) - - - and ( - f.HIDDEN_ID in(select fh.HIDDEN_ID from bus_hidden_user fh where fh.USER_ID = #{queryUserId} - or f.CONFIRM_USER = #{queryUserId} - or f.RECTIFICATIONOR = #{queryUserId} - or f.HIDDEN_ID in(select ch.HIDDEN_ID from bus_hiddencheck ch where ch.USER_ID = #{queryUserId}) - )) - - - and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%') - - - and f.ISQUALIFIED = #{ISQUALIFIED} - - - and f.HIDDENFINDDEPT = #{DEPARTMENT_ID} - - - and f.HIDDENLEVEL = #{HIDDENLEVEL} - - - and f.DISCOVERYTIME = ]]> CONCAT_WS(' ', #{STARTTIME}, '00:00') - - - and f.DISCOVERYTIME CONCAT_WS(' ', #{ENDTIME}, '00:00') - - - and f.STATE = #{STATE} - - - and f.CREATOR = #{SELF_USER_ID} - - - - and f.RECTIFICATIONOR = #{SELFUSERID} - and f.STATE in('1','-1') - - - and f.STATE = '3' - and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID and bh.STATUS=0)>0 - - - and f.STATE = '4' - and (f.RECTIFICATIONOR = #{SELFUSERID} or f.CREATOR = #{SELFUSERID} or (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID)>0) - - - - and - f.CORPINFO_ID = #{CORPINFO_ID} - - - and - f.STATE = #{STATE} - - - - - and - ( - f.HIDDEN_ID in - - #{item} - - ) - - order by f.STATE ,f.CREATTIME desc - + + and f.CHECKRECORD_ID=#{CHECKRECORD_ID} + + + and + ( + f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + ) + + + and ( + f.HIDDEN_ID in(select fh.HIDDEN_ID from bus_hidden_user fh where fh.USER_ID = #{queryUserId} + or f.CONFIRM_USER = #{queryUserId} + or f.RECTIFICATIONOR = #{queryUserId} + or f.HIDDEN_ID in(select ch.HIDDEN_ID from bus_hiddencheck ch where ch.USER_ID = #{queryUserId}) + )) + + + and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%') + + + and f.ISQUALIFIED = #{ISQUALIFIED} + + + and f.HIDDENFINDDEPT = #{DEPARTMENT_ID} + + + and f.HIDDENLEVEL = #{HIDDENLEVEL} + + + and f.DISCOVERYTIME = ]]> CONCAT_WS(' ', #{STARTTIME}, '00:00') + + + and f.DISCOVERYTIME CONCAT_WS(' ', #{ENDTIME}, '00:00') + + + and f.STATE = #{STATE} + + + and f.CREATOR = #{SELF_USER_ID} + + + + and f.RECTIFICATIONOR = #{SELFUSERID} + and f.STATE in('1','-1') + + + and f.STATE = '3' + and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID + and bh.STATUS=0)>0 + + + and f.STATE = '4' + and (f.RECTIFICATIONOR = #{SELFUSERID} or f.CREATOR = #{SELFUSERID} or (select count(1) from + BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID)>0) + + + + and + f.CORPINFO_ID = #{CORPINFO_ID} + + + and + f.STATE = #{STATE} + + + + + and + ( + f.HIDDEN_ID in + + #{item} + + ) + + order by f.STATE ,f.CREATTIME desc + - + select + , + cr.NAME CREATORNAME, + re.NAME RECTIFICATIONORNAME, + ch.NAME CHECKORNAME, + rev.NAME REVIEWORNAME, + crd.NAME HIDDENFINDDEPTNAME, + red.NAME RECTIFICATIONDEPTNAME, + chd.NAME CHECKDEPTNAME, + lv.NAME HIDDENLEVELNAME, + ( SELECT max( bh.CHECK_TIME ) FROM BUS_HIDDENCHECK bh WHERE bh.HIDDEN_ID = f.HIDDEN_ID ) CHECK_TIME, + (select group_concat(chr.NAME) from BUS_HIDDENCHECK bh left join sys_user chr on chr.USER_ID=bh.USER_ID where + bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKNAME + from + + f + left join sys_user cr on cr.USER_ID = f.CREATOR + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join sys_user ch on ch.USER_ID = f.CHECKOR + left join sys_user rev on rev.USER_ID = f.REVIEWOR + left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT + left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT + left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT + left join + + lv + on f.HIDDENLEVEL = lv.BIANMA + where f.ISDELETE = '0' and f.STATE != '0' + + and f.SOURCE=#{SOURCE} + + + and f.CHECKRECORD_ID is null + + + and f.CORPINFO_ID = #{CORPINFO_ID} + - - and f.CHECKRECORD_ID=#{CHECKRECORD_ID} - - - and - ( - f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - or - f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') - ) - - - and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%') - - - and f.ISQUALIFIED = #{ISQUALIFIED} - - - and f.HIDDENFINDDEPT = #{DEPARTMENT_ID} - - - and f.HIDDENLEVEL = #{HIDDENLEVEL} - - - and f.CREATTIME >= #{STARTTIME} - - - and f.CREATTIME <= #{ENDTIME} - - - and f.STATE = #{STATE} - - - and f.CREATOR = #{SELF_USER_ID} - - - - and f.RECTIFICATIONOR = #{SELFUSERID} - and f.STATE in('1','-1') - - - and f.STATE = '3' - and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID and bh.STATUS=0)>0 - - - and f.STATE = '4' - and (f.RECTIFICATIONOR = #{SELFUSERID} or f.CREATOR = #{SELFUSERID} or (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID)>0) - - - - and - f.CORPINFO_ID = #{CORPINFO_ID} - - - and - f.STATE = #{STATE} - - - - - and - ( - f.HIDDEN_ID in - - #{item} - - ) - - order by f.CREATTIME desc - + + and f.CHECKRECORD_ID=#{CHECKRECORD_ID} + + + and + ( + f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + ) + + + and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%') + + + and f.ISQUALIFIED = #{ISQUALIFIED} + + + and f.HIDDENFINDDEPT = #{DEPARTMENT_ID} + + + and f.HIDDENLEVEL = #{HIDDENLEVEL} + + + and f.CREATTIME >= #{STARTTIME} + + + and f.CREATTIME <= #{ENDTIME} + + + and f.STATE = #{STATE} + + + and f.CREATOR = #{SELF_USER_ID} + + + + and f.RECTIFICATIONOR = #{SELFUSERID} + and f.STATE in('1','-1') + + + and f.STATE = '3' + and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID + and bh.STATUS=0)>0 + + + and f.STATE = '4' + and (f.RECTIFICATIONOR = #{SELFUSERID} or f.CREATOR = #{SELFUSERID} or (select count(1) from + BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID)>0) + + + + and + f.CORPINFO_ID = #{CORPINFO_ID} + + + and + f.STATE = #{STATE} + + + + + and + ( + f.HIDDEN_ID in + + #{item} + + ) + + order by f.CREATTIME desc + - - - update - - set - ISDELETE = '1' - where - HIDDEN_ID in - - #{item} - - + + + update + + set + ISDELETE = '1' + where + HIDDEN_ID in + + #{item} + + - - - update - - set - CHECKRECORD_ID = #{CHECKRECORD_ID}, - STATE = '0' - where - HIDDEN_ID in - - #{item} - - + + + update + + set + CHECKRECORD_ID = #{CHECKRECORD_ID}, + STATE = '0' + where + HIDDEN_ID in + + #{item} + + - - SELECT - d.date,IFNULL(f.count,0) as count - FROM - v_dates d - left join (SELECT - DATE_FORMAT( t.CREATTIME, '%Y-%m-%d') AS CREATTIME, - count(1) as count - FROM - BUS_HIDDEN t - WHERE t.ISDELETE = '0' and t.STATE != '0' and - t.HIDDENLEVEL = #{HIDDENLEVEL} and t.CORPINFO_ID=#{CORPINFO_ID} - - and - t.CREATOR = #{USER_ID} - - GROUP BY - DATE_FORMAT( t.CREATTIME, '%Y-%m-%d') ) f on f.CREATTIME = d.date - WHERE - d.date BETWEEN #{START_DAY} AND #{END_DAY} - ORDER BY - d.date desc - + d.date,IFNULL(f.count,0) as count + FROM + v_dates d + left join (SELECT + DATE_FORMAT( t.CREATTIME, '%Y-%m-%d') AS CREATTIME, + count(1) as count + FROM + BUS_HIDDEN t + WHERE t.ISDELETE = '0' and t.STATE != '0' and + t.HIDDENLEVEL = #{HIDDENLEVEL} and t.CORPINFO_ID=#{CORPINFO_ID} + + and + t.CREATOR = #{USER_ID} + + GROUP BY + DATE_FORMAT( t.CREATTIME, '%Y-%m-%d') ) f on f.CREATTIME = d.date + WHERE + d.date BETWEEN #{START_DAY} AND #{END_DAY} + ORDER BY + d.date desc + - - SELECT - t.STATE, - count(1) as count - FROM - BUS_HIDDEN t - WHERE - t.CORPINFO_ID=#{CORPINFO_ID} and t.ISDELETE = '0' and t.STATE != '0' - - and - t.CREATOR = #{USER_ID} - - GROUP BY - t.STATE - - - + + - - + + + - - + SELECT + f.CREATOR,f.STATE + FROM + BUS_HIDDEN f + WHERE f.ISDELETE = '0' and f.STATE != '0' + - - and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID )>0 - - - and f.CORPINFO_ID =#{CORPINFO_ID} - - + + and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID )>0 + + + and f.CORPINFO_ID =#{CORPINFO_ID} + + - - + + - - + + - - + SELECT + + FROM + BUS_HIDDEN f + WHERE f.ISDELETE = '0' and f.STATE != '0' and f.STATE != '16' and f.STATE != '100' + + and f.CORPINFO_ID =#{CORPINFO_ID} + - - and f.CREATOR =#{userId} - - - and - TO_DAYS(f.CREATTIME) = TO_DAYS(NOW()) - - - and - YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d'),1) = YEARWEEK(NOW(),1) - - - - and f.CREATTIME >= #{STARTTIME} - - - and f.CREATTIME <= #{ENDTIME} - - - - and - DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') - - - and f.CREATTIME BETWEEN #{STARTTIME} and #{ENDTIME} - - - and - YEAR(f.CREATTIME)=YEAR(NOW()) - - + + and f.CREATOR =#{userId} + + + and + TO_DAYS(f.CREATTIME) = TO_DAYS(NOW()) + + + and + YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d'),1) = YEARWEEK(NOW(),1) + + + + and f.CREATTIME >= #{STARTTIME} + + + and f.CREATTIME <= #{ENDTIME} + + + + and + DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') + + + and f.CREATTIME BETWEEN #{STARTTIME} and #{ENDTIME} + + + and + YEAR(f.CREATTIME)=YEAR(NOW()) + + - - + SELECT + + FROM + BUS_HIDDEN f + WHERE f.ISDELETE = '0' + and f.SOURCE = '3' + + and + f.STATE = #{STATE} + + + and + f.CREATOR = #{USER_ID} + + + and + f.LISTMANAGER_ID = #{LISTMANAGER_ID} + + + and + f.CHECKRECORD_ID = #{CHECKRECORD_ID} + + + and + TO_DAYS(f.CREATTIME) = TO_DAYS(NOW()) + + + and + YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d')) = YEARWEEK(NOW()) + + + + and f.CREATTIME >= #{BEGINTIME} + + + and f.CREATTIME <= #{ENDTIME} + + - - and - DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') - - - and - QUARTER(f.CREATTIME) = QUARTER(NOW()) - - - AND - CONVERT(concat(DATE_FORMAT(f.CREATTIME, '%Y'), INTERVAL(CONVERT(MONTH(f.CREATTIME),SIGNED),7,13) ),SIGNED) = - CONVERT(concat(DATE_FORMAT(NOW(), '%Y'), INTERVAL(CONVERT(MONTH(NOW()),SIGNED),7,13) ),SIGNED) - - - and - YEAR(f.CREATTIME)=YEAR(NOW()) - - ORDER BY f.CREATTIME - + + and + DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') + + + and + QUARTER(f.CREATTIME) = QUARTER(NOW()) + + + AND + CONVERT(concat(DATE_FORMAT(f.CREATTIME, '%Y'), INTERVAL(CONVERT(MONTH(f.CREATTIME),SIGNED),7,13) ),SIGNED) = + CONVERT(concat(DATE_FORMAT(NOW(), '%Y'), INTERVAL(CONVERT(MONTH(NOW()),SIGNED),7,13) ),SIGNED) + + + and + YEAR(f.CREATTIME)=YEAR(NOW()) + + ORDER BY f.CREATTIME + - - + + - - - - update - - set - STATE = #{STATE}, - CONFIRM_USER = #{CONFIRM_USER}, - CONFIRM_TIME = #{CONFIRM_TIME}, - RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, - RECTIFICATIONOR = #{RECTIFICATIONOR}, - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, - HIDDENLEVEL = #{HIDDENLEVEL} - - ,CHECKOR = #{CHECKOR} - - - ,CHECKDEPT = #{CHECKDEPT} - - - ,CHECKTIME = #{CHECKTIME} - - - ,RECTIFICATIONTYPE = #{RECTIFICATIONTYPE} - - where - HIDDEN_ID = #{HIDDEN_ID} - - - - update - - set - - RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, - - - RECTIFICATIONOR = #{RECTIFICATIONOR}, - - - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, - - - CONFIRM_USER = #{CONFIRM_USER}, - - - CONFIRM_TIME = #{CONFIRM_TIME}, - - - STATE = #{STATE}, - - - HIDDENLEVEL = #{HIDDENLEVEL} - - where - HIDDEN_ID = #{HIDDEN_ID} - + + + + update + + set + STATE = #{STATE}, + CONFIRM_USER = #{CONFIRM_USER}, + CONFIRM_TIME = #{CONFIRM_TIME}, + RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, + RECTIFICATIONOR = #{RECTIFICATIONOR}, + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, + HIDDENLEVEL = #{HIDDENLEVEL} + + ,CHECKOR = #{CHECKOR} + + + ,CHECKDEPT = #{CHECKDEPT} + + + ,CHECKTIME = #{CHECKTIME} + + + ,RECTIFICATIONTYPE = #{RECTIFICATIONTYPE} + + where + HIDDEN_ID = #{HIDDEN_ID} + + + + update + + set + + RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, + + + RECTIFICATIONOR = #{RECTIFICATIONOR}, + + + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, + + + CONFIRM_USER = #{CONFIRM_USER}, + + + CONFIRM_TIME = #{CONFIRM_TIME}, + + + STATE = #{STATE}, + + + HIDDENLEVEL = #{HIDDENLEVEL} + + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - STATE = #{STATE} - where - HIDDEN_ID = #{HIDDEN_ID} - - - + select + f.* + ,lv.NAME HIDDENLEVELNAME + ,re.NAME as RECTIFICATIONORNAME + ,confirmUser.NAME as confirmUserName + ,hiddenType.NAME as hiddenTypeName + ,hiddenType2.NAME as hiddenTypeName2 + ,hregion.HIDDENREGION as hregionName + ,(select count(1) from BUS_HIDDENEXAMINE eax where eax.HIDDEN_ID = f.HIDDEN_ID and eax.STATE = '-1') as exaCount + from + + f + LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join hiddenType on f.HIDDENTYPE = hiddenType.BIANMA + left join hiddenType2 on f.HIDDENTYPE2 = + hiddenType2.BIANMA + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART + left join bus_listmanager list on list.LISTMANAGER_ID = f.LISTMANAGER_ID + LEFT JOIN bus_hiddencheck hch on hch.HIDDEN_ID = f.HIDDEN_ID + left join bus_hidden_user bhu on bhu.HIDDEN_ID = f.HIDDEN_ID + + left JOIN (select USER_ID from sys_USER where DEPARTMENT_ID in(${pd.ArrayDATA_IDS})) userfind on + userfind.USER_ID = f.CREATOR + + where f.ISDELETE = '0' - - - - - - and (confirmUser.DEPARTMENT_ID in (${pd.supDeparIds}) or bhu.DEPARTMENT_ID in (${pd.supDeparIds}) or f.RECTIFICATIONDEPT in (${pd.supDeparIds}) or hch.DEPARTMENT_ID in (${pd.supDeparIds})) - - - and (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) - - - - and f.state not in ('0' ,'100','101','10') - and f.HIDDENLEVEL not in('hiddenLevel2002','jdyh001') - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - and f.state = '-2' - - - and f.state != '-2' - - - - and f.SOURCE in ('2','3') - - - and f.SOURCE = #{pd.keySource} - - - - and f.SOURCE in ('2','3') - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) - - - and f.HIDDENTYPE = #{pd.keyHiddenType} - - - and f.HIDDENTYPE2 = #{pd.keyHiddenType2} - - - and f.HIDDENPART = #{pd.keyHiddenPart} - - - and f.HIDDENLEVEL = #{pd.keyHiddenlevel} - - - and f.CONFIRM_USER = #{pd.CONFIRM_USER} - - - - - - and f.DISCOVERYTIME >= #{pd.STARTTIME} - - - and f.DISCOVERYTIME <= #{pd.ENDTIME} - + + + + + + and (confirmUser.DEPARTMENT_ID in (${pd.supDeparIds}) or bhu.DEPARTMENT_ID in (${pd.supDeparIds}) or + f.RECTIFICATIONDEPT in (${pd.supDeparIds}) or hch.DEPARTMENT_ID in (${pd.supDeparIds})) + + + and (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = + #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) + + + + and f.state not in ('0' ,'100','101','10') + and f.HIDDENLEVEL not in('hiddenLevel2002','jdyh001') + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + and f.state = '-2' + + + and f.state != '-2' + + + + and f.SOURCE in ('2','3') + + + and f.SOURCE = #{pd.keySource} + + + + and f.SOURCE in ('2','3') + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + + and f.HIDDENTYPE = #{pd.keyHiddenType} + + + and f.HIDDENTYPE2 = #{pd.keyHiddenType2} + + + and f.HIDDENPART = #{pd.keyHiddenPart} + + + and f.HIDDENLEVEL = #{pd.keyHiddenlevel} + + + and f.CONFIRM_USER = #{pd.CONFIRM_USER} + + + + + + and f.DISCOVERYTIME >= #{pd.STARTTIME} + + + and f.DISCOVERYTIME <= #{pd.ENDTIME} + - - - - - - and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - - - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) - - - and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex - where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) - - - and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} - - + + + + and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) + + + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or + lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + + + and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex + where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) + + + and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} + + - group by f.HIDDEN_ID - order by FIELD ( f.STATE, '1', '7','-2', '11', '12', '13', '14', '15', '101', '102' ) desc, - f.STATE + 0 asc, - f.CREATTIME desc - + group by f.HIDDEN_ID + order by FIELD ( f.STATE, '1', '7','-2', '11', '12', '13', '14', '15', '101', '102' ) desc, + f.STATE + 0 asc, + f.CREATTIME desc + - - + select + f.* + ,lv.NAME HIDDENLEVELNAME + ,re.NAME as RECTIFICATIONORNAME + ,confirmUser.NAME as confirmUserName + ,hiddenType.NAME as hiddenTypeName + ,hiddenType2.NAME as hiddenTypeName2 + ,hregion.HIDDENREGION as hregionName + ,(select count(1) from BUS_HIDDENEXAMINE eax where eax.HIDDEN_ID = f.HIDDEN_ID and eax.STATE = '-1') as exaCount + from + + f + LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join hiddenType on f.HIDDENTYPE = hiddenType.BIANMA + left join hiddenType2 on f.HIDDENTYPE2 = + hiddenType2.BIANMA + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART + left join bus_listmanager list on list.LISTMANAGER_ID = f.LISTMANAGER_ID + left join bus_hidden_user bhu on bhu.HIDDEN_ID = f.HIDDEN_ID + + left JOIN (select USER_ID from sys_USER where DEPARTMENT_ID in(${pd.ArrayDATA_IDS})) userfind on + userfind.USER_ID = f.CREATOR + + LEFT JOIN bus_hiddencheck hch on hch.HIDDEN_ID = f.HIDDEN_ID + where f.ISDELETE = '0' + + + + + + and (confirmUser.DEPARTMENT_ID in (${pd.supDeparIds}) or bhu.DEPARTMENT_ID in (${pd.supDeparIds}) or + f.RECTIFICATIONDEPT in (${pd.supDeparIds}) or hch.DEPARTMENT_ID in (${pd.supDeparIds})) + + + and (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = + #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) + + + - and f.state not in ('0') - and f.state >= '4' - and f.HIDDENLEVEL not in('hiddenLevel2002','jdyh001') - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - - and f.SOURCE in ('2','3') - - - and f.SOURCE = #{pd.keySource} - - - - and f.SOURCE in ('2','3') - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) - - - and f.HIDDENTYPE = #{pd.keyHiddenType} - - - and f.HIDDENTYPE2 = #{pd.keyHiddenType2} - - - and f.HIDDENPART = #{pd.keyHiddenPart} - - - and f.HIDDENLEVEL = #{pd.keyHiddenlevel} - - - and (f.CONFIRM_USER = #{pd.CONFIRM_USER} or f.CREATOR = #{pd.CONFIRM_USER} or bhu.USER_ID = #{pd.CONFIRM_USER}) - + and f.state not in ('0') + and f.state >= '4' + and f.HIDDENLEVEL not in('hiddenLevel2002','jdyh001') + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + + and f.SOURCE in ('2','3') + + + and f.SOURCE = #{pd.keySource} + + + + and f.SOURCE in ('2','3') + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + + and f.HIDDENTYPE = #{pd.keyHiddenType} + + + and f.HIDDENTYPE2 = #{pd.keyHiddenType2} + + + and f.HIDDENPART = #{pd.keyHiddenPart} + + + and f.HIDDENLEVEL = #{pd.keyHiddenlevel} + + + and (f.CONFIRM_USER = #{pd.CONFIRM_USER} or f.CREATOR = #{pd.CONFIRM_USER} or bhu.USER_ID = + #{pd.CONFIRM_USER}) + - - and f.DISCOVERYTIME >= #{pd.STARTTIME} - - - and f.DISCOVERYTIME <= #{pd.ENDTIME} - - - and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - - - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) - - - and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex - where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) - - - and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} - - group by f.HIDDEN_ID - order by f.CREATTIME desc,f.STATE + 0 asc - + + and f.DISCOVERYTIME >= #{pd.STARTTIME} + + + and f.DISCOVERYTIME <= #{pd.ENDTIME} + + + and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) + + + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or + lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + + + and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex + where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) + + + and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} + + group by f.HIDDEN_ID + order by f.CREATTIME desc,f.STATE + 0 asc + - - + select + f.* + ,lv.NAME HIDDENLEVELNAME + ,re.NAME as RECTIFICATIONORNAME + ,confirmUser.NAME as confirmUserName + ,hiddenType.NAME as hiddenTypeName + ,hiddenType2.NAME as hiddenTypeName2 + ,hregion.HIDDENREGION as hregionName + ,(select count(1) from BUS_HIDDENEXAMINE eax where eax.HIDDEN_ID = f.HIDDEN_ID and eax.STATE = '-1') as exaCount + from + + f + LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join hiddenType on f.HIDDENTYPE = hiddenType.BIANMA + left join hiddenType2 on f.HIDDENTYPE2 = + hiddenType2.BIANMA + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART + left join bus_listmanager list on list.LISTMANAGER_ID = f.LISTMANAGER_ID + LEFT JOIN bus_hiddencheck hch on hch.HIDDEN_ID = f.HIDDEN_ID + left join bus_hidden_user bhu on bhu.HIDDEN_ID = f.HIDDEN_ID - - left JOIN (select USER_ID from sys_USER where DEPARTMENT_ID in(${pd.ArrayDATA_IDS})) userfind on userfind.USER_ID = f.CREATOR - - where f.ISDELETE = '0' - - or (confirmUser.DEPARTMENT_ID in (${pd.supDeparIds}) or bhu.DEPARTMENT_ID in (${pd.supDeparIds}) or f.RECTIFICATIONDEPT in (${pd.supDeparIds}) or hch.DEPARTMENT_ID in (${pd.supDeparIds})) - - and f.state not in ('0') - - and f.STATE != '11' and f.STATE = '-2' - - - and f.STATE = #{pd.STATE} - - - and f.CORPINFO_ID = #{pd.CORPINFO_ID} - - - and f.state = '-2' - - - and f.state != '-2' - - - - and f.SOURCE in ('2','3') - - - and f.SOURCE = #{pd.keySource} - - - - and f.SOURCE in ('2','3') - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) - - - and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) - - - and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) - - - and f.HIDDENTYPE = #{pd.keyHiddenType} - - - and f.HIDDENTYPE2 = #{pd.keyHiddenType2} - - - and f.HIDDENPART = #{pd.keyHiddenPart} - - - and f.HIDDENLEVEL in ('jdyh001','hiddenLevel2002') - - - and f.CONFIRM_USER = #{pd.CONFIRM_USER} - - - and f.DISCOVERYTIME >= #{pd.keyFindStateTime} - - - and f.DISCOVERYTIME <= #{pd.keyFindEndTime} - - - and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - - - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) - - - and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex - where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) - - - and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} - - + and f.state = '-2' + + + and f.state != '-2' + + + + and f.SOURCE in ('2','3') + + + and f.SOURCE = #{pd.keySource} + + + + and f.SOURCE in ('2','3') + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + + and f.HIDDENTYPE = #{pd.keyHiddenType} + + + and f.HIDDENTYPE2 = #{pd.keyHiddenType2} + + + and f.HIDDENPART = #{pd.keyHiddenPart} + + + and f.HIDDENLEVEL in ('jdyh001','hiddenLevel2002') + + + and f.CONFIRM_USER = #{pd.CONFIRM_USER} + + + and f.DISCOVERYTIME >= #{pd.keyFindStateTime} + + + and f.DISCOVERYTIME <= #{pd.keyFindEndTime} + + + and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) + + + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or + lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + + + and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex + where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) + + + and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} + + - order by f.CREATTIME desc,f.STATE + 0 asc - + order by f.CREATTIME desc,f.STATE + 0 asc + - - + select + f.* + ,lv.NAME HIDDENLEVELNAME + ,re.NAME as RECTIFICATIONORNAME + ,confirmUser.NAME as confirmUserName + ,hiddenType.NAME as hiddenTypeName + ,hiddenType2.NAME as hiddenTypeName2 + ,hregion.HIDDENREGION as hregionName + ,(select count(1) from BUS_HIDDENEXAMINE eax where eax.HIDDEN_ID = f.HIDDEN_ID and eax.STATE = '-1') as exaCount + from + + f + LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join hiddenType on f.HIDDENTYPE = hiddenType.BIANMA + left join hiddenType2 on f.HIDDENTYPE2 = + hiddenType2.BIANMA + left join sys_user re on re.USER_ID = f.RECTIFICATIONOR + left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART + left join bus_listmanager list on list.LISTMANAGER_ID = f.LISTMANAGER_ID + + left JOIN (select USER_ID from sys_USER where DEPARTMENT_ID in(${pd.ArrayDATA_IDS})) userfind on + userfind.USER_ID = f.CREATOR + + where f.ISDELETE = '0' + and f.state not in ('0') + and f.STATE = '11' + + and f.STATE = #{pd.STATE} + + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + and f.state = '-2' + + + and f.state != '-2' + + + + and f.SOURCE in ('2','3') + + + and f.SOURCE = #{pd.keySource} + + + + and f.SOURCE in ('2','3') + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.keyHiddenDescr}),'%')) + + + and (f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + + and f.HIDDENTYPE = #{pd.keyHiddenType} + + + and f.HIDDENTYPE2 = #{pd.keyHiddenType2} + + + and f.HIDDENPART = #{pd.keyHiddenPart} + + + and f.HIDDENLEVEL in ('jdyh001','hiddenLevel2002') + + + and f.CONFIRM_USER = #{pd.CONFIRM_USER} + + + and f.DISCOVERYTIME >= #{pd.keyFindStateTime} + + + and f.DISCOVERYTIME <= #{pd.keyFindEndTime} + + + and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) + + + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or + lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + + + and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex + where hex.TYPE = #{pd.keyHiddenSpecialType} and hex.STATE ='1' ) + + + and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} + + - order by f.CREATTIME desc,f.STATE + 0 asc - + order by f.CREATTIME desc,f.STATE + 0 asc + - - + + - - - update - - set - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} + where + HIDDEN_ID = #{HIDDEN_ID} + - - - - - - update - - set - RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, - RECTIFICATIONOR = #{RECTIFICATIONOR} - - ,STATE = #{STATE} - - - ,RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} - - where - HIDDEN_ID = #{HIDDEN_ID} - - - - update - - set - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} - - , STATE = if(DATE_FORMAT( #{RECTIFICATIONDEADLINE},'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d'), '1', STATE) - - where - HIDDEN_ID = #{HIDDEN_ID} - - - + + + + + + update + + set + RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, + RECTIFICATIONOR = #{RECTIFICATIONOR} + + ,STATE = #{STATE} + + + ,RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} + + where + HIDDEN_ID = #{HIDDEN_ID} + + + + update + + set + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} + + , STATE = if(DATE_FORMAT( #{RECTIFICATIONDEADLINE},'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d'), '1', + STATE) + + where + HIDDEN_ID = #{HIDDEN_ID} + + + - - + + - - + + - - + + - - + + - - + + - - + select + f.HIDDENDESCR, + f.DISCOVERYTIME, + f.HIDDENPART, + hr.HIDDENREGION HIDDENPART_NAME, + f.HIDDENLEVEL, + lv.NAME HIDDENLEVEL_NAME, + f.HIDDENTYPE, + ht.NAME HIDDENTYPE_NAME, + f.HIDDENTYPE2, + ht2.NAME HIDDENTYPE2_NAME, + f.LONGITUDE, + f.LATITUDE, + f.HIDDENFINDDEPT, + crd.NAME HIDDENFINDDEPT_NAME, + f.CREATOR, + cr.NAME CREATOR_NAME, + f.HIDDEN_ID, + f.ISRELEVANT, + f.POSITIONDESC + from + + f + left join bus_hiddenregion hr on hr.HIDDENREGION_ID = f.HIDDENPART + left join lv on f.HIDDENLEVEL = lv.BIANMA + left join ht on f.HIDDENTYPE = ht.BIANMA + left join ht2 on f.HIDDENTYPE2 = ht2.BIANMA and ht2.PARENT_ID = + '18c0a9aea6e54feab9f4ab3f46e0bc86' + left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT + left join vi_user_all cr on cr.USER_ID = f.CREATOR + where f.ISDELETE = '0' + + and f.FOREIGN_ID = #{FOREIGN_ID} + + + and + ( + f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + or + c.CORP_NAME LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%') + ) + - - and c.PROVINCE = #{DEPT_PROVINCE} - - - and c.CITY = #{DEPT_CITY} - - - and c.COUNTRY = #{DEPT_COUNTRY} - - - and c.VILLAGE = #{DEPT_VILLAGE} - - - and c.CORP_OF_TYPE in (select CORPTYPE_ID from BUS_CORPTYPETODEPT ctod where ctod.DEPARTMENT_ID=#{DEPARTMENT_ID}) - + + and c.PROVINCE = #{DEPT_PROVINCE} + + + and c.CITY = #{DEPT_CITY} + + + and c.COUNTRY = #{DEPT_COUNTRY} + + + and c.VILLAGE = #{DEPT_VILLAGE} + + + and c.CORP_OF_TYPE in (select CORPTYPE_ID from BUS_CORPTYPETODEPT ctod where + ctod.DEPARTMENT_ID=#{DEPARTMENT_ID}) + - - and c.COUNTRY = #{COUNTRY} - - - and c.VILLAGE = #{VILLAGE} - - - and c.CORP_OF_TYPE = #{CORP_OF_TYPE} - + + and c.COUNTRY = #{COUNTRY} + + + and c.VILLAGE = #{VILLAGE} + + + and c.CORP_OF_TYPE = #{CORP_OF_TYPE} + - - and f.RECTIFICATIONDEADLINE >= #{STARTTIME} - - - and f.RECTIFICATIONDEADLINE <= #{ENDTIME} - - - and f.STATE = #{STATE} - + + and f.RECTIFICATIONDEADLINE >= #{STARTTIME} + + + and f.RECTIFICATIONDEADLINE <= #{ENDTIME} + + + and f.STATE = #{STATE} + - - and f.HIDDENLEVEL = #{HIDDENLEVEL} - - order by f.CREATTIME ASC - + + and f.HIDDENLEVEL = #{HIDDENLEVEL} + + order by f.CREATTIME ASC + - - - update - - set - STATE = #{STATE} - where - FOREIGN_ID = #{INSPECTION_ID} and SOURCE = #{INSPECTION_SOURCE} - + + + update + + set + STATE = #{STATE} + where + FOREIGN_ID = #{INSPECTION_ID} and SOURCE = #{INSPECTION_SOURCE} + - - + select + iou.NAME INSPECTION_ORIGINATOR_NAME, + ild.NAME INSPECTION_LEADDEPARTMENT_NAME, + iod.NAME INSPECTION_DEPARTMENT_NAME, + isd.NAME INSPECTED_DEPARTMENT_NAME, + isu.NAME INSPECTED_SITEUSER_NAME, + isu.USER_ID INSPECTED_SITEUSER_ID, + se.INSPECTION_STATUS, + se.INSPECTION_ID, + se.INSPECTED_DEPARTMENT_ID, + se.INSPECTION_SUBJECT, + f.HIDDENDESCR, + f.CREATOR, + c.NAME CREATOR_NAME, + f.CONFIRM_USER, + hcu.NAME CONFIRM_USER_NAME, + f.RECTIFICATIONOR, + f.CHECKOR, + f.STATE HIDDEN_STATUS, + f.FINAL_CHECK, + f.FINAL_CHECKOR, + f.FINAL_CHECKTIME, + f.FINAL_CHECKDESCR, + isa.INSPECTION_ASSESS_ID, + isa.ASSESS_SCORE, + isa.ASSESS_PENALTY_AMOUNT, + f.HIDDEN_ID + from + + f + LEFT JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL se ON se.INSPECTION_ID = f.FOREIGN_ID + LEFT JOIN VI_USER_ALL iou ON iou.USER_ID = se.INSPECTION_ORIGINATOR_ID + LEFT JOIN VI_DEPARTMENT_ALL iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID + LEFT JOIN VI_DEPARTMENT_ALL ild ON ild.DEPARTMENT_ID = se.INSPECTION_LEADDEPARTMENT_ID + LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = se.INSPECTED_DEPARTMENT_ID + LEFT JOIN SYS_USER isu ON isu.USER_ID = se.INSPECTED_SITEUSER_ID + LEFT JOIN VI_USER_ALL c on c.USER_ID = f.CREATOR + left join lv on f.HIDDENLEVEL = lv.BIANMA + LEFT JOIN sys_user hcu on hcu.USER_ID = f.CONFIRM_USER + LEFT JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL_ASSESS isa on isa.HIDDEN_ID = f.HIDDEN_ID and isa.ISDELETE = '0' + LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER + left join bus_hidden_user bhu on bhu.HIDDEN_ID = f.HIDDEN_ID + LEFT JOIN bus_hiddencheck hch on hch.HIDDEN_ID = f.HIDDEN_ID + where f.ISDELETE = '0' and f.SOURCE IN ('4','5') and f.STATE != '100' + + + + + + and (confirmUser.DEPARTMENT_ID in (${pd.supDeparIds}) or bhu.DEPARTMENT_ID in (${pd.supDeparIds}) or + f.RECTIFICATIONDEPT in (${pd.supDeparIds}) or hch.DEPARTMENT_ID in (${pd.supDeparIds})) + + + and (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = + #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) + + + + + and c.NAME LIKE CONCAT(CONCAT('%', #{pd.CREATOR_NAME}),'%') + + + and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + and se.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR} + + + and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}),'%') + + + and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}),'%') + + + and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}),'%') + + + and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%') + + + and f.STATE = #{pd.HIDDEN_STATUS} + + + and f.FOREIGN_ID = #{pd.INSPECTION_ID} + + + + + and se.INSPECTION_STATUS in ('3','4','5','6','7') + + + and se.INSPECTION_STATUS = #{pd.INSPECTION_STATUS} + + + + + + + and isa.INSPECTION_ASSESS_ID IS NOT NULL + + + and isa.INSPECTION_ASSESS_ID IS NULL + + + + - GROUP BY f.HIDDEN_ID - ORDER BY f.CREATTIME desc,f.STATE + 0 asc - + GROUP BY f.HIDDEN_ID + ORDER BY f.CREATTIME desc,f.STATE + 0 asc + - - - update - - set - STATE = #{STATE}, - CONFIRM_USER = #{CONFIRM_USER}, - CONFIRM_TIME = #{CONFIRM_TIME}, - RECTIFICATIONTYPE = #{RECTIFICATIONTYPE}, - RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, - ISCONFIRM = #{ISCONFIRM}, - RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, - RECTIFICATIONOR = #{RECTIFICATIONOR}, - CHECKDEPT = #{CHECKDEPT}, - CHECKOR = #{CHECKOR}, - HIDDEN_ID = HIDDEN_ID - where - HIDDEN_ID = #{HIDDEN_ID} - + + + update + + set + STATE = #{STATE}, + CONFIRM_USER = #{CONFIRM_USER}, + CONFIRM_TIME = #{CONFIRM_TIME}, + RECTIFICATIONTYPE = #{RECTIFICATIONTYPE}, + RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE}, + ISCONFIRM = #{ISCONFIRM}, + RECTIFICATIONDEPT = #{RECTIFICATIONDEPT}, + RECTIFICATIONOR = #{RECTIFICATIONOR}, + CHECKDEPT = #{CHECKDEPT}, + CHECKOR = #{CHECKOR}, + HIDDEN_ID = HIDDEN_ID + where + HIDDEN_ID = #{HIDDEN_ID} + - - + + - - + + - - + + - - - update - - set - ISDELETE = '1' - where - HIDDEN_ID in - - #{item} - - + + + update + + set + ISDELETE = '1' + where + HIDDEN_ID in + + #{item} + + - + - - + + - - - update - - set - ISDELETE = '1' - where - FOREIGN_ID = #{FOREIGN_ID} - and SOURCE = #{SOURCE} - + + + update + + set + ISDELETE = '1' + where + FOREIGN_ID = #{FOREIGN_ID} + and SOURCE = #{SOURCE} + - - + + - + - - + + - - + SELECT count(*) count , HIDDENLEVEL,HIDDENTYPE - FROM - bus_hidden f - WHERE - f.ISDELETE = '0' and (HIDDENLEVEL is not null or HIDDENLEVEL !='') and CORPINFO_ID = #{CORPINFO_ID} - and f.STATE not in('0','100','101','102') - GROUP BY - HIDDENLEVEL,HIDDENTYPE - - - - + + + - - + + + + and f.HIDDENLEVEL = #{pd.HIDDENLEVEL} + + + and f.HIDDENLEVEL = #{pd.HIDDENLEVEL} + + + and f.STATE = #{pd.STATE} + + + and f.HIDDENPART = #{pd.keyHiddenPart} + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.NAME LIKE CONCAT(CONCAT('%', #{pd.keyFindUserName}),'%') ) + + + and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = + hfu.USER_ID where user.DEPARTMENT_ID = #{pd.keyFindUserDept} ) + + + and f.HIDDENTYPE = #{pd.keyHiddenType} + + + and f.HIDDENTYPE2 = #{pd.keyHiddenType2} + + group by f.HIDDEN_ID + order by f.CREATTIME desc,f.STATE + 0 asc + + SELECT * + FROM bus_hidden + WHERE ISDELETE = 0 + and SOURCE = #{sourceNumber} + - INSERT INTO bus_hidden_emis( - HIDDEN_ID,SOURCE,RISK_UNIT,IDENTIFICATION,RISK_DESCR,RISK_POSITION,LEVEL,CHECK_CONTENT,HIDDENDESCR,HIDDENPART,CREATOR, - CREATTIME,RECTIFYDESCR,RECTIFICATIONTYPE,RECTIFICATIONDEPT,RECTIFICATIONOR,RECTIFICATIONDEADLINE, - RECTIFICATIONTIME,HIDDENLEVEL,STATE,CHECKDEPT,CHECKOR,CHECKTIME,CHECKDESCR,ISQUALIFIED,ISDELETE,CORPINFO_ID, - HIDDENFINDDEPT,CHECKRECORD_ID,RECORDITEM_ID,RISKITEM_ID,REJECTREASON,REVIEWOR,REVIEWTIME,REVIEWDEPT,HAVESCHEME, - LONGITUDE,LATITUDE,LISTMANAGER_ID,HIDDENTYPE,ISCONFIRM,CONFIRM_USER,CONFIRM_TIME,DISCOVERYTIME,INVESTMENT_FUNDS, - HIDDENTYPE2,POSITIONDESC,ISRELEVANT,EMIS_RES - ) SELECT - HIDDEN_ID,SOURCE,RISK_UNIT,IDENTIFICATION,RISK_DESCR,RISK_POSITION,LEVEL,CHECK_CONTENT,HIDDENDESCR,HIDDENPART,CREATOR,CREATTIME,RECTIFYDESCR, - RECTIFICATIONTYPE,RECTIFICATIONDEPT,RECTIFICATIONOR,RECTIFICATIONDEADLINE,RECTIFICATIONTIME,HIDDENLEVEL,STATE,CHECKDEPT,CHECKOR,CHECKTIME, - CHECKDESCR,ISQUALIFIED,ISDELETE,CORPINFO_ID,HIDDENFINDDEPT,CHECKRECORD_ID,RECORDITEM_ID,RISKITEM_ID,REJECTREASON,REVIEWOR,REVIEWTIME,REVIEWDEPT, - HAVESCHEME,LONGITUDE,LATITUDE,LISTMANAGER_ID,HIDDENTYPE,ISCONFIRM,CONFIRM_USER,CONFIRM_TIME,DISCOVERYTIME,INVESTMENT_FUNDS,HIDDENTYPE2, - POSITIONDESC,ISRELEVANT,#{resXML} - FROM bus_hidden where - HIDDEN_ID = #{HIDDEN_ID} + INSERT INTO bus_hidden_emis(HIDDEN_ID, SOURCE, RISK_UNIT, IDENTIFICATION, RISK_DESCR, RISK_POSITION, LEVEL, + CHECK_CONTENT, HIDDENDESCR, HIDDENPART, CREATOR, + CREATTIME, RECTIFYDESCR, RECTIFICATIONTYPE, RECTIFICATIONDEPT, RECTIFICATIONOR, + RECTIFICATIONDEADLINE, + RECTIFICATIONTIME, HIDDENLEVEL, STATE, CHECKDEPT, CHECKOR, CHECKTIME, CHECKDESCR, + ISQUALIFIED, ISDELETE, CORPINFO_ID, + HIDDENFINDDEPT, CHECKRECORD_ID, RECORDITEM_ID, RISKITEM_ID, REJECTREASON, REVIEWOR, + REVIEWTIME, REVIEWDEPT, HAVESCHEME, + LONGITUDE, LATITUDE, LISTMANAGER_ID, HIDDENTYPE, ISCONFIRM, CONFIRM_USER, + CONFIRM_TIME, DISCOVERYTIME, INVESTMENT_FUNDS, + HIDDENTYPE2, POSITIONDESC, ISRELEVANT, EMIS_RES) + SELECT HIDDEN_ID, + SOURCE, + RISK_UNIT, + IDENTIFICATION, + RISK_DESCR, + RISK_POSITION, + LEVEL, + CHECK_CONTENT, + HIDDENDESCR, + HIDDENPART, + CREATOR, + CREATTIME, + RECTIFYDESCR, + RECTIFICATIONTYPE, + RECTIFICATIONDEPT, + RECTIFICATIONOR, + RECTIFICATIONDEADLINE, + RECTIFICATIONTIME, + HIDDENLEVEL, + STATE, + CHECKDEPT, + CHECKOR, + CHECKTIME, + CHECKDESCR, + ISQUALIFIED, + ISDELETE, + CORPINFO_ID, + HIDDENFINDDEPT, + CHECKRECORD_ID, + RECORDITEM_ID, + RISKITEM_ID, + REJECTREASON, + REVIEWOR, + REVIEWTIME, + REVIEWDEPT, + HAVESCHEME, + LONGITUDE, + LATITUDE, + LISTMANAGER_ID, + HIDDENTYPE, + ISCONFIRM, + CONFIRM_USER, + CONFIRM_TIME, + DISCOVERYTIME, + INVESTMENT_FUNDS, + HIDDENTYPE2, + POSITIONDESC, + ISRELEVANT, + #{resXML} + FROM bus_hidden + where HIDDEN_ID = #{HIDDEN_ID} - delete from - - where - HIDDEN_ID = #{HIDDEN_ID} - + delete from + + where + HIDDEN_ID = #{HIDDEN_ID} + - - - update - - set - CHECKRECORD_ID = #{CHECKRECORD_ID}, - STATE = '-2' - where - HIDDEN_ID in - - #{item} - - and STATE = '0' - + + + update + + set + CHECKRECORD_ID = #{CHECKRECORD_ID}, + STATE = '-2' + where + HIDDEN_ID in + + #{item} + + and STATE = '0' + - - + - + - + 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) + < + 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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 ) 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 + < + '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) + < + 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 '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 + < + '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 '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 + < + '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 '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 - + WHEN f.APPLY_STATUS + < + '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 +