StationRouteRepository.java
1.9 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
57
58
59
60
61
62
63
64
65
66
67
68
package com.bsth.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.bsth.entity.StationRoute;
/**
*
* @Interface: StationRouteRepository(站点路由Repository数据持久层接口)
*
* @Extends : BaseRepository
*
* @Description: TODO(站点路由Repository数据持久层接口)
*
* @Author bsth@lq
*
* @Date 2016年5月03日 上午9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@Repository
public interface StationRouteRepository extends BaseRepository<StationRoute, Integer> {
@Query(value = "SELECT a.id,"+
"a.line,"+
"a.station,"+
"a.station_name,"+
"a.station_route_code,"+
"a.line_code,"+
"a.station_code,"+
"a.station_mark,"+
"b.b_jwpoints as 'station.b_jwpoints' ,"+
"b.g_laty AS 'station.g_laty',"+
"b.g_lonx AS 'station.g_lonx',"+
"b.g_polygon_grid AS 'station.g_polygon_grid',"+
"b.radius AS 'station.radius',"+
"b.shapes_type AS 'station.shapes_type',"+
"b.destroy AS 'station.destroy',"+
"b.versions AS 'station.versions' FROM ("+
"SELECT "+
"r.id,"+
"r.line,"+
"r.station,"+
"r.station_name,"+
"r.station_route_code,"+
"r.line_code,"+
"r.station_code,"+
"r.station_mark,"+
"r.directions,"+
"r.distances,"+
"r.to_time," +
"r.end_time," +
"r.descriptions,"+
"r.create_by,"+
"r.create_date,"+
"r.update_by,"+
"r.first_time,"+
"r.versions,"+
"r.out_station_nmber,"+
"r.update_date FROM bsth_c_stationroute r where r.line = ?1 and r.directions = ?2) a"+
" LEFT JOIN bsth_c_station b on a.station=b.id", nativeQuery=true)
List<Object[]> findPoints(int line,int directions);
}