public interface ZoneSequenceStatisticsRepository extends org.springframework.data.repository.PagingAndSortingRepository<ZoneSequenceStatistics,java.util.UUID>
Modifier and Type | Method and Description |
---|---|
<T> java.lang.Iterable<T> |
findAllProjectedBy(java.lang.Class<T> type) |
java.lang.Iterable<ZoneSequenceStatistics> |
findAreaStatisticsByZoneSequenceIdAndTime(java.util.UUID zoneSequenceID,
java.time.Instant since,
java.time.Instant until)
Returns statistics for the given time interval and ZoneSequence
|
java.lang.Iterable<TransitStatistics> |
getActiveTransitCountByMonitoredAreaIdAndTime(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until)
Returns an iterable that contains the number of vehicles that passed through active zones in
the given area during the given time interval, broken down per zone sequence
|
int |
getTotalVehiclePassed(java.util.UUID zoneSequenceID,
java.time.Instant since,
java.time.Instant until)
Returns the number of vehicles passed during the given time interval via the
given ZoneSequence
|
java.lang.Iterable<TransitStatistics> |
getTransitCountByMonitoredAreaIdAndTime(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until)
Returns an iterable that contains the number of vehicles that passed through the given
area during the given time interval, broken down per zone sequence
|
@Query(value="select coalesce(sum(s.vehiclePassed), 0) from ZoneSequenceStatistics s where s.zoneSequence.id = ?1 and s.timeSince >= ?2 and s.timeSince < ?3") int getTotalVehiclePassed(java.util.UUID zoneSequenceID, java.time.Instant since, java.time.Instant until)
zoneSequenceID
- the zone sequencesince
- the start of the time intervaluntil
- the end of the time interval@Query(value="select s from ZoneSequenceStatistics s where s.zoneSequence.id = ?1 and s.timeSince >= ?2 and s.timeSince < ?3 order by s.timeSince asc") java.lang.Iterable<ZoneSequenceStatistics> findAreaStatisticsByZoneSequenceIdAndTime(java.util.UUID zoneSequenceID, java.time.Instant since, java.time.Instant until)
zoneSequenceID
- the zone sequencesince
- the start of the time intervaluntil
- the end of the time interval<T> java.lang.Iterable<T> findAllProjectedBy(java.lang.Class<T> type)
@Query(value="select new smartmobility.entity.views.TransitStatistics(zs.zoneNumbers, coalesce(sum(s.vehiclePassed), 0)) from ZoneSequence zs join ZoneSequenceStatistics s on s.zoneSequence.id = zs.id where zs.area.id = ?1 and (cast(?2 as timestamp) is null or s.timeSince >= ?2) and (cast(?3 as timestamp) is null or s.timeSince < ?3) group by zs") java.lang.Iterable<TransitStatistics> getTransitCountByMonitoredAreaIdAndTime(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until)
monitoredAreaID
- the ID of the areasince
- the start of the time intervaluntil
- the end of the time interval@Query(value="select new smartmobility.entity.views.TransitStatistics(zs.zoneNumbers, coalesce(sum(s.vehiclePassed), 0)) from ZoneSequence zs join ZoneSequenceStatistics s on s.zoneSequence.id = zs.id where zs.area.id = ?1 and zs.active = true and (cast(?2 as timestamp) is null or s.timeSince >= ?2) and (cast(?3 as timestamp) is null or s.timeSince < ?3) group by zs") java.lang.Iterable<TransitStatistics> getActiveTransitCountByMonitoredAreaIdAndTime(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until)
monitoredAreaID
- the ID of the areasince
- the start of the time intervaluntil
- the end of the time interval