StationRepository.java
1.88 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.bsth.repository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.bsth.entity.Station;
/**
*
* @Interface: StationRepository(站点Repository数据持久层接口)
*
* @Extends : BaseRepository
*
* @Description: TODO(站点Repository数据持久层接口)
*
* @Author bsth@lq
*
* @Date 2016年05月03日 上午9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@Repository
public interface StationRepository extends BaseRepository<Station, Integer> {
// CONVERT(substring(astext(BDLONGANDLAT),10,length(astext(BDLONGANDLAT))-11) USING gb2312) as BDLONGANDLAT,
// 查询最大ID
@Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_station) k"
, nativeQuery=true)
public int stationMaxId();
// 站点保存
@Transactional
@Modifying
@Query(value="INSERT INTO bsth_c_station (" +
"station_cod , station_name , road_coding , db_type , b_jwpoints , " +
"g_lonx , g_laty , x , y , g_polygon_grid,b_polygon_grid " +
"destroy , radius , shapes_type , versions , descriptions," +
"create_by,update_by) " +
"VALUES(" +
"?1 , ?2 , ?3 , ?4 , ?5," +
"?6 , ?7 , ?8 , ?9 , GeomFromText(?10),GeomFromText(?11)," +
"?12 ,?13, ?14, ?15, ?16," +
"?17,?18)", nativeQuery=true)
public void stationSave(String stationCode,String stationName,String roadCoding,String dbType,String bJwpoints,
Float gLonx, Float gLaty, Float x,Float y, String gPloygonGrid, String bPloygonGrid,
Integer destroy,Integer radius,String shapesType,Integer versions,String descriptions,Integer createBy,Integer updateBy);
}