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

import androidx.room.*
import com.ys.bdtp.adm.mvvm.model.db.entity.dict.BasicConfigEntity

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

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

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

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

    @Delete
    suspend fun delConfig(config: BasicConfigEntity)
}