管灌系统巡查员智能手机App
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.dayu.pipirrapp.dao;
 
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
 
import com.dayu.pipirrapp.bean.db.MarkerBean;
 
import java.util.List;
 
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.core.Maybe;
 
/**
 * author: zuo
 * Date: 2024-09-30
 * Time: 14:39
 * 备注:取水口
 */
@Dao
public interface MarkerDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(MarkerBean markerBean);
 
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Completable insertAll(List<MarkerBean> markerBeans); // 使用 Completable 进行异步插入
 
//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    void insertAll(List<MarkerBean> markerBeans); // 使用 Completable 进行异步插入
 
    @Update
    void update(MarkerBean markerBean);
 
    @Delete
    void delete(MarkerBean markerBean);
 
    @Query("DELETE FROM MarkerBean")
    void deleteAll();
 
    @Query("select  * from MarkerBean limit 1")
    MarkerBean findFirst();
 
    @Query("select  * from MarkerBean")
    List<MarkerBean> findAll();
 
    @Query("select  * from MarkerBean")
    Single<List<MarkerBean>> findAllToSingle();
 
    @Query("SELECT * FROM MarkerBean")
    Maybe<List<MarkerBean>> getAll();
 
}