Advertisement
psi_mmobile

Untitled

Jul 28th, 2022
1,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 2.11 KB | None | 0 0
  1. --default store place
  2. SELECT esp.equipment_store_place_id,esp.company_nr,esp.name,esp.description,v.company_nr vehicle_company_nr,op.name poi_name,vo.company_name
  3. FROM equipment_store_place esp, vehicle v, oc_poi op, vehicle_owner vo
  4. WHERE esp.vehicle_id = v.vehicle_id(+)
  5. AND esp.oc_poi_id=op.poi_id(+)
  6. AND esp.vehicle_owner_id = vo.vehicle_owner_id
  7. AND vo.vehicle_owner_id = ?
  8. ORDER BY 2;
  9.  
  10. --default poi tin / wbs
  11. SELECT P_WBS.getWbsName(Wbs.WBS_ID, VGuiUserOcPoi.POI_ID) AS WBS_NAME,
  12.        Wbs.WBS_ID,
  13.        wbs.poi_tin,
  14.        wbs.poi_id
  15. FROM V_GUI_USER_OC_POI VGuiUserOcPoi, WBS Wbs
  16. WHERE (VGuiUserOcPoi.POI_ID = Wbs.POI_ID)
  17. AND (Wbs.WBS_LEVEL IS NULL OR Wbs.WBS_LEVEL=1 OR (Wbs.WBS_LEVEL=0 AND NOT EXISTS (SELECT w.wbs_id FROM WBS w WHERE w.wbs_level=1 AND w.poi_id=Wbs.poi_id)))
  18. AND VGuiUserOcPoi.GUI_USER_ID = ?
  19. AND VGuiUserOcPoi.oc_poi_status_id = 0
  20. AND wbs.wbs_id IS NOT NULL
  21. AND wbs.poi_tin IS NOT NULL
  22.  
  23.  
  24. UNION
  25.  
  26. SELECT (Wbs.NAME || ' ' || Wbs.REF_NUMBER) AS WBS_NAME,
  27.        Wbs.WBS_ID,
  28.        NULL,
  29.        NULL
  30. FROM WBS Wbs, GUI_USERS GuiUsers
  31. WHERE Wbs.operation_center_id = GuiUsers.operation_center_id
  32. AND Wbs.is_project = 'Y'
  33. AND Wbs.wbs_status_id = 0
  34.  AND GuiUsers.gui_user_id = ?
  35. AND wbs.name NOT LIKE 'Template%'
  36. ORDER BY WBS_NAME;
  37.  
  38. --qualification
  39. SELECT q2.qualification_id,  
  40. q1.short_code group_code,
  41. q1.name group_name,
  42. q2.short_code qualification_code,
  43. q2.name qualification_name, TRIM(q2.short_code || ' ' || q2.name) qualification
  44. FROM qualification q1, qualification q2
  45. WHERE q1.vehicle_owner_id = ?
  46. AND q1.qualification_id = q2.parent_qualification_id
  47. AND NVL(q1.is_active,'Y') = 'Y'
  48. AND NVL(q2.is_active,'Y') = 'Y'
  49. ORDER BY q1.order_num, group_code, group_name, q2.order_num, qualification_code, qualification_name;
  50.  
  51. -- hiring point
  52. SELECT VGuiUserOcPoi.poi_id,  vpc.vo_person_category_id,  VGuiUserOcPoi.name, VGuiUserOcPoi.short_name
  53.  FROM V_GUI_USER_OC_POI  VGuiUserOcPoi, vo_person_category vpc
  54. WHERE
  55.  VGuiUserOcPoi.oc_poi_category_id = vpc.hiring_p_oc_poi_category_id
  56. AND VGuiUserOcPoi.OC_POI_STATUS_ID IN (0,3)
  57. AND (VGuiUserOcPoi.gui_user_id = ?)
  58. ORDER BY name;
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement