| | |
| | | import com.example.firstapp.model.CourierStat |
| | | import com.example.firstapp.model.DailyStat |
| | | import com.example.firstapp.model.HeatmapStat |
| | | import com.example.firstapp.model.StationGroup |
| | | import io.reactivex.Completable |
| | | import kotlinx.coroutines.flow.Flow |
| | | |
| | |
| | | WHERE strftime('%Y', createTime) = strftime('%Y', datetime(:date/1000, 'unixepoch', 'localtime')) |
| | | """) |
| | | fun getCurrentYearStats(date: Long): Flow<List<DailyStat>> |
| | | |
| | | @Query(""" |
| | | SELECT oneLevel as stationName, COUNT(*) as count |
| | | FROM Code |
| | | WHERE category = :type AND pickup = '0' |
| | | GROUP BY oneLevel |
| | | ORDER BY createTime DESC |
| | | """) |
| | | fun getStationsByType(type: String): List<StationGroup> |
| | | |
| | | @Query(""" |
| | | SELECT * FROM Code |
| | | WHERE category = :type AND pickup = '0' |
| | | AND oneLevel = :stationName |
| | | ORDER BY createTime DESC |
| | | """) |
| | | fun getPackagesByTypeAndStation(type: String, stationName: String): List<Code> |
| | | } |