package com.ys.bdtp.adm.mvvm.model.db.dao.config

import androidx.room.*
import com.ys.bdtp.adm.mvvm.model.db.entity.config.ConfigEntity

/**
 * config 表访问接口
 *
 * @author bai
 */
@Dao
interface ConfigDao {
    @Query("select * from config")
    suspend fun getConfigs(): List<ConfigEntity>

    @Query("select * from config where id = :id")
    suspend fun getConfigById(id: String): ConfigEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insConfig(vararg config: ConfigEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insConfigs(configs: List<ConfigEntity>)

    @Delete
    suspend fun delConfig(config: ConfigEntity)
}