package com.gh.gamecenter.room.dao

import androidx.room.*
import com.gh.gamecenter.entity.HomePluggableFilterEntity

@Dao
interface HomePluggableFilterDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addData(entity: HomePluggableFilterEntity)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun addData(list: List<HomePluggableFilterEntity>)

    @Query("select * from HomePluggableFilterEntity where active = :active")
    fun getDataByActive(active: Boolean): List<HomePluggableFilterEntity>?

    @Query("select * from HomePluggableFilterEntity where tag = :tag")
    fun getDataByTag(tag: String): List<HomePluggableFilterEntity>?

    @Query("select * from HomePluggableFilterEntity where pkgName = :pkgName")
    fun getDataByPkgName(pkgName: String?): HomePluggableFilterEntity?

}