LivePoolDao.java
1.4 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
package cn.fw.freya.dao;
import cn.fw.freya.model.data.pool.LivePool;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/**
* @author unknown
* @version 1.0
* @date 2021/12/13 16:30
* @Description 直播池
*/
public interface LivePoolDao extends JpaRepository<LivePool, Long> {
/**
* 获取今天上报的数据
*
* @param accountNo 账户号
* @param type 账户类型
* @param reportDate 上报日期
* @return
*/
@Query("select live from LivePool live where live.accountNo = ?1 and live.type = ?2 and live.reportDate >= ?3")
List<LivePool> getHasReportData(String accountNo, Integer type, Date reportDate);
/**
* 获取没有拿到回播的直播
*
* @param type 账户类型
* @param durationThreshold 时长阈值
* @return
*/
@Query("select live from LivePool live where live.playbackUrl is null and live.roomId is not null and live.type = ?1 and live.duration >= ?2")
List<LivePool> getWithoutPlaybackLive(Integer type, Double durationThreshold);
/**
* 获取没有拿到回播的直播
*
* @param accountNo 账户号
* @return
*/
@Query("select live from LivePool live where live.accountNo = ?1")
List<LivePool> getLiveByAccountNo(String accountNo);
}