From a633841f1d282244e42d45a84aca55533df34229 Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期二, 01 四月 2025 15:02:18 +0800
Subject: [PATCH] 1.vip续费页面-数据统计及跳转
---
app/src/main/java/com/example/firstapp/database/dao/CodeDao.kt | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/app/src/main/java/com/example/firstapp/database/dao/CodeDao.kt b/app/src/main/java/com/example/firstapp/database/dao/CodeDao.kt
index f79e67a..c494471 100644
--- a/app/src/main/java/com/example/firstapp/database/dao/CodeDao.kt
+++ b/app/src/main/java/com/example/firstapp/database/dao/CodeDao.kt
@@ -10,6 +10,7 @@
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
@@ -261,4 +262,21 @@
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>
}
--
Gitblit v1.9.3