package Ġcom . jiang . awesome downloader . database Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . room .* Ċ /** Ċ Ġ* Ċ Ġ* Ġ@ ProjectName : ĠĠĠ ĠAwesome Downloader Ċ Ġ* Ġ@ ClassName : ĠĠĠĠĠ ĠTask Info Dao Ċ Ġ* Ġ@ Description : ĠĠĠ ĠDao Ċ Ġ* Ġ@ Author : ĠĠĠĠĠĠĠĠ Ġæ ± Ł Ċ Ġ* Ġ@ Create Date : ĠĠĠĠĠ 2 0 2 0 / 8 / 2 1 Ġ 1 6 : 4 6 Ċ Ġ*/ Ċ @ Dao Ċ interface ĠTask Info Dao Ġ{ ĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( var arg Ġtask Info : ĠTask Info ) ĊĊĠĠĠ Ġ@ Delete ĊĠĠĠ Ġsuspend Ġfun Ġdelete ( var arg Ġtask Info : ĠTask Info ): ĠInt ĊĊĠĠĠ Ġ@ Delete ĊĠĠĠ Ġsuspend Ġfun Ġdelete Array ( task Infos : ĠArray < Task Info >): ĠInt ĊĊĠĠĠ Ġ@ Update ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( var arg Ġtask Info : ĠTask Info ) ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info ") ĊĠĠĠ Ġsuspend Ġfun Ġquery All (): ĠMutable List < Task Info > ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info ") ĊĠĠĠ Ġfun Ġquery All And Return LiveData (): ĠLive Data < List < Task Info >> ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info Ġwhere Ġstatus Ġ< Ġ$ TASK _ STATUS _ FIN ISH ") ĊĠĠĠ Ġsuspend Ġfun Ġquery Un finished (): ĠMutable List < Task Info > ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info Ġwhere Ġstatus Ġ< Ġ$ TASK _ STATUS _ FIN ISH ") ĊĠĠĠ Ġfun Ġquery Un finished LiveData (): ĠLive Data < Mutable List < Task Info >> ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info Ġwhere Ġstatus Ġ= Ġ$ TASK _ STATUS _ FIN ISH ") ĊĠĠĠ Ġsuspend Ġfun Ġquery Finished (): ĠMutable List < Task Info > ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom ĠTask Info Ġwhere Ġstatus Ġ= Ġ$ TASK _ STATUS _ FIN ISH ") ĊĠĠĠ Ġfun Ġquery Finished LiveData (): ĠLive Data < Mutable List < Task Info >> ĊĊĠĠĠ Ġ@ Query (" delete Ġfrom ĠTask Info Ġwhere Ġid =: task Info ID ") ĊĠĠĠ Ġsuspend Ġfun Ġdelete ByID ( task Info ID : ĠLong ) ĊĊĠĠĠ Ġ@ Query (" delete Ġfrom ĠTask Info Ġwhere Ġstatus Ġbetween Ġ$ TASK _ STATUS _ UN INITIAL IZED Ġand Ġ$ TASK _ STATUS _ UN FINISHED ") ĊĠĠĠ Ġsuspend Ġfun Ġdelete All Un finished Task Info () Ċ }