Advertisement
psi_mmobile

Untitled

Oct 25th, 2024
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.23 KB | None | 0 0
  1. SELECT
  2.     poi.poi_id,
  3.     poi.name,
  4.     poi.location,
  5.     poi.post_code,
  6.     poi.street,
  7.     poi.country,
  8.     poi.street_nr,
  9.     poi.oc_poi_status_id,
  10.     pcat.name AS cat_name,
  11.     poi.short_name,
  12.     poi.mobility_zone_id,
  13.     poi.street || ' ' || poi.street_nr || ', ' || poi.post_code || ' ' || poi.location || ' ' || poi.country address
  14. FROM oc_poi poi, oc_poi_category pcat, gui_users gu, wbs w
  15. WHERE gu.operation_center_id = pcat.operation_center_id
  16. AND pcat.oc_poi_category_id = poi.oc_poi_category_id
  17. AND pcat.oc_poi_category_id NOT IN (SELECT pc.home_poi_category_id FROM vo_person_category pc)
  18. AND NVL(poi.oc_poi_status_id, 0) = 0
  19. AND gu.gui_user_id = :gu_id
  20. AND poi.poi_id = w.poi_id(+)
  21. AND EXISTS (SELECT wpr.wbs_person_role_id
  22.             FROM wbs_person wp, wbs_person_role wpr, role r, vo_role vr
  23.             WHERE SYSDATE BETWEEN NVL(wp.from_date, TRUNC(SYSDATE)) AND NVL(wp.TO_DATE, TRUNC(SYSDATE+1))
  24.             AND gu.profiled_person_id = wp.person_id
  25.             AND wpr.wbs_person_id = wp.wbs_person_id
  26.             AND wpr.vo_role_id = vr.vo_role_id
  27.             AND vr.role_id = r.role_id
  28.             AND NVL(vr.validation_status_id, r.validation_status_id) >= 80
  29.             AND w.wbs_id = wp.wbs_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement