diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index d85535fb..45a9e11f 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml @@ -282,7 +282,9 @@ ( SELECT GROUP_CONCAT( t.NAME ) FROM `qa-gwj-prevention`.oa_department t WHERE FIND_IN_SET( t.DEPARTMENT_ID, f.INVOLVING_CORPS_DEPART_ID ) ) AS INVOLVING_CORPS_DEPART_NAME, (select GROUP_CONCAT(t.CORP_NAME) from `qa-gwj-prevention`.BUS_CORP_INFO t where FIND_IN_SET(t.CORPINFO_ID, f.GROUP_UNIT)) as GROUP_UNIT_NAME, ( SELECT GROUP_CONCAT( t.NAME ) FROM `qa-gwj-prevention`.vi_department_all t WHERE FIND_IN_SET( t.DEPARTMENT_ID, f.DEPARTMENT_ID ) ) AS DEPARTMENT_NAME, - + + uncheck.UNCHECK_COUNT, + (select GROUP_CONCAT(t.NAME) from ( SELECT CONCAT( CONCAT( c.CORP_NAME, '-' ), t.NAME ) NAME ,t.DEPARTMENT_ID @@ -314,6 +316,25 @@ LEFT JOIN `qa-gwj-regulatory`.vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID left join `qa-gwj-regulatory`.bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC LEFT JOIN ( select count(c.KEYPROJECTCHECK_ID) co, c.OUTSOURCED_ID from `qa-gwj-prevention`.BUS_KEYPROJECTCHECK c where c.ISDELETE = '0' group by c.OUTSOURCED_ID ) cc on cc.OUTSOURCED_ID = f.OUTSOURCED_ID + + left join ( + SELECT COUNT(t.HIDDEN_ID) UNCHECK_COUNT,t.OUTSOURCED_ID,t.CREATOR CREATOR FROM ( + SELECT + f.HIDDEN_ID,IFNULL(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) OUTSOURCED_ID,f.CREATOR CREATOR + FROM + `qa-gwj-prevention`.BUS_KEYPROJECT_HIDDEN f + LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck keycheck ON keycheck.KEYPROJECTCHECK_ID = f.FOREIGN_ID + LEFT JOIN `qa-gwj-regulatory`.BUS_OUTSOURCED bo ON keycheck.OUTSOURCED_ID = bo.OUTSOURCED_ID + LEFT JOIN `qa-gwj-regulatory`.BUS_OUTSOURCED boai ON f.FOREIGN_ID = boai.OUTSOURCED_ID + WHERE + f.ISDELETE = '0' + AND f.SOURCE IN ( '4', '5', '1' ) + AND f.STATE = '2' + AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL + AND (bo.ISDELETE = '0' or boai.ISDELETE = '0') + ) t group by t.OUTSOURCED_ID,t.CREATOR + ) uncheck on uncheck.OUTSOURCED_ID = f.OUTSOURCED_ID and uncheck.CREATOR = #{pd.UserId} + left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT, t.SOURCE SOURCE, t.CREATOR CREATOR FROM ( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-gwj-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID and h.ISDELETE = '0') t GROUP BY t.OUTSOURCED_ID,t.CREATOR ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID @@ -381,8 +402,11 @@ GROUP BY f.OUTSOURCED_ID ORDER BY - cc.co DESC, - f.OPERATTIME DESC + + uncheck.UNCHECK_COUNT DESC, + + cc.co DESC +