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

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

/**
 * 表 maj_dict Dao
 */
@Dao
interface MajorDao {
    @Query("select * from major")
    suspend fun getMajors(): List<MajorEntity>

    @Query("select * from major where id = :id")
    suspend fun getMajorById(id: String): MajorEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insMajor(vararg major: MajorEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insMajors(majors: List<MajorEntity>)

    @Delete
    suspend fun delMajor(major: MajorEntity)

}