Actors
- Signed-in User
Steps
- The user logs into the system
- The user clicks on the ‘My Trips’ tab
SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
FROM ticket as tick
JOIN trip on trip.trip_id = tick.trip_id
JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
JOIN route as r ON trip.route_id = r.route_id
JOIN location as lf on r.from_location_id = lf.location_id
JOIN location as lt on r.to_location_id = lt.location_id
JOIN trip_stops as stop on lf.location_id = stop.location_id
WHERE tick.account_id = {account_lists_id};
- (Optional) The user selects a status on which to filter their trips. By default, all trips are displayed.
- (Optional) The user selects a company on which to filter their trips. By default, all trips are displayed.
- (Optional) The user selects a date range in which their trips were completed. By default, all trips are displayed.
SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
FROM ticket as tick
JOIN trip on trip.trip_id = tick.trip_id
JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
JOIN route as r ON trip.route_id = r.route_id
JOIN location as lf on r.from_location_id = lf.location_id
JOIN location as lt on r.to_location_id = lt.location_id
JOIN trip_stops as stop on lf.location_id = stop.location_id
WHERE tick.account_id = {account_lists_id}
AND ({selected_status} IS NULL OR tick.status = {selected_status})
AND ({before_date} IS NULL OR trip.date < {before_date})
AND ({after_date} IS NULL OR trip.date > {after_date})
AND ({selected_company_name} IS NULL OR t_o.company_name = {selected_company_name});
- The user is displayed their trips.
Last modified
10 months ago
Last modified on 01/13/25 16:27:04
Note:
See TracWiki
for help on using the wiki.
