Advertisement
psi_mmobile

Untitled

Aug 23rd, 2022
1,310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 2.09 KB | None | 0 0
  1. SELECT NVL(s.str_value,wcc.name) name,
  2.        wcc.description,
  3.        NVL(uom_s.str_value, uom.short_name) unit_name,
  4.        wcc.is_generic,
  5.        wcc.order_num,
  6.        wcc.allow_absence_request,
  7.        (SELECT json_objectagg(s2.language VALUE s2.str_value) FROM str s2 WHERE s2.str_id = wcc.str_id) "{}counter_name_str_map",
  8.        (SELECT json_objectagg(s3.language VALUE s3.str_value) FROM str s3 WHERE s3.str_id = uom.str_id) "{}unit_name_str_map",
  9.        pwcc.person_id,
  10.        pwcc.lm_date,
  11.        pwcc.lm_name,
  12.        pwcc.from_date,
  13.        pwcc.is_active,
  14.        pwcc.work_code_hr_counter_id,
  15.        P_VOPC_ABSENCE_MANAGMENT.f_compute_person_counter(pwcc.person_id, pwcc.work_code_hr_counter_id) actual_value,
  16.        pwcc.counter_value reference_value,
  17.        wc.graphical_symbol,
  18.        wc.work_code_name,
  19.        wc.work_code_std_id
  20. FROM person_work_code_counter pwcc, work_code_hr_counter wcc, unit_of_measurement uom, gui_users gu, str s, str uom_s, gu_person gp, work_code wc, person p
  21. WHERE pwcc.person_id = NVL(:person_id, pwcc.person_id)
  22. AND (:person_id IS NULL AND gp.gui_user_id IS NOT NULL OR NVL(:person_id, :user_person_id) IS NOT NULL)
  23. AND gu.gui_user_id = gp.gui_user_id (+)
  24. AND gp.person_id (+) = pwcc.person_id
  25. AND pwcc.person_id = p.person_id
  26. AND p.person_status_id = 0
  27. AND pwcc.work_code_hr_counter_id = wcc.work_code_hr_counter_id
  28. AND (gu.gui_user_id = :gui_user_id OR gu.profiled_person_id = :user_person_id)
  29. AND wcc.unit_of_measurement_id = uom.unit_of_measurement_id
  30. AND wcc.work_code_id = wc.work_code_id (+)
  31. AND uom.str_id = uom_s.str_id (+)
  32. AND wcc.str_id = s.str_id (+)
  33. AND gu.language = s.language (+)
  34. AND gu.language = uom_s.language (+)
  35. AND NVL(wcc.is_generic, 'N') = DECODE(:is_generic, 'Y', 'Y', NVL(wcc.is_generic, 'N'))
  36. AND NVL(wcc.allow_absence_request, 'N') = DECODE(:allow_absence_request, 'Y', 'Y', NVL(wcc.allow_absence_request, 'N'))
  37. AND ((:is_generic= 'Y' AND wc.work_code_std_id = 159 AND p.extra_hr9_paid = 'Y') OR (:is_generic = 'Y' AND wc.work_code_std_id != 159) OR (NVL(:is_generic, 'N') = 'N'))
  38.  
  39. ORDER BY pwcc.person_id, wcc.order_num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement