package Ġcom . mob . lee . fast air . db Ċ Ċ import Ġandroidx . room . Dao Ċ import Ġandroidx . room . Delete Ċ import Ġandroidx . room . Insert Ċ import Ġandroidx . room . On Conflict Strategy Ċ import Ġandroidx . room . Query Ċ import Ġandroidx . room . Update Ċ import Ġcom . mob . lee . fast air . model . Record Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠAnd y Ġon Ġ 2 0 1 7 / 1 2 / 3 0 . Ċ Ġ*/ Ċ @ Dao Ċ interface ĠRecord Dao { ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġrecord ") ĊĠĠĠ Ġsuspend Ġfun Ġrecords (): List < Record > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġrecord ĠWHERE Ġstate =${ Record . STATE _ WAIT }") ĊĠĠĠ Ġsuspend Ġfun Ġwait Records (): List < Record > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġrecord ĠWHERE Ġstate =${ Record . STATE _ WAIT } Ġlimit Ġ 1 ") ĊĠĠĠ Ġsuspend Ġfun Ġwait Record (): Record ? ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġrecord ĠWHERE Ġstate =${ Record . STATE _ CHECK }") ĊĠĠĠ Ġsuspend Ġfun Ġchecked Records (): List < Record > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġrecord ĠWHERE Ġstate =${ Record . STATE _ SUCCESS } ĠOR Ġstate =${ Record . STATE _ FAILED } Ġorder Ġby Ġdate Ġdesc ") ĊĠĠĠ Ġsuspend Ġfun Ġcompleted Records (): List < Record > ĊĊĠĠĠ Ġ@ Update ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġupdates ( records : List < Record >) ĊĊĠĠĠ Ġ@ Update ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( record : Record ) ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( record : Record ) ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( records : Collection < Record >) ĊĊĠĠĠ Ġ@ Delete () ĊĠĠĠ Ġsuspend Ġfun Ġclear Record ( records Ġ: ĠList < Record >) Ċ Ċ }