SELECT JO.HRS_JOB_OPENING_ID , TM.EMPLID , SEC.SUPERVISOR_ID , OPR.OPRID , (CASE WHEN JO.STATUS_CODE = ( SELECT B1.STATUS_CODE FROM PS_HRS_STS_TBL B1 WHERE B1.STATUS_AREA = '1' AND B1.OPEN_STS_IND = 'Y') THEN 'O' ELSE 'C' END) FROM PS_HRS_JOB_OPENING JO , PS_HRS_JO_TEAM TM , PS_HRS_EMPL_SEC_I SEC , PSOPRDEFN OPR WHERE TM.HRS_JOB_OPENING_ID = JO.HRS_JOB_OPENING_ID AND TM.HRS_JO_TM_TYPE = 'R' AND TM.HRS_JO_TM_PRIMARY = 'Y' AND JO.STATUS_CODE IN ( SELECT B.STATUS_CODE FROM PS_HRS_STS_TBL B WHERE B.STATUS_AREA = '1' AND (B.OPEN_STS_IND = 'Y' OR B.COMPLETE_STS_IND = 'Y')) AND TM.EMPLID = SEC.EMPLID AND SEC.ACCESS_TYPE = ( SELECT ATYPE.ACCESS_TYPE FROM PS_SS_LINK_TBL ATYPE WHERE ATYPE.PNLGRPNAME = 'HRS_PE_MGR_SUMM' AND ATYPE.MARKET = 'GBL') AND OPR.EMPLID = SEC.SUPERVISOR_ID
|