psi_mmobile

Untitled

May 26th, 2026
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. select /*+ INDEX (PERSON_DATA I_PD_GPSFULLDATE)*/
  2. gu.gui_user_id,
  3. fu.fixed_unit_id,
  4. '['||fu.name||']' vehicle_name,
  5. vd1.gps_full_date,
  6. vd1.vehicle_data_id event_id,
  7. touserdate(nvl(vd1.gps_full_date,to_date('1970','YYYY')),oc.timezone) event_date,
  8. to_char(touserdate(vd1.gps_full_date,oc.timezone),'dd/mm/yyyy HH24:MI') event_date_str,
  9. str.str_value event_type,
  10. decode ( ocet.graphical_symbol, 'Key', decode (fu.fixed_unit_usage_id,5, 'key_blue_out', 4, 'key_blue_in', ocet.graphical_symbol), ocet.graphical_symbol) graphical_symbol,
  11. null total_km,
  12. 0 Intervalle_km,
  13. to_char(vd1.hour_counter/60, '999999') total_hr,
  14. vd1.rg_street_nr || decode(vd1.rg_street_nr,null,'',', ') || vd1.rg_street || decode(vd1.rg_street,null,'',' - ') || vd1.rg_post_code || ' ' || vd1.rg_location || ' ' || vd1.rg_country VEHICLE_DATA_RG_ADRESS,
  15. vd1.wgs84_latitude, vd1.wgs84_longitude,
  16. vd1.speed_over_ground VEHICLE_DATA_SPEED,
  17. et.event_type_id,
  18. vd1.ignition,
  19. p_vd_poi.getPersonDataPoiId(oc.operation_center_id, pd.person_data_id) AS POI_ID_LIST,
  20. p_vd_poi.getPersonDataPoiName(oc.operation_center_id, pd.person_data_id) poi_name,
  21. -- null poi_name,
  22. vd1.vehicle_activity_id,
  23. person.person_id,
  24. decode(person.person_id,null,vd1.driver_identifier,DECODE(person.company_nr,NULL,'', person.company_nr
  25. || ' ')
  26. || person.last_name
  27. || ' '
  28. || person.first_name) person_name,
  29. pd.home_poi_km,
  30. vd1.driver_identifier,
  31. vd1.satellite
  32. from gui_users gu, operation_center oc, vehicle_data vd1, remote_unit ru, fixed_unit fu,
  33. event_type et, oc_event_type ocet, str, person_data pd, person
  34. where gu.operation_center_id = oc.operation_center_id
  35. --and vd1.vehicle_id is null
  36. and vd1.remote_unit_id = ru.remote_unit_id
  37. and fu.remote_unit_id = ru.remote_unit_id
  38. and vd1.event_type_id = et.event_type_id
  39. and ocet.operation_center_id = oc.operation_center_id
  40. and ocet.event_type_id = et.event_type_id
  41. and ocet.str_id = str.str_id
  42. and gu.language = str.language
  43. and vd1.vehicle_data_id = pd.vehicle_data_id(+)
  44. and pd.person_id = person.person_id(+)
  45. and fu.fixed_unit_id=?
  46. AND touserdate(vd1.gps_full_date,oc.timezone) >= ?
  47. AND touserdate(vd1.gps_full_date,oc.timezone) <= ?
  48. and gu.gui_user_id=?
  49. and (person.person_id is null or person.person_id in (select person_id from gu_person where gui_user_id=?))
  50. ORDER BY gps_full_date desc, event_id desc
Advertisement
Add Comment
Please, Sign In to add comment