Advertisement
psi_mmobile

Untitled

Aug 17th, 2021
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. SELECT /*+ FIRST_ROWS */
  2. GuPerson.GUI_USER_ID,
  3. Person.ADMIN_LOGIN,
  4. Person.ADMIN_PWD,
  5. Person.ADMIN_RIGHT,
  6. Person.AGE,
  7. Person.BIRTH_DATE,
  8. Person.CAN_DRIVE_WITH_PASSENGERS,
  9. Person.CAN_DRIVE_WITH_PU,
  10. Person.COMPANY_NR,
  11. Person.EMAIL,
  12. Person.END_WORK_DATE,
  13. Person.FIRST_NAME,
  14. Person.GENDER,
  15. Person.HOME_POI_ID,
  16. Person.IS_USING_PRIVATE_CAR,
  17. Person.LANGUAGE,
  18. Person.LAST_NAME,
  19. Person.LAST_PERSON_DATA_ID,
  20. Person.LM_COMMENT,
  21. Person.LM_DATE,
  22. Person.LM_NAME,
  23. Person.MSISDN,
  24. Person.PERSON_ID,
  25. Person.PERSON_STATUS_ID,
  26. Person.PHONE,
  27. Person.START_WORK_DATE,
  28. Person.VO_PERSON_CATEGORY_ID,
  29. Person.WORKING_SCHEDULE_ID,
  30. PersonData.PERSON_DATA_ID,
  31. touserdate(nvl(PersonData.EVENT_DATE,to_date('1970','YYYY')),OperationCenter.timezone) AS EVENT_DATE,
  32. to_char(touserdate(PersonData.EVENT_DATE,OperationCenter.timezone),'dd/mm/yyyy HH24:MI') AS EVENT_DATE,
  33. VoPersonCategory.VEHICLE_OWNER_ID,
  34. VoPersonCategory.VO_PERSON_CATEGORY_ID AS VO_PERSON_CATEGORY_ID1,
  35. OcPoi.WGS84_LATITUDE,
  36. OcPoi.POI_ID,
  37. OcPoi.WGS84_LONGITUDE,
  38. VehicleOwner.VEHICLE_OWNER_ID AS VEHICLE_OWNER_ID1,
  39. VoPersonCategory.NAME,
  40. (MvPersonString.key_string) AS KEY_STRING,
  41. decode(OcPoi.Wgs84_Latitude,null,'N','Y') AS IS_GEOCODED,
  42. (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,
  43. p_vd_poi.getPersonDataPoiName(OperationCenter.operation_center_id, PersonData.person_data_id) AS POI_NAME,
  44. p_vd_poi.getPersonDataPoiId(OperationCenter.operation_center_id, PersonData.PERSON_DATA_ID) AS POI_ID_LIST,
  45. (MvPersonString.group_names) AS PERSON_GROUP,
  46. UPPER(Person.LAST_NAME||' '||Person.FIRST_NAME) AS FULLNAME,
  47. VoPersonCategory.GRAPHICAL_SYMBOL,
  48. (OcPoi.street_nr || decode(OcPoi.street_nr,null,'',', ') || OcPoi.street || decode(OcPoi.street,null,'',' - ') || OcPoi.post_code || ' ' || OcPoi.location || ' ' || OcPoi.country) AS VIEW_ATTR,
  49. Person.VEHICLE_PRIVATE_USE_ALLOWED,
  50. GuiUsers.GUI_USER_ID AS GUI_USER_ID1,
  51. OperationCenter.OPERATION_CENTER_ID,
  52. PersonStatus.PERSON_STATUS_ID AS PERSON_STATUS_ID1,
  53. VehicleData.VEHICLE_DATA_ID,
  54. Person.NISS,
  55. Person.LIMOSA,
  56. GuPerson.PERSON_ID AS PERSON_ID1,
  57. decode(Person.real_employer_name,null,VehicleOwner.company_name,Person.real_employer_name) AS VIEW_ATTR,
  58. Person.PERSON_MFRAME_STATUS_ID,
  59. PersonMframeStatus.GRAPHICAL_SYMBOL AS GRAPHICAL_SYMBOL1,
  60. PersonMframeStatus.NAME AS NAME1,
  61. PersonMframeStatus.PERSON_MFRAME_STATUS_ID AS PERSON_MFRAME_STATUS_ID1,
  62. Str.STR_VALUE,
  63. Str.STR_ID,
  64. Str.LANGUAGE AS LANGUAGE1,
  65. (MvPersonString.planned_wbs) AS VIEW_ATTR,
  66. Person.IS_WORK_TIME_REPORTED,
  67. MvMfcMoConnectionStatus.ACTUAL_APP_VERSION,
  68. MvMfcMoConnectionStatus.EXPECTED_APP_VERSION,
  69. MvMfcMoConnectionStatus.LAST_APP_CONNECTION,
  70. MvMfcMoConnectionStatus.MFRAME_LOGIN_NAME,
  71. MvMfcMoConnectionStatus.MFRAME_LOGIN_PWD,
  72. MvMfcMoConnectionStatus.MFRAME_VERSION_STATUS,
  73. MvMfcMoConnectionStatus.PERSON_ID AS PERSON_ID2,
  74. nvl (MvMfcMoConnectionStatus.mframe_connection_status, '!! Never') AS VIEW_ATTR,
  75. Person.IS_ADMIN_STATUS_OK,
  76. GuPerson.CAW_LIMITED,
  77. Person.ADMIN_STATUS_CATEGORY_ID,
  78. (mvpersonstring.person_certificates) AS VIEW_ATTR,
  79. PersonStatus.NAME AS Person_Status_Name,
  80. AdminStatusCategory.NAME AS ADMIN_STATUS_CATEGORY_NAME,
  81. AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID AS ADMIN_STATUS_CATEGORY_ID1,
  82. (case ? when 'Y' then UPPER(Person.last_name) end || ' ' || case ? when 'Y' then UPPER(Person.first_name) end) AS Order_By_Clause,
  83. Person.IS_BLACKLISTED,
  84. Person.ERP_COMPANY_CODE,
  85. Person.RANK1_SC_TIN,
  86. Person.RANK1_SC_NAME,
  87. (mvpersonstring.Proof_Of_Identity) AS VIEW_ATTR,
  88. (mvpersonstring.Proof_Of_Residence) AS VIEW_ATTR,
  89. (mvpersonstring.Proof_Of_Work) AS VIEW_ATTR,
  90. (mvpersonstring.Admin_Profile_Category) AS VIEW_ATTR,
  91. Person.REAL_EMPLOYER_NAME,
  92. Person.REAL_EMPLOYER_TIN,
  93. VehicleOwner.COMPANY_TIN,
  94. VehicleOwner.COMPANY_NAME AS COMPANY_NAME1,
  95. (mvpersonstring.Qualification) AS VIEW_ATTR,
  96. Person.PAY_EXTRA_HRD,
  97. Person.PAY_SATERDAY_HRD,
  98. MvMfcMoConnectionStatus.APP_NAME,
  99. Wbs.NAME AS NAME2,
  100. Wbs.WBS_ID,
  101. Wbs.REF_NUMBER,
  102. (mvpersonstring.person_role_list) AS VIEW_ATTR
  103. 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
  104. WHERE GuiUsers.GUI_USER_ID = ?
  105. and Person.person_id = MvPersonString.person_id (+)
  106. AND GuiUsers.GUI_USER_ID = GuPerson.GUI_USER_ID
  107. and Person.ADMIN_STATUS_CATEGORY_ID = AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID (+)
  108. AND GuiUsers.OPERATION_CENTER_ID = OperationCenter.OPERATION_CENTER_ID
  109. AND GuPerson.PERSON_ID = Person.PERSON_ID
  110. and Person.VO_PERSON_CATEGORY_ID = VoPersonCategory.VO_PERSON_CATEGORY_ID
  111. AND VoPersonCategory.VEHICLE_OWNER_ID = VehicleOwner.VEHICLE_OWNER_ID
  112. and Person.PERSON_STATUS_ID = PersonStatus.PERSON_STATUS_ID
  113. AND Person.HOME_POI_ID = OcPoi.POI_ID(+)
  114. and Person.DEFAULT_WORK_WBS_ID = Wbs.WBS_ID(+)
  115. AND PersonData.PERSON_DATA_ID(+) = Person.LAST_PERSON_DATA_ID
  116. AND VehicleData.VEHICLE_DATA_ID(+) = PersonData.VEHICLE_DATA_ID
  117. AND ( ( ( ? IS NULL
  118. OR ? = ''
  119. OR Person.VO_PERSON_CATEGORY_ID IN
  120. (SELECT regexp_substr(?,'[^,]+', 1, level)
  121. FROM dual
  122. CONNECT BY regexp_substr(?, '[^,]+', 1, level) IS NOT NULL
  123. ) )
  124. AND NVL (caw_limited, 'N') = 'N' )
  125. OR ( ? = 'Y'
  126. AND caw_limited = 'Y' ))
  127. AND (Person.PERSON_STATUS_ID=0 or (Person.person_status_id != 2 and ? ='true'))
  128. AND Person.PERSON_MFRAME_STATUS_ID = PersonMframeStatus.PERSON_MFRAME_STATUS_ID(+)
  129. AND PersonMframeStatus.STR_ID = Str.STR_ID (+)
  130. AND GuiUsers.LANGUAGE = Str.LANGUAGE (+)
  131. and person.person_id = MvMfcMoConnectionStatus.person_id (+)
  132. and ( nvl (?, -1) = -1 OR Person.PERSON_ID in (select distinct c.person_id from certificate c where c.certificate_type_id in
  133. (SELECT regexp_substr(?,'[^,]+', 1, level)
  134. FROM dual
  135. CONNECT BY regexp_substr(?, '[^,]+', 1, level) IS NOT NULL
  136. )
  137. ))
  138.  
  139. 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 (?) || '%')
  140. ORDER BY Order_By_Clause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement