package com.isidroid.job_sender.data.source.local

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.isidroid.job_sender.domain.model.PrintJobSender

@Dao
interface SendJobDao {
    @Query("SELECT * FROM PrintJobSender WHERE id = :id AND printJobId = :printJobId")
    fun find(id: String, printJobId: String): PrintJobSender?

    @Query("SELECT * FROM PrintJobSender WHERE (:status IS NULL OR status = :status)")
    fun findByStatus(status: Int?): List<PrintJobSender>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(vararg item: PrintJobSender)
}