From d1aab6603438414ef184d84bddfc292bb867a5d0 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 6 Jun 2019 22:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/data/dao/ReplaceRuleDao.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 c09c9037e..3435eef62 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 @@ -13,31 +13,31 @@ interface ReplaceRuleDao { @Query("SELECT * FROM ${DbTable.replace_rules} ORDER BY sortOrder ASC") fun observeAll(): DataSource.Factory - @Query("SELECT id FROM replace_rules ORDER BY sortOrder ASC") + @Query("SELECT id FROM ${DbTable.replace_rules} ORDER BY sortOrder ASC") fun observeAllIds(): LiveData> - @get:Query("SELECT MAX(sortOrder) FROM replace_rules") + @get:Query("SELECT MAX(sortOrder) FROM ${DbTable.replace_rules}") val maxOrder: Int - @get:Query("SELECT * FROM replace_rules ORDER BY sortOrder ASC") + @get:Query("SELECT * FROM ${DbTable.replace_rules} ORDER BY sortOrder ASC") val all: List - @get:Query("SELECT * FROM replace_rules WHERE isEnabled = 1 ORDER BY sortOrder ASC") + @get:Query("SELECT * FROM ${DbTable.replace_rules} WHERE isEnabled = 1 ORDER BY sortOrder ASC") val allEnabled: List - @Query("SELECT * FROM replace_rules WHERE id = :id") + @Query("SELECT * FROM ${DbTable.replace_rules} WHERE id = :id") fun findById(id: Int): ReplaceRule? - @Query("SELECT * FROM replace_rules WHERE id in (:ids)") + @Query("SELECT * FROM ${DbTable.replace_rules} WHERE id in (:ids)") fun findByIds(vararg ids: Int): List - @Query("SELECT * FROM replace_rules WHERE isEnabled = 1 AND scope LIKE '%' || :scope || '%'") + @Query("SELECT * FROM ${DbTable.replace_rules} WHERE isEnabled = 1 AND scope LIKE '%' || :scope || '%'") fun findEnabledByScope(scope: String): List - @get:Query("SELECT COUNT(*) - SUM(isEnabled) FROM replace_rules") + @get:Query("SELECT COUNT(*) - SUM(isEnabled) FROM ${DbTable.replace_rules}") val summary: Int - @Query("UPDATE replace_rules SET isEnabled = :enable") + @Query("UPDATE ${DbTable.replace_rules} SET isEnabled = :enable") fun enableAll(enable: Boolean) @Insert(onConflict = OnConflictStrategy.REPLACE)