public interface AggregatedTrajectoryRepository extends org.springframework.data.repository.PagingAndSortingRepository<AggregatedTrajectory,java.util.UUID>
Modifier and Type | Method and Description |
---|---|
java.util.Optional<AggregatedTrajectory> |
findByAreaIdAndTimeAndFromXAndFromYAndToXAndToY(java.util.UUID areaId,
java.time.Instant time,
int fromX,
int fromY,
int toX,
int toY) |
java.lang.Iterable<AggregatedTrajectoryView> |
getFilteredTrajectories(java.util.UUID monitoredAreaID,
boolean filterBySince,
java.time.Instant since,
boolean filterByUntil,
java.time.Instant until,
double minVelocity,
double maxVelocity)
Returns aggregated trajectories filtered by the given criteria
The filterBySince and filterByUntil parameters are needed due to known bugs in the
Hibernate adapter for PostgreSQL
|
java.util.Optional<AggregatedTrajectory> findByAreaIdAndTimeAndFromXAndFromYAndToXAndToY(java.util.UUID areaId, java.time.Instant time, int fromX, int fromY, int toX, int toY)
@Query(value="select new smartmobility.entity.views.AggregatedTrajectoryView(at.fromX, at.fromY, at.toX, at.toY, sum(at.weight)) from AggregatedTrajectory at where at.area.id = ?1 and (?2 = false or at.time >= ?3) and (?4 = false or at.time < ?5) and at.speed >= ?6 and (?7 = -1.0 or at.speed <= ?7) group by at.fromX, at.fromY, at.toX, at.toY") java.lang.Iterable<AggregatedTrajectoryView> getFilteredTrajectories(java.util.UUID monitoredAreaID, boolean filterBySince, java.time.Instant since, boolean filterByUntil, java.time.Instant until, double minVelocity, double maxVelocity)
monitoredAreaID
- the ID of the monitored are whose trajectories should be returnedfilterBySince
- true if since is null, false otherwisesince
- the time since when trajectories should be returnedfilterByUntil
- true if after is null, false otherwiseuntil
- the time until when trajectories should be returnedminVelocity
- minimum speed in pixels per second, points at which the speed was
lower will not be returnedmaxVelocity
- maximum speed in pixels per second (-1 for unlimited), points at
which the speed was higher will not be returned