管灌系统巡查员智能手机App
zuoxiao
2025-02-11 dde9027478b772dd60371937413ac2838c4f3bbd
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
package com.dayu.pipirrapp.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.PipeNetworkBean;
 
import java.util.List;
 
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Single;
 
/**
 * 管网相关dao
 */
public interface PipeNetDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(PipeNetworkBean pipeNetworkBean);
 
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Completable insertAll(List<PipeNetworkBean> pipeNetworkBeans); // 使用 Completable 进行异步插入
 
//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    void insertAll(List<MarkerBean> markerBeans); // 使用 Completable 进行异步插入
 
    @Update
    void update(PipeNetworkBean pipeNetworkBean);
 
    @Delete
    void delete(PipeNetworkBean pipeNetworkBean);
 
    @Query("DELETE FROM PipeNetworkBean")
    void deleteAll();
 
    @Query("select  * from PipeNetworkBean limit 1")
    PipeNetworkBean findFirst();
 
    @Query("select  * from PipeNetworkBean")
    List<PipeNetworkBean> findAll();
 
    @Query("select  * from PipeNetworkBean")
    Single<List<PipeNetworkBean>> findAllToSingle();
 
    @Query("SELECT * FROM PipeNetworkBean")
    Maybe<List<PipeNetworkBean>> getAll();
}