Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/data/gtfs/AlertsDao.kt
| Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | interface AlertsDao { | ||||
| @Transaction | @Transaction | ||||
| @Query("SELECT * FROM gtfsrt_alerts WHERE id = :id") | @Query("SELECT * FROM gtfsrt_alerts WHERE id = :id") | ||||
| suspend fun getAlert(id: String): AlertWithDetails? | suspend fun getAlert(id: String): AlertWithDetails? | ||||
| @Transaction | @Transaction | ||||
| @Query(""" | @Query(""" | ||||
| SELECT a.* FROM gtfsrt_alerts a | SELECT a.* FROM gtfsrt_alerts a | ||||
| INNER JOIN alerts_informed_entities ie ON ie.alertId = a.id | INNER JOIN alerts_informed_entities ie ON ie.alertId = a.id | ||||
| WHERE ie.stopId = :stopId | WHERE ie.stopId = :stopGtfsId | ||||
| ORDER BY a.fetchedAt DESC | ORDER BY a.fetchedAt DESC | ||||
| """) | """) | ||||
| fun getAlertsForStop(stopId: String): LiveData<List<AlertWithDetails>> | fun getAlertsForStopGtfsId(stopGtfsId: String): LiveData<List<AlertWithDetails>> | ||||
| @Transaction | @Transaction | ||||
| @Query(""" | @Query(""" | ||||
| SELECT al.* FROM gtfsrt_alerts al | SELECT al.* FROM gtfsrt_alerts al | ||||
| INNER JOIN alerts_informed_entities ie ON ie.alertId = al.id | INNER JOIN alerts_informed_entities ie ON ie.alertId = al.id | ||||
| WHERE ie.routeId = :routeId OR ie.tripRouteId = :routeId | WHERE ie.routeId = :routeId OR ie.tripRouteId = :routeId | ||||
| ORDER BY al.fetchedAt DESC | ORDER BY al.fetchedAt DESC | ||||
| """) | """) | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register