package Ġcom . ud acity . aster oid radar . database Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . room . Dao Ċ import Ġandroidx . room . Insert Ċ import Ġandroidx . room . On Conflict Strategy Ċ import Ġandroidx . room . Query Ċ Ċ @ Dao Ċ interface ĠA ster oid Rad ar Dao Ġ{ ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġfun Ġinsert All ( var arg Ġaster oid : ĠA ster oid Table ) ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġfun Ġinsert ( image Table : ĠImage Table ) ĊĊĠĠĠ Ġ@ Query (" SELECT Ġcount (*) ĠFROM Ġaster oid _ table ĠWHERE Ġdate ( day ) Ġ= Ġdate (: today )") ĊĠĠĠ Ġfun Ġselect Has Current A ster oids ( today : ĠString ): ĠInt ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġaster oid _ table ĠORDER ĠBY Ġclose _ appro ach _ date ĠDESC ") ĊĠĠĠ Ġfun Ġselect All (): ĠLive Data < List < A ster oid Table >> ĊĊĠĠĠ Ġ@ Query (" SELECT Ġcount (*) ĠFROM Ġimage _ table ĠWHERE Ġdate ( day ) Ġ= Ġdate (: today )") ĊĠĠĠ Ġfun Ġselect Has Current Image ( today : ĠString ): ĠInt ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġimage _ table ĠORDER ĠBY Ġday ĠDESC ĠLIMIT Ġ 1 ") ĊĠĠĠ Ġfun Ġselect Current Image (): ĠLive Data < Image Table > ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġaster oid _ table ĠWHERE Ġdate ( close _ appro ach _ date ) Ġ< Ġdate (: today )") ĊĠĠĠ Ġfun Ġdelete All Old A ster oids ( today : ĠString ) ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġimage _ table ĠWHERE Ġdate ( day ) Ġ< Ġdate (: today )") ĊĠĠĠ Ġfun Ġdelete All Old Images ( today : ĠString ) Ċ } Ċ