SELECT
PAPF.PERSON_ID,
PAAF.ASSIGNMENT_ID ASSIGNMENT_ID,
PAAF.ASSIGNMENT_NUMBER ASSIGNMENT_NUMBER,
PAPF.PERSON_NUMBER EMPLOYEE_NUMBER,
PPNF.FULL_NAME EMPLOYEE_NAME,
PAPF.START_DATE HIRE_DATE,
HLE.NAME LEGAL_EMPLOYER,
FAB.BU_NAME BU_NAME,
PAAF.ASSIGNMENT_STATUS_TYPE STATUS
FROM
PER_ALL_PEOPLE_F PAPF,
PER_PERSON_NAMES_F PPNF,
PER_ALL_ASSIGNMENTS_F PAAF,
HR_LEGAL_ENTITIES HLE,
FUN_ALL_BUSINESS_UNITS_V FAB
WHERE
PAPF.PERSON_ID = PAAF.PERSON_ID
AND PAPF.PERSON_ID = PPNF.PERSON_ID
AND PAAF.BUSINESS_UNIT_ID = FAB.BU_ID
AND PAAF.PRIMARY_FLAG = 'Y'
AND PAAF.ASSIGNMENT_TYPE = 'E'
AND PPNF.NAME_TYPE = 'GLOBAL'
AND TRUNC(SYSDATE) BETWEEN TRUNC(PAPF.EFFECTIVE_START_DATE) AND TRUNC(PAPF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(PAAF.EFFECTIVE_START_DATE) AND TRUNC(PAAF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(PPNF.EFFECTIVE_START_DATE) AND TRUNC(PPNF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(HLE.EFFECTIVE_START_DATE) AND TRUNC(HLE.EFFECTIVE_END_DATE)
AND PAAF.LEGAL_ENTITY_ID = HLE.ORGANIZATION_ID
AND HLE.CLASSIFICATION_CODE = 'HCM_PSU'
AND PAAF.ASSIGNMENT_STATUS_TYPE = 'ACTIVE'
ORDER BY
4
PAPF.PERSON_ID,
PAAF.ASSIGNMENT_ID ASSIGNMENT_ID,
PAAF.ASSIGNMENT_NUMBER ASSIGNMENT_NUMBER,
PAPF.PERSON_NUMBER EMPLOYEE_NUMBER,
PPNF.FULL_NAME EMPLOYEE_NAME,
PAPF.START_DATE HIRE_DATE,
HLE.NAME LEGAL_EMPLOYER,
FAB.BU_NAME BU_NAME,
PAAF.ASSIGNMENT_STATUS_TYPE STATUS
FROM
PER_ALL_PEOPLE_F PAPF,
PER_PERSON_NAMES_F PPNF,
PER_ALL_ASSIGNMENTS_F PAAF,
HR_LEGAL_ENTITIES HLE,
FUN_ALL_BUSINESS_UNITS_V FAB
WHERE
PAPF.PERSON_ID = PAAF.PERSON_ID
AND PAPF.PERSON_ID = PPNF.PERSON_ID
AND PAAF.BUSINESS_UNIT_ID = FAB.BU_ID
AND PAAF.PRIMARY_FLAG = 'Y'
AND PAAF.ASSIGNMENT_TYPE = 'E'
AND PPNF.NAME_TYPE = 'GLOBAL'
AND TRUNC(SYSDATE) BETWEEN TRUNC(PAPF.EFFECTIVE_START_DATE) AND TRUNC(PAPF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(PAAF.EFFECTIVE_START_DATE) AND TRUNC(PAAF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(PPNF.EFFECTIVE_START_DATE) AND TRUNC(PPNF.EFFECTIVE_END_DATE)
AND TRUNC(SYSDATE) BETWEEN TRUNC(HLE.EFFECTIVE_START_DATE) AND TRUNC(HLE.EFFECTIVE_END_DATE)
AND PAAF.LEGAL_ENTITY_ID = HLE.ORGANIZATION_ID
AND HLE.CLASSIFICATION_CODE = 'HCM_PSU'
AND PAAF.ASSIGNMENT_STATUS_TYPE = 'ACTIVE'
ORDER BY
4