优化
This commit is contained in:
@@ -22,7 +22,7 @@ interface SearchBookDao {
|
|||||||
and t2.enabled = 1 and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
and t2.enabled = 1 and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
||||||
order by t2.customOrder"""
|
order by t2.customOrder"""
|
||||||
)
|
)
|
||||||
fun getChangeSourceSearch(name: String, author: String, sourceGroup: String): List<SearchBook>
|
fun changeSourceByGroup(name: String, author: String, sourceGroup: String): List<SearchBook>
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
"""select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl,
|
"""select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl,
|
||||||
@@ -30,12 +30,13 @@ interface SearchBookDao {
|
|||||||
t1.wordCount, t2.customOrder as originOrder
|
t1.wordCount, t2.customOrder as originOrder
|
||||||
from searchBooks as t1 inner join book_sources as t2
|
from searchBooks as t1 inner join book_sources as t2
|
||||||
on t1.origin = t2.bookSourceUrl
|
on t1.origin = t2.bookSourceUrl
|
||||||
where t1.name = :name and t1.author like '%'||:author||'%'
|
where t1.name = :name and t1.author like '%'||:author||'%'
|
||||||
and originName like '%'||:key||'%' and t2.enabled = 1
|
|
||||||
and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
||||||
|
and (originName like '%'||:key||'%' or t1.latestChapterTitle like '%'||:key||'%')
|
||||||
|
and t2.enabled = 1
|
||||||
order by t2.customOrder"""
|
order by t2.customOrder"""
|
||||||
)
|
)
|
||||||
fun getChangeSourceSearch(
|
fun changeSourceSearch(
|
||||||
name: String,
|
name: String,
|
||||||
author: String,
|
author: String,
|
||||||
key: String,
|
key: String,
|
||||||
|
|||||||
@@ -222,21 +222,21 @@ open class ChangeBookSourceViewModel(application: Application) : BaseViewModel(a
|
|||||||
private fun getDbSearchBooks(): List<SearchBook> {
|
private fun getDbSearchBooks(): List<SearchBook> {
|
||||||
return if (screenKey.isEmpty()) {
|
return if (screenKey.isEmpty()) {
|
||||||
if (AppConfig.changeSourceCheckAuthor) {
|
if (AppConfig.changeSourceCheckAuthor) {
|
||||||
appDb.searchBookDao.getChangeSourceSearch(
|
appDb.searchBookDao.changeSourceByGroup(
|
||||||
name, author, AppConfig.searchGroup
|
name, author, AppConfig.searchGroup
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
appDb.searchBookDao.getChangeSourceSearch(
|
appDb.searchBookDao.changeSourceByGroup(
|
||||||
name, "", AppConfig.searchGroup
|
name, "", AppConfig.searchGroup
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (AppConfig.changeSourceCheckAuthor) {
|
if (AppConfig.changeSourceCheckAuthor) {
|
||||||
appDb.searchBookDao.getChangeSourceSearch(
|
appDb.searchBookDao.changeSourceSearch(
|
||||||
name, author, screenKey, AppConfig.searchGroup
|
name, author, screenKey, AppConfig.searchGroup
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
appDb.searchBookDao.getChangeSourceSearch(
|
appDb.searchBookDao.changeSourceSearch(
|
||||||
name, "", screenKey, AppConfig.searchGroup
|
name, "", screenKey, AppConfig.searchGroup
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user