diff --git a/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml b/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml index 1fc2a485..b45eb49a 100644 --- a/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/bus/HiddenMapper.xml @@ -14,10 +14,7 @@ - f - . - SOURCE - , + f.SOURCE, f.RISK_UNIT, f.IDENTIFICATION, f.RISK_DESCR, @@ -74,8 +71,7 @@ - SOURCE - , + SOURCE, RISK_UNIT, IDENTIFICATION, RISK_DESCR, @@ -130,8 +126,7 @@ - #{SOURCE} - , + #{SOURCE}, #{RISK_UNIT}, #{IDENTIFICATION}, #{RISK_DESCR}, @@ -172,10 +167,7 @@ #{ISCONFIRM}, #{CONFIRM_USER}, #{DISCOVERYTIME}, - getHiddenType - ( - #{HIDDENTYPE} - ), + getHiddenType(#{HIDDENTYPE}), #{INVESTMENT_FUNDS}, #{LISTMANAGER_ID}, #{FOREIGN_ID}, @@ -431,10 +423,8 @@ select from - - f - where ( f.CHECKRECORD_ID = #{CHECKRECORD_ID} or LISTMANAGER_ID = #{LISTMANAGER_ID} ) and f.ISDELETE = '0' and - f.STATE = '1' + f + where ( f.CHECKRECORD_ID = #{CHECKRECORD_ID} or LISTMANAGER_ID = #{LISTMANAGER_ID} ) and f.ISDELETE = '0' and f.STATE = '1' @@ -503,8 +493,7 @@ update - - f + f set STATE = '-1' where @@ -520,8 +509,7 @@ UPDATE - - f + f SET f.STATE = '1' WHERE f.RECTIFICATIONDEADLINE is not null @@ -557,8 +545,7 @@ isa.ASSESS_SCORE, isa.ASSESS_PENALTY_AMOUNT from - - f + 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 @@ -569,8 +556,7 @@ 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 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 @@ -602,7 +588,7 @@ hregionDept.NAME as hregionDeptName, hregion.HIDDENREGION as hregionName, od.DEPARTMENT_ID as confirmDept, - -- fc.NAME FINAL_CHECKOR_NAME, + -- fc.NAME FINAL_CHECKOR_NAME, isa.INSPECTION_ASSESS_ID, siu.NAME as acceptName, isa.ASSESS_SCORE, @@ -619,13 +605,12 @@ 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 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 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 @@ -644,14 +629,12 @@ chd.NAME CHECKDEPTNAME, lv.NAME HIDDENLEVELNAME, hregion.HIDDENREGION as HREGIONNAME, - confirmUser.NAME as confirmUserName, - (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, - (select group_concat(bh.USER_ID) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKUSERS + confirmUser.NAME as confirmUserName, + (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, + (select group_concat(bh.USER_ID) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKUSERS ,(select count(1) from BUS_HIDDENEXAMINE eax where eax.HIDDEN_ID = f.HIDDEN_ID and eax.STATE = '-1') as exaCount from - - f + f LEFT JOIN sys_user confirmUser on confirmUser.USER_ID = f.CONFIRM_USER left join vi_user_all cr on cr.USER_ID = f.CREATOR left join sys_user re on re.USER_ID = f.RECTIFICATIONOR @@ -661,8 +644,7 @@ 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 + lv on f.HIDDENLEVEL = lv.BIANMA left join bus_hiddenregion hregion on hregion.HIDDENREGION_ID = f.HIDDENPART 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 @@ -673,16 +655,14 @@ - 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 (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} or hch.USER_ID = #{pd.loginUserId} ) + and (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} or hch.USER_ID = #{pd.loginUserId} ) - and (f.STATE not in ('0','7','5') or f.STATE ='16') + and (f.STATE not in ('0','7','5') or f.STATE ='16') and f.HIDDENLEVEL != 'hiddenLevel2002' and f.HIDDENLEVEL != 'hiddenLevel1001' and f.HIDDENLEVEL != 'jdyh001' and f.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -702,18 +682,17 @@ - + and confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.confirmUserName}),'%') and re.NAME LIKE CONCAT(CONCAT('%', #{pd.RECTIFICATIONORNAME}),'%') - and f.HIDDENPART = #{pd.keyHiddenPart} + and f.HIDDENPART = #{pd.keyHiddenPart} - and (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 ) LIKE CONCAT(CONCAT('%', #{pd.CHECKNAME}),'%') + and (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 ) LIKE CONCAT(CONCAT('%', #{pd.CHECKNAME}),'%') and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%') @@ -733,7 +712,7 @@ and f.CREATTIME <= #{pd.ENDTIME} - + and f.STATE = #{pd.STATE} @@ -811,7 +790,7 @@ - and f.SOURCE = '1' + and f.SOURCE = '1' and f.SOURCE = '2' @@ -858,7 +837,7 @@ - and f.STATE != '0' + and f.STATE != '0' and f.STATE != '4' @@ -869,15 +848,13 @@ - 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.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} ) + 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 + order by f.STATE ='16' desc, f.CREATTIME desc - SELECT f.HIDDENTYPE, - dic.DICTIONARIES_ID, - COUNT(1) AS count + SELECT + f.HIDDENTYPE, + dic.DICTIONARIES_ID, + COUNT(1) AS count FROM BUS_HIDDEN f - left join sys_dictionaries dic - on dic.BIANMA = f.HIDDENTYPE + left join sys_dictionaries dic on dic.BIANMA = f.HIDDENTYPE WHERE - f.CORPINFO_ID = #{CORPINFO_ID} - AND f.ISDELETE = '0' - and dic.DICTIONARIES_ID is not null + f.CORPINFO_ID = #{CORPINFO_ID} AND f.ISDELETE = '0' and dic.DICTIONARIES_ID is not null GROUP BY f.HIDDENTYPE @@ -1583,28 +1545,25 @@ select f.* ,lv.NAME HIDDENLEVELNAME - ,re.NAME as RECTIFICATIONORNAME - ,confirmUser.NAME as confirmUserName + ,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 + 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 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 + 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' @@ -1613,12 +1572,10 @@ - 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 (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 (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) @@ -1651,12 +1608,10 @@ 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.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.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} @@ -1684,6 +1639,7 @@ + @@ -1691,8 +1647,7 @@ and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or - lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex @@ -1708,7 +1663,7 @@ 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 + f.CREATTIME desc @@ -1716,27 +1671,24 @@ select f.* ,lv.NAME HIDDENLEVELNAME - ,re.NAME as RECTIFICATIONORNAME - ,confirmUser.NAME as confirmUserName + ,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 + 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 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 (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' @@ -1745,12 +1697,10 @@ - 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 (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 (bhu.USER_ID =#{pd.loginUserId} or f.CONFIRM_USER = #{pd.loginUserId} or f.RECTIFICATIONOR = #{pd.loginUserId} or f.CHECKOR = #{pd.loginUserId} ) @@ -1779,12 +1729,10 @@ 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.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.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} @@ -1799,8 +1747,7 @@ 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.CONFIRM_USER = #{pd.CONFIRM_USER} or f.CREATOR = #{pd.CONFIRM_USER} or bhu.USER_ID = #{pd.CONFIRM_USER}) @@ -1813,8 +1760,7 @@ and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or - lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex @@ -1824,7 +1770,7 @@ and f.RECTIFICATIONOR = #{pd.RECTIFICATIONOR}} group by f.HIDDEN_ID - order by f.CREATTIME desc,f.STATE + 0 asc + order by f.CREATTIME desc,f.STATE + 0 asc @@ -1833,20 +1779,18 @@ select f.* ,lv.NAME HIDDENLEVELNAME - ,re.NAME as RECTIFICATIONORNAME - ,confirmUser.NAME as confirmUserName + ,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 + 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 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 @@ -1854,13 +1798,11 @@ 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 (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})) + + 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') @@ -1896,12 +1838,10 @@ 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.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.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} @@ -1928,8 +1868,7 @@ and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or - lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex @@ -1942,7 +1881,7 @@ or (list.DEPARTMENT_ID in (${pd.ArrayDATA_IDS}) ) --> - order by f.CREATTIME desc,f.STATE + 0 asc + order by f.CREATTIME desc,f.STATE + 0 asc @@ -1950,26 +1889,23 @@ select f.* ,lv.NAME HIDDENLEVELNAME - ,re.NAME as RECTIFICATIONORNAME - ,confirmUser.NAME as confirmUserName + ,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 + 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 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 + 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') @@ -2004,12 +1940,10 @@ 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.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.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} @@ -2036,8 +1970,7 @@ and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or - lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex @@ -2050,7 +1983,7 @@ or (list.DEPARTMENT_ID in (${pd.ArrayDATA_IDS}) ) --> - order by f.CREATTIME desc,f.STATE + 0 asc + order by f.CREATTIME desc,f.STATE + 0 asc @@ -2058,26 +1991,23 @@ select f.* ,lv.NAME HIDDENLEVELNAME - ,re.NAME as RECTIFICATIONORNAME - ,confirmUser.NAME as confirmUserName + ,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 + 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 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 + 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.CORPINFO_ID = #{pd.CORPINFO_ID} @@ -2108,12 +2038,10 @@ 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.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.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} @@ -2143,8 +2071,7 @@ and (confirmUser.NAME LIKE CONCAT(CONCAT('%', #{pd.keyConfirmUser}),'%')) - and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or - lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) + and (lv.PARENT_ID = '5ff9daf78e9a4fb1b40d77980656799d' or lv.DICTIONARIES_ID='5ff9daf78e9a4fb1b40d77980656799d' ) and f.HIDDEN_ID in (select hex.HIDDEN_ID from bus_hiddenexamine hex @@ -2153,7 +2080,7 @@ - order by f.CREATTIME desc,f.STATE + 0 asc + order by f.CREATTIME desc,f.STATE + 0 asc @@ -2195,8 +2122,7 @@ - AND f.CREATTIME >= CONCAT_WS(" ", date_format(DATE_ADD(date_sub(curdate(),interval 5 month),interval - -day(date_sub(curdate(),interval 5 month))+1 DAY),'%Y-%m-%d'), '00:00:00') + AND f.CREATTIME >= CONCAT_WS(" ", date_format(DATE_ADD(date_sub(curdate(),interval 5 month),interval -day(date_sub(curdate(),interval 5 month))+1 DAY),'%Y-%m-%d'), '00:00:00') ) f GROUP BY f.CREATMONTH @@ -2222,35 +2148,30 @@ set RECTIFICATIONDEADLINE = #{RECTIFICATIONDEADLINE} - , STATE = if(DATE_FORMAT( #{RECTIFICATIONDEADLINE},'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d'), '1', - STATE) + , STATE = if(DATE_FORMAT( #{RECTIFICATIONDEADLINE},'%Y-%m-%d') >= DATE_FORMAT(NOW(),'%Y-%m-%d'), '1', STATE) where HIDDEN_ID = #{HIDDEN_ID} - SELECT f.DICTIONARIES_ID, - f.NAME, - f.BIANMA, - COUNT(h.HIDDEN_ID) COUNT + SELECT + f.DICTIONARIES_ID, f.NAME, f.BIANMA, COUNT(h.HIDDEN_ID) COUNT FROM sys_dictionaries f - LEFT JOIN bus_hidden h - ON h.HIDDENTYPE = f.BIANMA AND h.ISDELETE = '0' + LEFT JOIN bus_hidden h ON h.HIDDENTYPE = f.BIANMA AND h.ISDELETE = '0' AND h.CORPINFO_ID = #{CORPINFO_ID} AND h.HIDDENLEVEL = #{HIDDENLEVEL} WHERE f.PARENT_ID = '3babc15144444bdc8d763d0af2bdfff6' GROUP BY f.DICTIONARIES_ID @@ -2275,13 +2193,10 @@ - SELECT case - when f.SOURCE = '1' then '隐患快报' - when f.SOURCE = '2' OR f.SOURCE = '3' then '清单排查' - when f.SOURCE = '4' then '安全环保检查(监管端)' - when f.SOURCE = '5' then '安全环保检查(企业端)' - END SOURCE_NAME, - COUNT(f.HIDDEN_ID) COUNT + SELECT + case + when f.SOURCE ='1' then '隐患快报' + when f.SOURCE ='2' OR f.SOURCE ='3' then '清单排查' + when f.SOURCE ='4' then '安全环保检查(监管端)' + when f.SOURCE ='5' then '安全环保检查(企业端)' + END SOURCE_NAME, + COUNT(f.HIDDEN_ID) COUNT FROM bus_hidden f - WHERE f.ISDELETE = '0' - AND f.SOURCE IS NOT NULL + WHERE f.ISDELETE = '0' AND f.SOURCE IS NOT NULL AND f.CORPINFO_ID = #{CORPINFO_ID} GROUP BY f.SOURCE ORDER BY f.SOURCE ASC @@ -2307,22 +2222,17 @@ @@ -2628,8 +2531,7 @@ select f.HIDDEN_ID from - - f + f where f.ISDELETE = '0' and f.STATE != '4' and f.STATE != '8' @@ -2638,7 +2540,7 @@ and (f.STATE != '4' OR (f.STATE = '4' AND f.FINAL_CHECK IS NULL)) - and (f.STATE != '4' OR (f.STATE = '4' AND f.FINAL_CHECK IS NULL)) and f.STATE != '8' + and (f.STATE != '4' OR (f.STATE = '4' AND f.FINAL_CHECK IS NULL)) and f.STATE != '8' and f.FOREIGN_ID = #{INSPECTION_ID} and f.HIDDEN_ID != #{HIDDEN_ID} @@ -2648,8 +2550,7 @@ select f.HIDDEN_ID from - - f + f where f.ISDELETE = '0' AND ( f.FINAL_CHECK != '1' OR f.FINAL_CHECK IS NULL ) and f.FOREIGN_ID = #{INSPECTION_ID} and f.HIDDEN_ID != #{HIDDEN_ID} @@ -2672,8 +2573,7 @@ select f.HIDDEN_ID from - - f + f where f.CHECKRECORD_ID = #{CHECKRECORD_ID} and f.STATE = '-2' @@ -2684,8 +2584,7 @@ select f.HIDDEN_ID from - - f + f where f.FOREIGN_ID = #{INSPECTION_ID} @@ -2705,8 +2604,7 @@ select a.NAME as HIDDEN_CREATOR_NAME, f.* from - - f + f left join vi_user_all a on a.USER_ID = f.CREATOR where f.ISDELETE = '0'and f.FOREIGN_ID = #{FOREIGN_ID} @@ -2714,8 +2612,7 @@ select re.NAME as RECTIFICATIONORNAME, f.* from - - f + f left join sys_user re on re.USER_ID = f.RECTIFICATIONOR where f.ISDELETE = '0'and f.HIDDEN_ID = #{HIDDEN_ID} @@ -2724,8 +2621,7 @@ select conUser.NAME as conUserName,f.* from - - f + f left join VI_USER_ALL conUser on conUser.USER_ID = f.CONFIRM_USER where f.ISDELETE = '0'and f.HIDDEN_ID = #{HIDDEN_ID} @@ -2737,8 +2633,7 @@ ts.TYPE as TSTYPE, conUser.name as tsname from - - f + f left join bus_hiddenexamine ts on ts.HIDDEN_ID = f.HIDDEN_ID left join VI_USER_ALL conUser on conUser.USER_ID = f.CONFIRM_USER where f.STATE in ('7','8') and f.ISDELETE = '0'and f.HIDDEN_ID = #{HIDDEN_ID} @@ -2747,21 +2642,16 @@ - 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} + HIDDEN_ID = #{HIDDEN_ID} @@ -3230,6 +3062,75 @@ and h.CREATTIME = ]]> #{startTime} and h.CREATTIME #{endTime} + UNION ALL + SELECT + h.HIDDEN_ID, + h.STATE, + IFNULL(h.INVESTMENT_FUNDS,0) INVESTMENT_FUNDS, + 'mechanical' type + FROM + bus_hidden h + LEFT JOIN sys_user u ON h.CREATOR = u.USER_ID + LEFT JOIN sys_user uu ON h.RECTIFICATIONOR = uu.USER_ID + WHERE + h.SOURCE != '4' + AND h.ISDELETE = '0' + AND uu.DEPARTMENT_ID IN + + #{item} + + AND u.DEPARTMENT_ID IN + + #{item} + + and h.CREATTIME = ]]> #{startTime} + and h.CREATTIME #{endTime} + UNION ALL + SELECT + h.HIDDEN_ID, + h.STATE, + IFNULL(h.INVESTMENT_FUNDS,0) INVESTMENT_FUNDS, + 'business' type + FROM + bus_hidden h + LEFT JOIN sys_user u ON h.CREATOR = u.USER_ID + LEFT JOIN sys_user uu ON h.RECTIFICATIONOR = uu.USER_ID + WHERE + h.SOURCE != '4' + AND h.ISDELETE = '0' + AND uu.DEPARTMENT_ID IN + + #{item} + + AND u.DEPARTMENT_ID IN + + #{item} + + and h.CREATTIME = ]]> #{startTime} + and h.CREATTIME #{endTime} + UNION ALL + SELECT + h.HIDDEN_ID, + h.STATE, + IFNULL(h.INVESTMENT_FUNDS,0) INVESTMENT_FUNDS, + 'generalOffice' type + FROM + bus_hidden h + LEFT JOIN sys_user u ON h.CREATOR = u.USER_ID + LEFT JOIN sys_user uu ON h.RECTIFICATIONOR = uu.USER_ID + WHERE + h.SOURCE != '4' + AND h.ISDELETE = '0' + AND uu.DEPARTMENT_ID IN + + #{item} + + AND u.DEPARTMENT_ID IN + + #{item} + + and h.CREATTIME = ]]> #{startTime} + and h.CREATTIME #{endTime} @@ -3305,682 +3206,675 @@