SELECT DISTINCT A.HRS_PERSON_ID , A.HRS_PROFILE_SEQ , E.OPRID , A.EMPLID , B.LANGUAGE_CD , B.NAME , C.NAME_DISPLAY FROM PS_HRS_EE_REFERRAL A , PS_HRS_APP_NAME_LN B , PS_HRS_PERSON_NM_L C , PS_HRS_RCMNT D , PSOPRDEFN E WHERE A.HRS_PERSON_ID = B.HRS_PERSON_ID AND A.HRS_PERSON_ID = D.HRS_PERSON_ID AND A.HRS_PROFILE_SEQ = D.HRS_PROFILE_SEQ AND A.EMPLID = C.EMPLID AND B.LANGUAGE_CD = C.LANGUAGE_CD AND A.hrs_jo_id_hired = ( SELECT MAX(hrs_jo_id_hired) FROM PS_HRS_EE_REFERRAL WHERE HRS_PERSON_ID = A.HRS_PERSON_ID AND EMPLID = A.EMPLID) AND (D.HRS_JOB_OPENING_ID = 0 OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND JO.EMPLID = E.EMPLID AND JO.EMPLID <> ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'RSOPN' AND CLS.SCRTY_TYPE_CD = JO.SCRTY_TYPE_CD AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'PPLJOB' AND CLS.SCRTY_TYPE_CD = '001' AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' '))) UNION SELECT DISTINCT A.HRS_PERSON_ID , A.HRS_PROFILE_SEQ , E.OPRID , A.EMPLID , B.LANGUAGE_CD , B.NAME , C.NAME_DISPLAY FROM PS_HRS_EE_REFERRAL A , PS_HRS_APP_NAME_LN B , PS_HRS_PERSON_NM_I C , PS_HRS_RCMNT D , PSOPRDEFN E WHERE A.HRS_PERSON_ID = B.HRS_PERSON_ID AND A.HRS_PERSON_ID = D.HRS_PERSON_ID AND A.HRS_PROFILE_SEQ = D.HRS_PROFILE_SEQ AND A.EMPLID = C.EMPLID AND NOT EXISTS ( SELECT 'X' FROM PS_HRS_PERSON_NM_L C1 WHERE C1.EMPLID = C.EMPLID AND C1.LANGUAGE_CD = B.LANGUAGE_CD) AND A.hrs_jo_id_hired = ( SELECT MAX(hrs_jo_id_hired) FROM PS_HRS_EE_REFERRAL WHERE HRS_PERSON_ID = A.HRS_PERSON_ID AND EMPLID = A.EMPLID) AND (D.HRS_JOB_OPENING_ID = 0 OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND JO.EMPLID = E.EMPLID AND JO.EMPLID <> ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'RSOPN' AND CLS.SCRTY_TYPE_CD = JO.SCRTY_TYPE_CD AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'PPLJOB' AND CLS.SCRTY_TYPE_CD = '001' AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' '))) UNION SELECT DISTINCT A.HRS_PERSON_ID , A.HRS_PROFILE_SEQ , E.OPRID , A.EMPLID , C.LANGUAGE_CD , B.NAME , C.NAME_DISPLAY FROM PS_HRS_EE_REFERRAL A , PS_HRS_APP_NAME_I B , PS_HRS_PERSON_NM_L C , PS_HRS_RCMNT D , PSOPRDEFN E WHERE A.HRS_PERSON_ID = B.HRS_PERSON_ID AND A.HRS_PERSON_ID = D.HRS_PERSON_ID AND A.HRS_PROFILE_SEQ = D.HRS_PROFILE_SEQ AND A.EMPLID = C.EMPLID AND NOT EXISTS ( SELECT 'X' FROM PS_HRS_APP_NAME_LN B1 WHERE B1.HRS_PERSON_ID = B.HRS_PERSON_ID AND B1.LANGUAGE_CD = C.LANGUAGE_CD) AND A.hrs_jo_id_hired = ( SELECT MAX(hrs_jo_id_hired) FROM PS_HRS_EE_REFERRAL WHERE HRS_PERSON_ID = A.HRS_PERSON_ID AND EMPLID = A.EMPLID) AND (D.HRS_JOB_OPENING_ID = 0 OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND JO.EMPLID = E.EMPLID AND JO.EMPLID <> ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'RSOPN' AND CLS.SCRTY_TYPE_CD = JO.SCRTY_TYPE_CD AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' ') ) OR (EXISTS ( SELECT 'X' FROM PS_HRS_SJT_JO JO , PS_SJT_CLASS_ALL CLS , PS_SJT_OPR_CLS RSC WHERE JO.HRS_JOB_OPENING_ID = D.HRS_JOB_OPENING_ID AND RSC.CLASSID = CLS.CLASSID AND RSC.OPRID = E.OPRID AND CLS.SCRTY_SET_CD = 'PPLJOB' AND CLS.SCRTY_TYPE_CD = '001' AND CLS.SCRTY_KEY1 = JO.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = JO.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = JO.SCRTY_KEY3 AND JO.EMPLID = ' ')))
|