package com.framework.mvvm.model.db.dao

import androidx.room.*
import com.framework.mvvm.model.db.entity.ConfigEntity

/**
 * 表 config Dao
 */
@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)
}