From 9bb61af770279c5d94a37fc82ff730452a93968e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 1 Sep 2019 22:51:28 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/data/dao/ReplaceRuleDao.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt b/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt index f00be116d..43225b80a 100644 --- a/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/ReplaceRuleDao.kt @@ -42,6 +42,15 @@ interface ReplaceRuleDao { ) fun findEnabledByScope(name: String, origin: String): List + @Query("select `group` from replace_rules") + fun observeGroup(): LiveData> + + @Query("select * from replace_rules where `group` like '%' || :group || '%'") + fun getByGroup(group: String): List + + @get:Query("select * from replace_rules where `group` = null or `group` = ''") + val noGroup: List + @get:Query("SELECT COUNT(*) - SUM(isEnabled) FROM replace_rules") val summary: Int