|
|
|
@ -14,9 +14,10 @@ interface RssArticleDao { |
|
|
|
|
@Query( |
|
|
|
|
"""select t1.link, t1.sort, t1.origin, t1.`order`, t1.title, t1.content, t1.description, t1.image, t1.pubDate, ifNull(t2.read, 0) as read |
|
|
|
|
from rssArticles as t1 left join rssReadRecords as t2 |
|
|
|
|
on t1.link = t2.record where origin = :origin order by `order` desc""" |
|
|
|
|
on t1.link = t2.record where origin = :origin and sort = :sort |
|
|
|
|
order by `order` desc""" |
|
|
|
|
) |
|
|
|
|
fun liveByOrigin(origin: String): LiveData<List<RssArticle>> |
|
|
|
|
fun liveByOriginSort(origin: String, sort: String): LiveData<List<RssArticle>> |
|
|
|
|
|
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE) |
|
|
|
|
fun insert(vararg rssArticle: RssArticle) |
|
|
|
|