|
|
@ -5,7 +5,6 @@ import androidx.room.Delete
|
|
|
|
import androidx.room.Insert
|
|
|
|
import androidx.room.Insert
|
|
|
|
import androidx.room.Query
|
|
|
|
import androidx.room.Query
|
|
|
|
import com.yinuo.safetywatcher.watcher.db.entity.Gas
|
|
|
|
import com.yinuo.safetywatcher.watcher.db.entity.Gas
|
|
|
|
import com.yinuo.safetywatcher.watcher.db.entity.Warning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Dao
|
|
|
|
@Dao
|
|
|
|
interface GasDao {
|
|
|
|
interface GasDao {
|
|
|
@ -13,7 +12,7 @@ interface GasDao {
|
|
|
|
suspend fun getAll(): List<Gas>
|
|
|
|
suspend fun getAll(): List<Gas>
|
|
|
|
|
|
|
|
|
|
|
|
@Query("SELECT * FROM gas WHERE gas_name IS :name AND time BETWEEN :startTime AND :endTime")
|
|
|
|
@Query("SELECT * FROM gas WHERE gas_name IS :name AND time BETWEEN :startTime AND :endTime")
|
|
|
|
suspend fun findByName(name: String, startTime: Long, endTime: Long): List<Warning>
|
|
|
|
suspend fun findByName(name: String, startTime: Long, endTime: Long): List<Gas>
|
|
|
|
|
|
|
|
|
|
|
|
@Insert
|
|
|
|
@Insert
|
|
|
|
suspend fun insertAll(vararg gases: Gas)
|
|
|
|
suspend fun insertAll(vararg gases: Gas)
|
|
|
|