Commit b362ddfb24454a8db5ed55c76d98c0eb19f801be
1 parent
23c8a90a
修改票价类型
Showing
2 changed files
with
111 additions
and
111 deletions
src/main/java/com/bsth/entity/Line.java
| ... | ... | @@ -164,7 +164,7 @@ public class Line implements Serializable { |
| 164 | 164 | /** 是否在使用 <1:是;0:否> bit length(50) */ |
| 165 | 165 | private Integer inUse; |
| 166 | 166 | |
| 167 | - private int ticketPrice = 0; | |
| 167 | + private String ticketPrice; | |
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * 逻辑删除标记 为 1:标识已删除 |
| ... | ... | @@ -519,11 +519,11 @@ public class Line implements Serializable { |
| 519 | 519 | this.remove = remove; |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | - public int getTicketPrice() { | |
| 522 | + public String getTicketPrice() { | |
| 523 | 523 | return ticketPrice; |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - public void setTicketPrice(int ticketPrice) { | |
| 526 | + public void setTicketPrice(String ticketPrice) { | |
| 527 | 527 | this.ticketPrice = ticketPrice; |
| 528 | 528 | } |
| 529 | 529 | ... | ... |
src/main/java/com/bsth/repository/LineRepository.java
| 1 | -package com.bsth.repository; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | -import java.util.List; | |
| 5 | -import java.util.Map; | |
| 6 | - | |
| 7 | -import org.springframework.data.jpa.repository.Modifying; | |
| 8 | -import org.springframework.data.jpa.repository.Query; | |
| 9 | -import org.springframework.stereotype.Repository; | |
| 10 | -import org.springframework.transaction.annotation.Transactional; | |
| 11 | - | |
| 12 | -import com.bsth.entity.Line; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * | |
| 16 | - * @Interface: LineRepository(线路Repository数据持久层接口) | |
| 17 | - * | |
| 18 | - * @Extends : BaseRepository | |
| 19 | - * | |
| 20 | - * @Description: TODO(线路Repository数据持久层接口) | |
| 21 | - * | |
| 22 | - * @Author bsth@lq | |
| 23 | - * | |
| 24 | - * @Date 2016年4月28日 上午9:21:17 | |
| 25 | - * | |
| 26 | - * @Version 公交调度系统BS版 0.1 | |
| 27 | - * | |
| 28 | - */ | |
| 29 | -@Repository | |
| 30 | -public interface LineRepository extends BaseRepository<Line, Integer> { | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * 获取线路编码 | |
| 34 | - * | |
| 35 | - * @return int <lineCode:线路编码> | |
| 36 | - */ | |
| 37 | - @Query(value = " SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_line) k ", nativeQuery = true) | |
| 38 | - public long selectMaxIdToLineCode(); | |
| 39 | - | |
| 40 | - @Query(value = " SELECT l FROM Line l where l.name like ?1") | |
| 41 | - List<Line> findLine(String line); | |
| 42 | - | |
| 43 | - @Query(value = " SELECT l FROM Line l where l.lineCode = ?1") | |
| 44 | - List<Line> findLineByCode(String lineCode); | |
| 45 | - | |
| 46 | - public Line findByLineCode(String string); | |
| 47 | - | |
| 48 | - @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") | |
| 49 | - public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); | |
| 50 | - | |
| 51 | - @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") | |
| 52 | - List<Line> findAllService(); | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * 获取全部线路(含撤销线路,不含删除的) | |
| 56 | - * | |
| 57 | - */ | |
| 58 | - @Query("SELECT L FROM Line L where L.remove !=1 or L.remove is null order by destroy asc") | |
| 59 | - List<Line> findAllLine(); | |
| 60 | - | |
| 61 | - | |
| 62 | - @Query("SELECT L FROM Line L") | |
| 63 | - List<Line> findAll(); | |
| 64 | - | |
| 65 | - @Modifying | |
| 66 | - @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " | |
| 67 | - + "l.level=?4, l.nature=?5, l.startStationName=?6, l.endStationName=?7, l.startStationFirstTime=?8, " | |
| 68 | - + "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, " | |
| 69 | - + "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, " | |
| 70 | - + "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, " | |
| 71 | - + "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 , l.inUse=?31 , l.ticketPrice=?32 where " | |
| 72 | - + "l.lineCode=?29") | |
| 73 | - int update(String name, String company, String brancheCompany, String level, String nature, | |
| 74 | - String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime, | |
| 75 | - String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es, | |
| 76 | - String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone, | |
| 77 | - Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions, | |
| 78 | - Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region, Integer inUser, int ticketPrice); | |
| 79 | - | |
| 80 | - /** | |
| 81 | - * 查询线路版本文件 | |
| 82 | - * @param lineId | |
| 83 | - * @return | |
| 84 | - */ | |
| 85 | - @Query(value = "SELECT version_count FROM bsth_c_line_file_version where line = ?1", nativeQuery = true) | |
| 86 | - Integer findfileVersions(Integer lineId); | |
| 87 | - | |
| 88 | - /** | |
| 89 | - * 添加线路文件版本 | |
| 90 | - * @param lineId | |
| 91 | - * @param line_code | |
| 92 | - */ | |
| 93 | - @Transactional | |
| 94 | - @Modifying | |
| 95 | - @Query(value = "INSERT INTO bsth_c_line_file_version (line,line_code,version_count) VALUES (?1,?2,1)", nativeQuery = true) | |
| 96 | - public void addFileVersions(Integer lineId, String line_code); | |
| 97 | - | |
| 98 | - /** | |
| 99 | - * 线路文件版本修改 | |
| 100 | - * @param lineId | |
| 101 | - * @param version_count | |
| 102 | - */ | |
| 103 | - @Transactional | |
| 104 | - @Modifying | |
| 105 | - @Query(value = "UPDATE bsth_c_line_file_version set version_count=?2 WHERE line = ?1", nativeQuery = true) | |
| 106 | - public void editFileVersions(Integer lineId, Integer version_count); | |
| 107 | - | |
| 108 | -} | |
| 1 | +package com.bsth.repository; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | +import java.util.List; | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +import org.springframework.data.jpa.repository.Modifying; | |
| 8 | +import org.springframework.data.jpa.repository.Query; | |
| 9 | +import org.springframework.stereotype.Repository; | |
| 10 | +import org.springframework.transaction.annotation.Transactional; | |
| 11 | + | |
| 12 | +import com.bsth.entity.Line; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * | |
| 16 | + * @Interface: LineRepository(线路Repository数据持久层接口) | |
| 17 | + * | |
| 18 | + * @Extends : BaseRepository | |
| 19 | + * | |
| 20 | + * @Description: TODO(线路Repository数据持久层接口) | |
| 21 | + * | |
| 22 | + * @Author bsth@lq | |
| 23 | + * | |
| 24 | + * @Date 2016年4月28日 上午9:21:17 | |
| 25 | + * | |
| 26 | + * @Version 公交调度系统BS版 0.1 | |
| 27 | + * | |
| 28 | + */ | |
| 29 | +@Repository | |
| 30 | +public interface LineRepository extends BaseRepository<Line, Integer> { | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 获取线路编码 | |
| 34 | + * | |
| 35 | + * @return int <lineCode:线路编码> | |
| 36 | + */ | |
| 37 | + @Query(value = " SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_line) k ", nativeQuery = true) | |
| 38 | + public long selectMaxIdToLineCode(); | |
| 39 | + | |
| 40 | + @Query(value = " SELECT l FROM Line l where l.name like ?1") | |
| 41 | + List<Line> findLine(String line); | |
| 42 | + | |
| 43 | + @Query(value = " SELECT l FROM Line l where l.lineCode = ?1") | |
| 44 | + List<Line> findLineByCode(String lineCode); | |
| 45 | + | |
| 46 | + public Line findByLineCode(String string); | |
| 47 | + | |
| 48 | + @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") | |
| 49 | + public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); | |
| 50 | + | |
| 51 | + @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") | |
| 52 | + List<Line> findAllService(); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获取全部线路(含撤销线路,不含删除的) | |
| 56 | + * | |
| 57 | + */ | |
| 58 | + @Query("SELECT L FROM Line L where L.remove !=1 or L.remove is null order by destroy asc") | |
| 59 | + List<Line> findAllLine(); | |
| 60 | + | |
| 61 | + | |
| 62 | + @Query("SELECT L FROM Line L") | |
| 63 | + List<Line> findAll(); | |
| 64 | + | |
| 65 | + @Modifying | |
| 66 | + @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " | |
| 67 | + + "l.level=?4, l.nature=?5, l.startStationName=?6, l.endStationName=?7, l.startStationFirstTime=?8, " | |
| 68 | + + "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, " | |
| 69 | + + "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, " | |
| 70 | + + "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, " | |
| 71 | + + "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 , l.inUse=?31 , l.ticketPrice=?32 where " | |
| 72 | + + "l.lineCode=?29") | |
| 73 | + int update(String name, String company, String brancheCompany, String level, String nature, | |
| 74 | + String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime, | |
| 75 | + String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es, | |
| 76 | + String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone, | |
| 77 | + Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions, | |
| 78 | + Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region, Integer inUser, String ticketPrice); | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 查询线路版本文件 | |
| 82 | + * @param lineId | |
| 83 | + * @return | |
| 84 | + */ | |
| 85 | + @Query(value = "SELECT version_count FROM bsth_c_line_file_version where line = ?1", nativeQuery = true) | |
| 86 | + Integer findfileVersions(Integer lineId); | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 添加线路文件版本 | |
| 90 | + * @param lineId | |
| 91 | + * @param line_code | |
| 92 | + */ | |
| 93 | + @Transactional | |
| 94 | + @Modifying | |
| 95 | + @Query(value = "INSERT INTO bsth_c_line_file_version (line,line_code,version_count) VALUES (?1,?2,1)", nativeQuery = true) | |
| 96 | + public void addFileVersions(Integer lineId, String line_code); | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 线路文件版本修改 | |
| 100 | + * @param lineId | |
| 101 | + * @param version_count | |
| 102 | + */ | |
| 103 | + @Transactional | |
| 104 | + @Modifying | |
| 105 | + @Query(value = "UPDATE bsth_c_line_file_version set version_count=?2 WHERE line = ?1", nativeQuery = true) | |
| 106 | + public void editFileVersions(Integer lineId, Integer version_count); | |
| 107 | + | |
| 108 | +} | ... | ... |