Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT /*+ FIRST_ROWS */
- GuPerson.GUI_USER_ID,
- Person.ADMIN_LOGIN,
- Person.ADMIN_PWD,
- Person.ADMIN_RIGHT,
- Person.AGE,
- Person.BIRTH_DATE,
- Person.CAN_DRIVE_WITH_PASSENGERS,
- Person.CAN_DRIVE_WITH_PU,
- Person.COMPANY_NR,
- Person.EMAIL,
- Person.END_WORK_DATE,
- Person.FIRST_NAME,
- Person.GENDER,
- Person.HOME_POI_ID,
- Person.IS_USING_PRIVATE_CAR,
- Person.LANGUAGE,
- Person.LAST_NAME,
- Person.LAST_PERSON_DATA_ID,
- Person.LM_COMMENT,
- Person.LM_DATE,
- Person.LM_NAME,
- Person.MSISDN,
- Person.PERSON_ID,
- Person.PERSON_STATUS_ID,
- Person.PHONE,
- Person.START_WORK_DATE,
- Person.VO_PERSON_CATEGORY_ID,
- Person.WORKING_SCHEDULE_ID,
- PersonData.PERSON_DATA_ID,
- touserdate(nvl(PersonData.EVENT_DATE,to_date('1970','YYYY')),OperationCenter.timezone) AS EVENT_DATE,
- to_char(touserdate(PersonData.EVENT_DATE,OperationCenter.timezone),'dd/mm/yyyy HH24:MI') AS EVENT_DATE,
- VoPersonCategory.VEHICLE_OWNER_ID,
- VoPersonCategory.VO_PERSON_CATEGORY_ID AS VO_PERSON_CATEGORY_ID1,
- OcPoi.WGS84_LATITUDE,
- OcPoi.POI_ID,
- OcPoi.WGS84_LONGITUDE,
- VehicleOwner.VEHICLE_OWNER_ID AS VEHICLE_OWNER_ID1,
- VoPersonCategory.NAME,
- (MvPersonString.key_string) AS KEY_STRING,
- decode(OcPoi.Wgs84_Latitude,null,'N','Y') AS IS_GEOCODED,
- (VehicleData.rg_street_nr || decode(VehicleData.rg_street_nr,null,'',', ') || VehicleData.rg_street || decode(VehicleData.rg_street,null,'',' - ') || VehicleData.rg_post_code || ' ' || VehicleData.rg_location || ' ' || VehicleData.rg_country) AS VEHICLE_DATA_RG_ADRESS,
- p_vd_poi.getPersonDataPoiName(OperationCenter.operation_center_id, PersonData.person_data_id) AS POI_NAME,
- p_vd_poi.getPersonDataPoiId(OperationCenter.operation_center_id, PersonData.PERSON_DATA_ID) AS POI_ID_LIST,
- (MvPersonString.group_names) AS PERSON_GROUP,
- UPPER(Person.LAST_NAME||' '||Person.FIRST_NAME) AS FULLNAME,
- VoPersonCategory.GRAPHICAL_SYMBOL,
- (OcPoi.street_nr || decode(OcPoi.street_nr,null,'',', ') || OcPoi.street || decode(OcPoi.street,null,'',' - ') || OcPoi.post_code || ' ' || OcPoi.location || ' ' || OcPoi.country) AS VIEW_ATTR,
- Person.VEHICLE_PRIVATE_USE_ALLOWED,
- GuiUsers.GUI_USER_ID AS GUI_USER_ID1,
- OperationCenter.OPERATION_CENTER_ID,
- PersonStatus.PERSON_STATUS_ID AS PERSON_STATUS_ID1,
- VehicleData.VEHICLE_DATA_ID,
- Person.NISS,
- Person.LIMOSA,
- GuPerson.PERSON_ID AS PERSON_ID1,
- decode(Person.real_employer_name,null,VehicleOwner.company_name,Person.real_employer_name) AS VIEW_ATTR,
- Person.PERSON_MFRAME_STATUS_ID,
- PersonMframeStatus.GRAPHICAL_SYMBOL AS GRAPHICAL_SYMBOL1,
- PersonMframeStatus.NAME AS NAME1,
- PersonMframeStatus.PERSON_MFRAME_STATUS_ID AS PERSON_MFRAME_STATUS_ID1,
- Str.STR_VALUE,
- Str.STR_ID,
- Str.LANGUAGE AS LANGUAGE1,
- (MvPersonString.planned_wbs) AS VIEW_ATTR,
- Person.IS_WORK_TIME_REPORTED,
- MvMfcMoConnectionStatus.ACTUAL_APP_VERSION,
- MvMfcMoConnectionStatus.EXPECTED_APP_VERSION,
- MvMfcMoConnectionStatus.LAST_APP_CONNECTION,
- MvMfcMoConnectionStatus.MFRAME_LOGIN_NAME,
- MvMfcMoConnectionStatus.MFRAME_LOGIN_PWD,
- MvMfcMoConnectionStatus.MFRAME_VERSION_STATUS,
- MvMfcMoConnectionStatus.PERSON_ID AS PERSON_ID2,
- nvl (MvMfcMoConnectionStatus.mframe_connection_status, '!! Never') AS VIEW_ATTR,
- Person.IS_ADMIN_STATUS_OK,
- GuPerson.CAW_LIMITED,
- Person.ADMIN_STATUS_CATEGORY_ID,
- (mvpersonstring.person_certificates) AS VIEW_ATTR,
- PersonStatus.NAME AS Person_Status_Name,
- AdminStatusCategory.NAME AS ADMIN_STATUS_CATEGORY_NAME,
- AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID AS ADMIN_STATUS_CATEGORY_ID1,
- (case ? when 'Y' then UPPER(Person.last_name) end || ' ' || case ? when 'Y' then UPPER(Person.first_name) end) AS Order_By_Clause,
- Person.IS_BLACKLISTED,
- Person.ERP_COMPANY_CODE,
- Person.RANK1_SC_TIN,
- Person.RANK1_SC_NAME,
- (mvpersonstring.Proof_Of_Identity) AS VIEW_ATTR,
- (mvpersonstring.Proof_Of_Residence) AS VIEW_ATTR,
- (mvpersonstring.Proof_Of_Work) AS VIEW_ATTR,
- (mvpersonstring.Admin_Profile_Category) AS VIEW_ATTR,
- Person.REAL_EMPLOYER_NAME,
- Person.REAL_EMPLOYER_TIN,
- VehicleOwner.COMPANY_TIN,
- VehicleOwner.COMPANY_NAME AS COMPANY_NAME1,
- (mvpersonstring.Qualification) AS VIEW_ATTR,
- Person.PAY_EXTRA_HRD,
- Person.PAY_SATERDAY_HRD,
- MvMfcMoConnectionStatus.APP_NAME,
- Wbs.NAME AS NAME2,
- Wbs.WBS_ID,
- Wbs.REF_NUMBER,
- (mvpersonstring.person_role_list) AS VIEW_ATTR
- FROM GU_PERSON GuPerson, V_UPDATABLE_PERSON Person, PERSON_DATA PersonData, GUI_USERS GuiUsers, OPERATION_CENTER OperationCenter, V_UPDATABLE_VO_PERSON_CATEGORY VoPersonCategory, PERSON_STATUS PersonStatus, OC_POI OcPoi, V_UPDATABLE_VEHICLE_OWNER VehicleOwner, VEHICLE_DATA VehicleData, OF_OWNER.PERSON_MFRAME_STATUS PersonMframeStatus, OF_OWNER.STR Str, OF_OWNER.MV_MFC_MO_CONNECTION_STATUS MvMfcMoConnectionStatus, OF_OWNER.MV_PERSON_STRING MvPersonString, OF_OWNER.ADMIN_STATUS_CATEGORY AdminStatusCategory, V_UPDATABLE_WBS Wbs
- WHERE GuiUsers.GUI_USER_ID = ?
- and Person.person_id = MvPersonString.person_id (+)
- AND GuiUsers.GUI_USER_ID = GuPerson.GUI_USER_ID
- and Person.ADMIN_STATUS_CATEGORY_ID = AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID (+)
- AND GuiUsers.OPERATION_CENTER_ID = OperationCenter.OPERATION_CENTER_ID
- AND GuPerson.PERSON_ID = Person.PERSON_ID
- and Person.VO_PERSON_CATEGORY_ID = VoPersonCategory.VO_PERSON_CATEGORY_ID
- AND VoPersonCategory.VEHICLE_OWNER_ID = VehicleOwner.VEHICLE_OWNER_ID
- and Person.PERSON_STATUS_ID = PersonStatus.PERSON_STATUS_ID
- AND Person.HOME_POI_ID = OcPoi.POI_ID(+)
- and Person.DEFAULT_WORK_WBS_ID = Wbs.WBS_ID(+)
- AND PersonData.PERSON_DATA_ID(+) = Person.LAST_PERSON_DATA_ID
- AND VehicleData.VEHICLE_DATA_ID(+) = PersonData.VEHICLE_DATA_ID
- AND ( ( ( ? IS NULL
- OR ? = ''
- OR Person.VO_PERSON_CATEGORY_ID IN
- (SELECT regexp_substr(?,'[^,]+', 1, level)
- FROM dual
- CONNECT BY regexp_substr(?, '[^,]+', 1, level) IS NOT NULL
- ) )
- AND NVL (caw_limited, 'N') = 'N' )
- OR ( ? = 'Y'
- AND caw_limited = 'Y' ))
- AND (Person.PERSON_STATUS_ID=0 or (Person.person_status_id != 2 and ? ='true'))
- AND Person.PERSON_MFRAME_STATUS_ID = PersonMframeStatus.PERSON_MFRAME_STATUS_ID(+)
- AND PersonMframeStatus.STR_ID = Str.STR_ID (+)
- AND GuiUsers.LANGUAGE = Str.LANGUAGE (+)
- and person.person_id = MvMfcMoConnectionStatus.person_id (+)
- and ( nvl (?, -1) = -1 OR Person.PERSON_ID in (select distinct c.person_id from certificate c where c.certificate_type_id in
- (SELECT regexp_substr(?,'[^,]+', 1, level)
- FROM dual
- CONNECT BY regexp_substr(?, '[^,]+', 1, level) IS NOT NULL
- )
- ))
- and (upper (MvPersonString.person_id_string || ' ' || PERSON.last_Name || ' ' || Person.first_name || ' ' || Person.last_name || ' ' || Person.company_nr || ' ' || VehicleData.rg_street_nr || ' ' || decode(VehicleData.rg_street_nr,null,'',', ') || VehicleData.rg_street || decode(VehicleData.rg_street,null,'',' - ') || VehicleData.rg_post_code || ' ' || VehicleData.rg_location || ' ' || VehicleData.rg_country || ' ' || VehicleOwner.COMPANY_TIN || ' ' || Person.RANK1_SC_NAME || ' ' || Person.RANK1_SC_TIN || ' ' || Wbs.NAME || ' ' || Wbs.REF_NUMBER || ' ' || MvMfcMoConnectionStatus.APP_NAME || ' ' || MvMfcMoConnectionStatus.MFRAME_LOGIN_NAME || ' ' MvMfcMoConnectionStatus.APP_NAME || ' ' || MvMfcMoConnectionStatus.MFRAME_LOGIN_PWD || ' ' || AdminStatusCategory.NAME || ' ' || mvpersonstring.person_role_list || ' ' || p_vd_poi.getPersonDataPoiName(OperationCenter.operation_center_id, PersonData.person_data_id)) like '%' || upper (?) || '%')
- ORDER BY Order_By_Clause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement