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

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.SystemEntity

/**
 * 表 sys_dict Dao
 */
@Dao
interface SystemDao {
    @Query("select * from system")
    suspend fun getEqus(): List<SystemEntity>

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

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

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

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