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

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.task.CadEntity

/**
 * cad 表访问接口
 *
 * @author bai
 */
@Dao
interface CadDao {

    @Query("select * from cad")
    suspend fun getCads(): List<CadEntity>

    @Query("select * from cad where id = :id")
    suspend fun getCadById(id: String): CadEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insCad(vararg cad: CadEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insCads(cads: List<CadEntity>)

}