package com.framework.mvvm.model.db.dao

import androidx.lifecycle.LiveData
import androidx.room.*
import com.framework.mvvm.model.db.entity.ProjectEntity

/**
 * 表 project Dao
 */
@Dao
interface ProjectDao {
    @Query("select * from project")
    fun getProjects(): LiveData<List<ProjectEntity>>

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

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

    @Delete
    suspend fun delProject(project: ProjectEntity)
}