LineRepository.java
952 Bytes
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
package com.bsth.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.bsth.entity.Line;
/**
*
* @Interface: LineRepository(线路Repository数据持久层接口)
*
* @Extends : BaseRepository
*
* @Description: TODO(线路Repository数据持久层接口)
*
* @Author bsth@lq
*
* @Date 2016年4月28日 上午9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@Repository
public interface LineRepository extends BaseRepository<Line, Integer> {
/**
* 获取线路编码
*
* @return int <lineCode:线路编码>
*/
@Query(value = " SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_line) k ", nativeQuery = true)
public long selectMaxIdToLineCode();
@Query(value = " SELECT l FROM Line l where l.name like ?1")
List<Line> findLine(String line);
}