package com.jld.vod.dao

import androidx.paging.DataSource
import androidx.room.*
import com.jld.vod.model.bean.ModelAllBean


/**
 * @author ZhaoFuXin
 * @Email：18276061387@163.com
 * @description:
 * @date :2019/11/28 15:31
 */
@Dao
interface ModularAllDao {
    @Insert
    fun insertAll(vararg users: ModelAllBean)

    @Query("SELECT * FROM ModelAllBean")
    fun getAll(): List<ModelAllBean>

    @Query("SELECT * FROM ModelAllBean WHERE rtName IN (:rtName)")
    fun loadAllByrtNames(rtName: String): List<ModelAllBean>

    /**
     * 获取所有设备给paging使用
     */
    @Query("SELECT * FROM ModelAllBean")
    fun getAlls(): DataSource.Factory<Int, ModelAllBean>

    @Query(" DELETE FROM ModelAllBean")
    fun delete()
}