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

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.ys.bdtp.adm.mvvm.model.db.entity.dict.RelationDictEntity

/**
 * 表 relation_dict Dao
 */
@Dao
interface RelationDictDao {
    @Query("select * from relation_dict")
    suspend fun getRelationDicts(): List<RelationDictEntity>

    @Query("select * from relation_dict where id = :id")
    suspend fun getRelationDictById(id: String): RelationDictEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insRelationDict(vararg relationDict: RelationDictEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insRelationDicts(relationDicts: List<RelationDictEntity>)

    @Delete
    suspend fun delRelationDict(relationDict: RelationDictEntity)
}