package com.za.room.db.ele_work

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.za.bean.db.ele.EleWorkOrderBean

@Dao
interface EleWorkOrderDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE, entity = EleWorkOrderBean::class)
    fun insertEleWorkOrder(eleWorkOrderBean: EleWorkOrderBean)

    @Query("DELETE FROM `ele_work_order` WHERE orderId =:taskId")
    fun deleteOrder(taskId: Int)

    @Query("DELETE FROM `ele_work_order`")
    fun deleteTable()

    @Query("SELECT  * FROM ele_work_order WHERE orderId =:taskId")
    fun getEleWorkOrder(taskId: Int): EleWorkOrderBean?

    //更新
    @Update(onConflict = OnConflictStrategy.REPLACE, entity = EleWorkOrderBean::class)
    fun update(eleWorkOrderBean: EleWorkOrderBean)
}
