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

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

/**
 * 表 system_dict Dao
 */
@Dao
interface SystemDictDao {
    @Query("select * from system_dict")
    suspend fun getEqus(): List<SystemDictEntity>

    @Query("select * from system_dict where id = :id")
    suspend fun getEquById(id: String): SystemDictEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insSystem(vararg system: SystemDictEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insSystems(systems: List<SystemDictEntity>)

    @Query("select * from system_dict where code = :code")
    suspend fun getSysByCode(code: String): SystemDictEntity?
}