Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT * FROM(
- SELECT gui_users.operation_center_id,
- gui_users.gui_user_id,
- person_data.person_id,
- person_data.person_data_id,
- vehicle_data.vehicle_data_id,
- event_date,
- TO_CHAR(touserdate(person_data.event_date,oc.timezone), 'dd/mm/yyyy HH24:MI') event_date_str,
- person_data.event_type event_type_hard,
- NULL event_name,
- v.vehicle_id,
- v.numberplate vehicle_numberplate,
- v.company_nr vehicle_company_nr,
- DECODE (v.vehicle_id, NULL, GETFIXEDUNITNAME(vehicle_data.remote_unit_id), TRIM(DECODE(v.company_nr, NULL, '', v.company_nr
- || ' - ')
- || v.numberplate)) VEHICLE_NAME,
- DECODE(str.event_type_id, 103, DECODE(p_person.getKeyCodeInfo(vehicle_data.vehicle_data_id), ' ', 'key_manual', str.graphical_symbol),DECODE(str.graphical_symbol,NULL,DECODE(person_data.event_type,'mtrs','intervention',NULL),str.graphical_symbol)) graphical_symbol,
- DECODE(str.event_type_id, 103, str.str_value
- ||': '
- ||p_person.getKeyCodeInfo(vehicle_data.vehicle_data_id), 114, str.str_value, DECODE(str.str_value,NULL,DECODE(person_data.event_type,'mtrs','Easytraxx',NULL),str.str_value)) event_type,
- vehicle_data.total_distance + NVL(v.ru_install_km,0) total_km,
- TO_CHAR(vehicle_data.hour_counter/60, '999999') total_hr,
- vehicle_data.rg_street_nr
- || DECODE(vehicle_data.rg_street_nr,NULL,'',', ')
- || vehicle_data.rg_street
- || DECODE(vehicle_data.rg_street,NULL,'',' - ')
- || vehicle_data.rg_post_code
- || ' '
- || vehicle_data.rg_location
- || ' '
- || vehicle_data.rg_country VEHICLE_DATA_RG_ADRESS,
- vehicle_data.speed_over_ground VEHICLE_DATA_SPEED,
- DECODE(vehicle_data.vehicle_id, NULL, p_vd_poi.getHistPersonDataPoiName(oc.operation_center_id, person_data.person_data_id), p_vd_poi.getHistVehicleDataPoiName(oc.operation_center_id, vehicle_data.vehicle_data_id)) poi_name,
- DECODE(vehicle_data.vehicle_id, NULL, p_vd_poi.getHistPersonDataPoiId(oc.operation_center_id, person_data.PERSON_DATA_ID), p_vd_poi.getHistVehicleDataPoiId(oc.operation_center_id, vehicle_data.VEHICLE_DATA_ID)) AS POI_ID_LIST,
- vehicle_data.wgs84_latitude,
- vehicle_data.wgs84_longitude,
- person_data.comments,
- vehicle_data.wgs84_latitude AS Wgs84Latitude,
- vehicle_data.wgs84_longitude AS wgs84longitude,
- str.event_type_id
- FROM operation_center oc,
- gui_users,
- gu_person,
- hist_person_data person_data,
- hist_vehicle_data vehicle_data,
- vehicle v,
- (SELECT
- et.event_type_id,
- ocet.operation_center_id,
- str.language,
- str_value,
- et.graphical_symbol
- FROM
- operation_center oc,
- gui_users,
- event_type et,
- oc_event_type ocet,
- str
- WHERE ocet.event_type_id = et.event_type_id
- AND ocet.str_id = str.str_id
- AND oc.operation_center_id = gui_users.operation_center_id
- AND gui_users.language = str.language
- AND ocet.operation_center_id = oc.operation_center_id
- AND gui_users.gui_user_id = 101048
- ) str
- WHERE oc.operation_center_id = gui_users.operation_center_id
- AND gui_users.gui_user_id = gu_person.gui_user_id
- AND gu_person.person_id = person_data.person_id
- AND person_data.vehicle_data_id = vehicle_data.vehicle_data_id(+)
- AND vehicle_data.vehicle_id = v.vehicle_id(+)
- AND person_data.event_type IS NOT NULL
- AND vehicle_data.event_type_id = str.event_type_id(+)
- AND gui_users.gui_user_id=101048
- )
- WHERE PERSON_ID = 107162
- AND TO_CHAR(event_date,'yyyy') = '2019'
- ORDER BY event_date ASC, person_data_id ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement