package com.jld.vod.dao

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


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

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

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

    @Query("SELECT * FROM MusicByMidBean WHERE id IN (:movieId)")
    fun loadAllByIds(movieId: Long): List<MusicByMidBean>

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