ChannelDao.java
1.04 KB
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.people.room.dao;
import com.people.room.entity.ChannelBean;
import java.util.List;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
/**
* java类作用描述
*
* @author baozhaoxin
* @version [V1.0.0, 2023/3/18]
* @since V1.0.0
*/
@Dao
public interface ChannelDao {
/**
* 插入/更新
* */
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertOrUpdate(List<ChannelBean> models);
/**
* 清空所有
*
*/
@Query("DELETE FROM tb_channelentity")
void clear();
/**
* 获取我的频道数据,即已选择数据
*/
@Query("SELECT * FROM tb_channelentity WHERE myChannel=:isSelect")
List<ChannelBean> queryAllBySelect(int isSelect);
/**
* 检测是否有数据
* */
@Query("SELECT * FROM tb_channelentity")
ChannelBean getFisrtData();
/**
* 检测是否有数据
* */
@Query("SELECT * FROM tb_channelentity")
List<ChannelBean> getData();
}