ScheduleRealInfoRepository.java
1.39 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
package com.bsth.repository;
import com.bsth.entity.ScheduleRealInfo;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ScheduleRealInfoRepository extends PagingAndSortingRepository<ScheduleRealInfo, Long> {
/**
* 根据日期获取班次信息
* @param schDate
* @return
*/
@EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
@Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1")
List<ScheduleRealInfo> findAll(String schDate);
/**
* 根据日期和线路编码获取班次信息
* @param schDate
* @param lineCode
* @return
*/
@EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
@Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1 and s.xlBm=?2")
List<ScheduleRealInfo> findAll(String schDate, String lineCode);
/**
* 获取大于指定日期的班次信息
* @param schDate
* @return
*/
@EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
@Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr>?1")
List<ScheduleRealInfo> findByDateLT(String schDate);
}