fix time range for carbs

This commit is contained in:
Milos Kozak 2021-10-30 14:27:25 +02:00
parent 1dd64b5958
commit 345a57da09

View file

@ -45,7 +45,7 @@ internal interface CarbsDao : TraceableDao<Carbs> {
@Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp >= :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC")
fun getCarbsFromTimeToTime(from: Long, to: Long): Single<List<Carbs>>
@Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp + duration >= :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC")
@Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp + duration > :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC")
fun getCarbsFromTimeToTimeExpandable(from: Long, to: Long): Single<List<Carbs>>
@Query("SELECT * FROM $TABLE_CARBS WHERE timestamp >= :timestamp AND referenceId IS NULL ORDER BY id DESC")