Advertisement
psi_mmobile

Untitled

Oct 12th, 2020
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 KB | None | 0 0
  1. SELECT /*+ FIRST_ROWS */
  2. SocialOfficeTransaction.WORK_DATE,
  3. SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID,
  4. SocialOfficeTransaction.POI_TIN,
  5. Wbs.WBS_ID,
  6. SoTransactionStatus.NAME AS SO_TRANSACTION_STATUS_NAME,
  7. SoTransactionStatus.SO_TRANSACTION_STATUS_ID,
  8. SocialOfficeTransaction.CREATION_DATE,
  9. SocialOfficeTransaction.CREATION_USER_NAME,
  10. SocialOfficeTransaction.SO_CREATION_NUMBER,
  11. SocialOfficeTransaction.CANCEL_DATE,
  12. SocialOfficeTransaction.CANCELLATION_USER_NAME,
  13. SocialOfficeTransaction.SO_CANCELLATION_NUMBER,
  14. Person.COMPANY_NR,
  15. Person.PERSON_ID,
  16. Person.FIRST_NAME,
  17. Person.LAST_NAME,
  18. SocialOfficeTransaction.CREATION_GUI_USER_ID,
  19. SocialOfficeTransaction.CANCELLATION_GUI_USER_ID,
  20. SocialOfficeTransaction.PERSON_ID AS PERSON_ID1,
  21. SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID AS SO_TRANSACTION_STATUS_ID1,
  22. SocialOfficeTransaction.WBS_ID AS WBS_ID1,
  23. Wbs.POI_ID,
  24. TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'Dy') AS VIEW_ATTR,
  25. TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'dd') AS VIEW_ATTR,
  26. OcPoi.NAME,
  27. OcPoi.POI_ID AS POI_ID1,
  28. Wbs.REF_NUMBER,
  29. TOUSERDATE (SocialOfficeTransaction.CREATION_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
  30. TOUSERDATE (SocialOfficeTransaction.CANCEL_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
  31. OperationCenter.TIMEZONE,
  32. OperationCenter.OPERATION_CENTER_ID,
  33. VoPersonCategory.NAME AS NAME1,
  34. VoPersonCategory.VO_PERSON_CATEGORY_ID,
  35. VoPersonCategory.GRAPHICAL_SYMBOL,
  36. P_PERSON.list_person_group_name(Person.PERSON_ID) AS VIEW_ATTR,
  37. decode (SocialOfficeTransaction.is_start_time_set, 'N' , '', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone), 'HH24:mi')) AS VIEW_ATTR,
  38. SocialOfficeTransaction.DURATION,
  39. decode (SocialOfficeTransaction.is_start_time_set, 'N', '', DECODE(SIGN(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24 - trunc (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone)+ 1)), 1, '00:00', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24, 'HH24:mi'))) AS VIEW_ATTR,
  40. SocialOfficeTransaction.IS_START_TIME_SET,
  41. TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) AS VIEW_ATTR,
  42. SocialOfficeTransaction.SO_COMMENT,
  43. SocialOfficeTransaction.PLAN_MODE,
  44. p_person.getCompanyName(Person.person_id) AS VIEW_ATTR,
  45. decode ((select v.poi_id from v_gui_user_oc_poi v where v.gui_user_id = GuPerson.gui_user_id and v.poi_id = Wbs.poi_id), null, 'true', 'false') AS VIEW_ATTR,
  46. to_char(TOUSERDATE(SocialOfficeTransaction.work_date,OperationCenter.timezone),'dd/MM/yyyy') AS VIEW_ATTR,
  47. NVL(Str.STR_VALUE,AdminStatusCategory.NAME) AS VIEW_ATTR,
  48. Person.IS_ADMIN_STATUS_OK,
  49. SoTransactionStatus.DESCRIPTION,
  50. P_PERSON.IsDocumentValid(Person.PERSON_ID, 100, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  51. P_PERSON.IsDocumentValid(Person.PERSON_ID, 101, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  52. P_PERSON.IsDocumentValid(Person.PERSON_ID, 102, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  53. P_PERSON.IsDocumentValid(Person.PERSON_ID, 103, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  54. P_PERSON.IsDocumentValid(Person.PERSON_ID, 104, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  55. P_PERSON.IsDocumentValid(Person.PERSON_ID, 105, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  56. P_PERSON.IsDocumentValid(Person.PERSON_ID, 106, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  57. NVL(Str1.STR_VALUE,SoTransactionStatus.DESCRIPTION) AS VIEW_ATTR,
  58. P_PERSON.IsDocumentValid(Person.PERSON_ID, 107, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  59. P_PERSON.IsDocumentValid(Person.PERSON_ID, 108, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  60. P_PERSON.IsDocumentValid(Person.PERSON_ID, 109, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
  61. Person.RANK1_SC_NAME,
  62. Person.RANK1_SC_TIN,
  63. p_person.isAdminProofCatValid(1, Person.PERSON_ID, trunc(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone))) AS VIEW_ATTR,
  64. p_person.isAdminProofCatValid(2, Person.PERSON_ID, trunc(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone))) AS VIEW_ATTR,
  65. p_person.isAdminProofCatValid(3, Person.PERSON_ID, trunc(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone))) AS VIEW_ATTR,
  66. P_PERSON.getAdminProfileCategory(Person.ADMIN_PROFILE_ID) AS VIEW_ATTR,
  67. Person.IS_BLACKLISTED,
  68. (Person.ALL_ADMIN_ATTACH_DOC_VALIDATED) AS VIEW_ATTR,
  69. TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'MM') AS VIEW_ATTR
  70. FROM OF_OWNER.SOCIAL_OFFICE_TRANSACTION SocialOfficeTransaction, OF_OWNER.SO_TRANSACTION_STATUS SoTransactionStatus, WBS Wbs, PERSON Person, OC_POI OcPoi, GUI_USERS GuiUsers, OPERATION_CENTER OperationCenter, GU_PERSON GuPerson, VO_PERSON_CATEGORY VoPersonCategory, OF_OWNER.ADMIN_STATUS_CATEGORY AdminStatusCategory, OF_OWNER.STR Str, OF_OWNER.STR Str1
  71. WHERE SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID = SoTransactionStatus.SO_TRANSACTION_STATUS_ID
  72. AND SoTransactionStatus.STR_ID = Str1.STR_ID(+)
  73. AND GuiUsers.LANGUAGE = Str1.LANGUAGE(+)
  74. AND (p_checkinatwork.getBestWbsIdToDisplay(SocialOfficeTransaction.social_office_transaction_id, guiusers.operation_center_id, NULL) = Wbs.WBS_ID (+))
  75. AND (SocialOfficeTransaction.PERSON_ID = Person.PERSON_ID)
  76. AND (Wbs.POI_ID = OcPoi.POI_ID(+))
  77. and SocialOfficeTransaction.PERSON_ID = GuPerson.person_id
  78. and GuPerson.gui_user_id = ?
  79. and GuiUsers.gui_user_id = GuPerson.gui_user_id
  80. and GuiUsers.Operation_Center_Id = OperationCenter.operation_center_id
  81. and Person.vo_person_category_id = VoPersonCategory.vo_person_category_id
  82. and Person.ADMIN_STATUS_CATEGORY_ID = AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID(+)
  83. and AdminStatusCategory.STR_ID = Str.STR_ID(+)
  84. and GuiUsers.LANGUAGE = Str.LANGUAGE(+)
  85. and SocialOfficeTransaction.work_date between toutcdate(?, OPERATIONCENTER.timezone) and toutcdate(?, OPERATIONCENTER.timezone)
  86. and ( NVL(GuPerson.CAW_LIMITED,'N') = 'N' or (GuPerson.caw_limited = 'Y' and OcPoi.oc_poi_category_id in ( select oc_poi_category_id from oc_poi_category where operation_center_id = guiusers.operation_center_id)))
  87. and (? = -1 or SocialOfficeTransaction.PERSON_ID = ?)
  88. and (? = -1 or Person.Vo_PERSON_CATEGORY_ID = ?)
  89. and ((NVL(?,'N') = 'N' AND NVL(?,'N') = 'N') OR INSTR(DECODE(NVL(?,'N'),'N','','6') || DECODE(NVL(?,'N'),'N','','25'),SoTransactionStatus.SO_TRANSACTION_STATUS_ID) > 0)
  90. and (NVL(?,'N') = 'N' or NVL(Person.IS_ADMIN_STATUS_OK,'N') = 'N')
  91. and upper(NVL(Str.STR_VALUE,AdminStatusCategory.NAME) || ' ' ||
  92. SocialOfficeTransaction.CANCELLATION_USER_NAME || ' ' ||
  93. P_PERSON.getCompanyName(Person.PERSON_ID) || ' ' ||
  94. Person.COMPANY_NR || ' ' ||
  95. SocialOfficeTransaction.CREATION_USER_NAME || ' ' ||
  96. NVL(Str1.STR_VALUE,SoTransactionStatus.DESCRIPTION) || ' ' ||
  97. Person.FIRST_NAME || ' ' ||
  98. Person.LAST_NAME || ' ' ||
  99. Person.FIRST_NAME || ' ' ||
  100. VoPersonCategory.NAME || ' ' ||
  101. P_PERSON.list_person_group_name(Person.PERSON_ID) || ' ' ||
  102. SocialOfficeTransaction.PLAN_MODE || ' ' ||
  103. OcPoi.NAME || ' ' ||
  104. SocialOfficeTransaction.POI_TIN || ' ' ||
  105. Wbs.REF_NUMBER || ' ' ||
  106. SocialOfficeTransaction.SO_COMMENT || ' ' ||
  107. SoTransactionStatus.NAME) like '%' || upper(?) || '%'
  108. ORDER BY SocialOfficeTransaction.WORK_DATE, Person.COMPANY_NR, Person.LAST_NAME, Person.FIRST_NAME, OcPoi.NAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement