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

import androidx.room.*
import com.ys.bdtp.adm.mvvm.model.db.entity.ProjectEntity

/**
 * project 表访问接口
 * @author bai
 */
@Dao
interface ProjectDao {

    @Query("select * from project")
    suspend fun getProjects(): List<ProjectEntity>

    @Query("select * from project where id = :id")
    suspend fun getProjectById(id: String): ProjectEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insProjects(projects: List<ProjectEntity>)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insProject(vararg project: ProjectEntity)

    @Delete
    suspend fun delProject(project: ProjectEntity)
}