替换规则添加排除字段
This commit is contained in:
@@ -51,6 +51,7 @@ interface ReplaceRuleDao {
|
||||
@Query(
|
||||
"""SELECT * FROM replace_rules WHERE isEnabled = 1 and scopeContent = 1
|
||||
AND (scope LIKE '%' || :name || '%' or scope LIKE '%' || :origin || '%' or scope is null or scope = '')
|
||||
and (excludeScope is null or (excludeScope not LIKE '%' || :name || '%' and excludeScope not LIKE '%' || :origin || '%'))
|
||||
order by sortOrder"""
|
||||
)
|
||||
fun findEnabledByContentScope(name: String, origin: String): List<ReplaceRule>
|
||||
@@ -58,6 +59,7 @@ interface ReplaceRuleDao {
|
||||
@Query(
|
||||
"""SELECT * FROM replace_rules WHERE isEnabled = 1 and scopeTitle = 1
|
||||
AND (scope LIKE '%' || :name || '%' or scope LIKE '%' || :origin || '%' or scope is null or scope = '')
|
||||
and (excludeScope is null or (excludeScope not LIKE '%' || :name || '%' and excludeScope not LIKE '%' || :origin || '%'))
|
||||
order by sortOrder"""
|
||||
)
|
||||
fun findEnabledByTitleScope(name: String, origin: String): List<ReplaceRule>
|
||||
|
||||
@@ -95,6 +95,7 @@ class ReplaceEditActivity :
|
||||
cbScopeTitle.isChecked = replaceRule.scopeTitle
|
||||
cbScopeContent.isChecked = replaceRule.scopeContent
|
||||
etScope.setText(replaceRule.scope)
|
||||
etExcludeScope.setText(replaceRule.excludeScope)
|
||||
etTimeout.setText(replaceRule.timeoutMillisecond.toString())
|
||||
}
|
||||
|
||||
@@ -108,6 +109,7 @@ class ReplaceEditActivity :
|
||||
replaceRule.scopeTitle = cbScopeTitle.isChecked
|
||||
replaceRule.scopeContent = cbScopeContent.isChecked
|
||||
replaceRule.scope = etScope.text.toString()
|
||||
replaceRule.excludeScope = etExcludeScope.text.toString()
|
||||
replaceRule.timeoutMillisecond = etTimeout.text.toString().ifEmpty { "3000" }.toLong()
|
||||
return replaceRule
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user