fix SQL query
This commit is contained in:
parent
6bc992695a
commit
85df281b73
|
@ -31,7 +31,7 @@ internal interface EffectiveProfileSwitchDao : TraceableDao<EffectiveProfileSwit
|
|||
@Query("SELECT * FROM $TABLE_EFFECTIVE_PROFILE_SWITCHES WHERE nightscoutId = :nsId AND referenceId IS NULL")
|
||||
fun findByNSId(nsId: String): EffectiveProfileSwitch?
|
||||
|
||||
@Query("SELECT * FROM $TABLE_EFFECTIVE_PROFILE_SWITCHES WHERE isValid = 1 AND referenceId IS NULL ORDER BY id ASC LIMIT 1")
|
||||
@Query("SELECT * FROM $TABLE_EFFECTIVE_PROFILE_SWITCHES WHERE isValid = 1 AND referenceId IS NULL ORDER BY timestamp ASC LIMIT 1")
|
||||
fun getOldestEffectiveProfileSwitchRecord(): EffectiveProfileSwitch?
|
||||
|
||||
@Query("SELECT * FROM $TABLE_EFFECTIVE_PROFILE_SWITCHES WHERE :timestamp >= timestamp AND referenceId IS NULL AND isValid = 1 ORDER BY timestamp DESC LIMIT 1")
|
||||
|
|
|
@ -43,7 +43,7 @@ internal interface TherapyEventDao : TraceableDao<TherapyEvent> {
|
|||
@Query("SELECT * FROM $TABLE_THERAPY_EVENTS WHERE timestamp >= :timestamp AND referenceId IS NULL ORDER BY timestamp ASC")
|
||||
fun getTherapyEventDataIncludingInvalidFromTime(timestamp: Long): Single<List<TherapyEvent>>
|
||||
|
||||
@Query("SELECT * FROM $TABLE_THERAPY_EVENTS WHERE type = :type AND isValid = 1 AND timestamp <= :now ORDER BY id DESC LIMIT 1")
|
||||
@Query("SELECT * FROM $TABLE_THERAPY_EVENTS WHERE type = :type AND isValid = 1 AND timestamp <= :now ORDER BY timestamp DESC LIMIT 1")
|
||||
fun getLastTherapyRecord(type: TherapyEvent.Type, now: Long): Maybe<TherapyEvent>
|
||||
|
||||
@Query("SELECT * FROM $TABLE_THERAPY_EVENTS WHERE timestamp >= :timestamp AND isValid = 1 AND referenceId IS NULL ORDER BY timestamp ASC")
|
||||
|
|
Loading…
Reference in a new issue