LineRepository.java
2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.bsth.repository;
import java.util.Date;
import java.util.List;
import java.util.Map;
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.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);
@Query(value = " SELECT l FROM Line l where l.lineCode = ?1")
List<Line> findLineByCode(String lineCode);
public Line findByLineCode(String string);
@Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3")
public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line);
@Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1")
List<Line> findAllService();
@Query("SELECT L FROM Line L")
List<Line> findAll();
@Modifying
@Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, "
+ "l.level=?4, l.nature=?5, l.startStationName=?6, l.endStationName=?7, l.startStationFirstTime=?8, "
+ "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, "
+ "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, "
+ "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, "
+ "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 where "
+ "l.lineCode=?29")
public int update(String name, String company, String brancheCompany, String level, String nature,
String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime,
String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es,
String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone,
Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions,
Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region);
}