Commit d06e078167ca72c00dee300a7aa466539c7b348b
1 parent
2d7e1b3b
line 增加字段 ticket_price decimal 长度10 小数2
business 增加字段 phone_num varcar 长度20 stationroute ls_stationroute 增加字段 station_name_en 长度255 # Conflicts: # src/main/java/com/bsth/entity/Business.java # src/main/java/com/bsth/entity/LsStationRoute.java # src/main/java/com/bsth/entity/StationRoute.java # src/main/java/com/bsth/repository/LineRepository.java # src/main/java/com/bsth/repository/StationRouteRepository.java # src/main/java/com/bsth/service/impl/LineServiceImpl.java # src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java # src/main/java/com/bsth/service/impl/StationServiceImpl.java # src/main/resources/static/pages/base/line/add.html # src/main/resources/static/pages/base/line/edit.html # src/main/resources/static/pages/base/stationroute/add.html # src/main/resources/static/pages/base/stationroute/edit.html
Showing
7 changed files
with
2058 additions
and
1928 deletions
Too many changes to show.
To preserve performance only 7 of 13 files are displayed.
src/main/java/com/bsth/entity/Business.java
| 1 | -package com.bsth.entity; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | - | |
| 5 | -import javax.persistence.Column; | |
| 6 | -import javax.persistence.Entity; | |
| 7 | -import javax.persistence.GeneratedValue; | |
| 8 | -import javax.persistence.GenerationType; | |
| 9 | -import javax.persistence.Id; | |
| 10 | -import javax.persistence.Table; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * | |
| 14 | - * @ClassName : Business(公司实体类) | |
| 15 | - * | |
| 16 | - * @Author : bsth@lq | |
| 17 | - * | |
| 18 | - * @Description : TODO(公司信息) | |
| 19 | - * | |
| 20 | - * @Data : 2016-04-27 | |
| 21 | - * | |
| 22 | - * @Version 公交调度系统BS版 0.1 | |
| 23 | - * | |
| 24 | - */ | |
| 25 | - | |
| 26 | -@Entity | |
| 27 | -@Table(name = "bsth_c_business") | |
| 28 | -public class Business { | |
| 29 | - | |
| 30 | - // ID | |
| 31 | - @Id | |
| 32 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | - private Integer id; | |
| 34 | - | |
| 35 | - // 企业<公司>名称 | |
| 36 | - private String businessName; | |
| 37 | - | |
| 38 | - // 企业<公司>代码 | |
| 39 | - private String businessCode; | |
| 40 | - | |
| 41 | - // 所属企业<公司>代码 | |
| 42 | - private String upCode; | |
| 43 | - | |
| 44 | - // 描述 | |
| 45 | - private String descriptions; | |
| 46 | - | |
| 47 | - // 创建日期 | |
| 48 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 49 | - private Date createDate; | |
| 50 | - | |
| 51 | - // 修改日期 | |
| 52 | - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 53 | - private Date updateDate; | |
| 54 | - public Date getCreateDate() { | |
| 55 | - return createDate; | |
| 56 | - } | |
| 57 | - | |
| 58 | - public void setCreateDate(Date createDate) { | |
| 59 | - this.createDate = createDate; | |
| 60 | - } | |
| 61 | - | |
| 62 | - public Date getUpdateDate() { | |
| 63 | - return updateDate; | |
| 64 | - } | |
| 65 | - | |
| 66 | - public void setUpdateDate(Date updateDate) { | |
| 67 | - this.updateDate = updateDate; | |
| 68 | - } | |
| 69 | - | |
| 70 | - public Integer getId() { | |
| 71 | - return id; | |
| 72 | - } | |
| 73 | - | |
| 74 | - public void setId(Integer id) { | |
| 75 | - this.id = id; | |
| 76 | - } | |
| 77 | - | |
| 78 | - public String getBusinessName() { | |
| 79 | - return businessName; | |
| 80 | - } | |
| 81 | - | |
| 82 | - public void setBusinessName(String businessName) { | |
| 83 | - this.businessName = businessName; | |
| 84 | - } | |
| 85 | - | |
| 86 | - public String getBusinessCode() { | |
| 87 | - return businessCode; | |
| 88 | - } | |
| 89 | - | |
| 90 | - public void setBusinessCode(String businessCode) { | |
| 91 | - this.businessCode = businessCode; | |
| 92 | - } | |
| 93 | - | |
| 94 | - public String getUpCode() { | |
| 95 | - return upCode; | |
| 96 | - } | |
| 97 | - | |
| 98 | - public void setUpCode(String upCode) { | |
| 99 | - this.upCode = upCode; | |
| 100 | - } | |
| 101 | - | |
| 102 | - public String getDescriptions() { | |
| 103 | - return descriptions; | |
| 104 | - } | |
| 105 | - | |
| 106 | - public void setDescriptions(String descriptions) { | |
| 107 | - this.descriptions = descriptions; | |
| 108 | - } | |
| 109 | -} | |
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.Column; | |
| 6 | +import javax.persistence.Entity; | |
| 7 | +import javax.persistence.GeneratedValue; | |
| 8 | +import javax.persistence.GenerationType; | |
| 9 | +import javax.persistence.Id; | |
| 10 | +import javax.persistence.Table; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * | |
| 14 | + * @ClassName : Business(公司实体类) | |
| 15 | + * | |
| 16 | + * @Author : bsth@lq | |
| 17 | + * | |
| 18 | + * @Description : TODO(公司信息) | |
| 19 | + * | |
| 20 | + * @Data : 2016-04-27 | |
| 21 | + * | |
| 22 | + * @Version 公交调度系统BS版 0.1 | |
| 23 | + * | |
| 24 | + */ | |
| 25 | + | |
| 26 | +@Entity | |
| 27 | +@Table(name = "bsth_c_business") | |
| 28 | +public class Business { | |
| 29 | + | |
| 30 | + // ID | |
| 31 | + @Id | |
| 32 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | + private Integer id; | |
| 34 | + | |
| 35 | + // 企业<公司>名称 | |
| 36 | + private String businessName; | |
| 37 | + | |
| 38 | + // 企业<公司>代码 | |
| 39 | + private String businessCode; | |
| 40 | + | |
| 41 | + // 所属企业<公司>代码 | |
| 42 | + private String upCode; | |
| 43 | + | |
| 44 | + // 描述 | |
| 45 | + private String descriptions; | |
| 46 | + // 描述 | |
| 47 | + private String phoneNum; | |
| 48 | + | |
| 49 | + // 创建日期 | |
| 50 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 51 | + private Date createDate; | |
| 52 | + | |
| 53 | + // 修改日期 | |
| 54 | + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 55 | + private Date updateDate; | |
| 56 | + public Date getCreateDate() { | |
| 57 | + return createDate; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setCreateDate(Date createDate) { | |
| 61 | + this.createDate = createDate; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public Date getUpdateDate() { | |
| 65 | + return updateDate; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setUpdateDate(Date updateDate) { | |
| 69 | + this.updateDate = updateDate; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public Integer getId() { | |
| 73 | + return id; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setId(Integer id) { | |
| 77 | + this.id = id; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getBusinessName() { | |
| 81 | + return businessName; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setBusinessName(String businessName) { | |
| 85 | + this.businessName = businessName; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public String getBusinessCode() { | |
| 89 | + return businessCode; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setBusinessCode(String businessCode) { | |
| 93 | + this.businessCode = businessCode; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public String getUpCode() { | |
| 97 | + return upCode; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public void setUpCode(String upCode) { | |
| 101 | + this.upCode = upCode; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public String getDescriptions() { | |
| 105 | + return descriptions; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void setDescriptions(String descriptions) { | |
| 109 | + this.descriptions = descriptions; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public String getPhoneNum() { | |
| 113 | + return phoneNum; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setPhoneNum(String phoneNum) { | |
| 117 | + this.phoneNum = phoneNum; | |
| 118 | + } | |
| 119 | + | |
| 120 | +} | ... | ... |
src/main/java/com/bsth/entity/Line.java
| 1 | -package com.bsth.entity; | |
| 2 | - | |
| 3 | -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | -import org.hibernate.annotations.Formula; | |
| 5 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | - | |
| 7 | -import javax.persistence.*; | |
| 8 | -import java.io.Serializable; | |
| 9 | -import java.util.Date; | |
| 10 | - | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * | |
| 14 | - * @ClassName: Line(线路实体类) | |
| 15 | - * | |
| 16 | - * @Description: TODO(线路) | |
| 17 | - * | |
| 18 | - * @Author bsth@lq | |
| 19 | - * | |
| 20 | - * @Date 2016-4-11 16:06:17 | |
| 21 | - * | |
| 22 | - * @Version 公交调度系统BS版 0.1 | |
| 23 | - * | |
| 24 | - */ | |
| 25 | - | |
| 26 | -@Entity | |
| 27 | -@Table(name = "bsth_c_line") | |
| 28 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 29 | -public class Line implements Serializable { | |
| 30 | - | |
| 31 | - @Id | |
| 32 | - /** 线路ID 主键(唯一标识符) int length(11) */ | |
| 33 | - private Integer id; | |
| 34 | - | |
| 35 | - /** 线路名称 varchar length(50) 不能为空 */ | |
| 36 | - private String name; | |
| 37 | - | |
| 38 | - /** 线路编码 varchar length(50) 不能为空 */ | |
| 39 | - private String lineCode; | |
| 40 | - | |
| 41 | - /** 英文名 varchar length(50) */ | |
| 42 | - private String es; | |
| 43 | - | |
| 44 | - /** 简称 varchar length(50) */ | |
| 45 | - private String shortName; | |
| 46 | - | |
| 47 | - /** 起始站名称 varchar length(50) 不能为空 | |
| 48 | - * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */ | |
| 49 | - private String startStationName; | |
| 50 | - | |
| 51 | - /** 终点站名称 varchar length(50) 不能为空 | |
| 52 | - * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */ | |
| 53 | - private String endStationName; | |
| 54 | - | |
| 55 | - /** 起始站首班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */ | |
| 56 | - private String startStationFirstTime; | |
| 57 | - | |
| 58 | - /** 起始站末班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */ | |
| 59 | - private String startStationEndTime; | |
| 60 | - | |
| 61 | - /** 终点站首班时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空*/ | |
| 62 | - private String endStationFirstTime; | |
| 63 | - | |
| 64 | - /** 终点站末班时间 00:00 上海公交APP中某个接口所需要的字段值 */ | |
| 65 | - private String endStationEndTime; | |
| 66 | - | |
| 67 | - /** 所属公司 varchar length(50) */ | |
| 68 | - private String company; | |
| 69 | - | |
| 70 | - /** 分公司 varchar length(50)*/ | |
| 71 | - private String brancheCompany; | |
| 72 | - | |
| 73 | - /** 组合公司分公司编码 */ | |
| 74 | - @Formula(" concat(company, '_', branche_company) ") | |
| 75 | - private String cgsbm; | |
| 76 | - | |
| 77 | - /** 性质(线路类型) varchar length(50) */ | |
| 78 | - private String nature; | |
| 79 | - | |
| 80 | - /** 线路等级 varchar length(50) */ | |
| 81 | - private String level; | |
| 82 | - | |
| 83 | - /** 线路长度 */ | |
| 84 | - private double length; | |
| 85 | - | |
| 86 | - /** 线路负责人 varchar length(50) */ | |
| 87 | - private String chargeName; | |
| 88 | - | |
| 89 | - /** 负责人电话 varchar length(50) */ | |
| 90 | - private String telephone; | |
| 91 | - | |
| 92 | - /** 是否撤销 <1:是;0:否> bit length(50) */ | |
| 93 | - private Integer destroy; | |
| 94 | - | |
| 95 | - /** 是否夜宵线 <1:是;0:否> bit length(50)*/ | |
| 96 | - private Integer supperLine; | |
| 97 | - | |
| 98 | - /** 是否营运 <1:是;0:否> bit length(50)*/ | |
| 99 | - private Integer sfyy; | |
| 100 | - | |
| 101 | - /** 线路区域 <0:区内,1:区外> bit length(1)*/ | |
| 102 | - private Integer region; | |
| 103 | - | |
| 104 | - /** 起始调度电话 varchar length(50) */ | |
| 105 | - private String startPhone; | |
| 106 | - | |
| 107 | - /** 终点调度电话 varchar length(50) */ | |
| 108 | - private String endPhone; | |
| 109 | - | |
| 110 | - /** 开辟日期 date*/ | |
| 111 | - @DateTimeFormat(pattern ="yyyy-MM-dd") | |
| 112 | - private Date openDate; | |
| 113 | - | |
| 114 | - /** 大间隔等级 */ | |
| 115 | - private Integer spacGrade; | |
| 116 | - | |
| 117 | - /** 线路沿革 varchar length(50) */ | |
| 118 | - private String history; | |
| 119 | - | |
| 120 | - /** 上海市线路编码 varchar length(50) */ | |
| 121 | - private String shanghaiLinecode; | |
| 122 | - | |
| 123 | - /** 设备线路编码 varchar length(50) */ | |
| 124 | - private String eqLinecode; | |
| 125 | - | |
| 126 | - /** 配置车辆总数 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11)*/ | |
| 127 | - private Integer carSumNumber; | |
| 128 | - | |
| 129 | - /** 空调车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 130 | - private Integer hvacCarNumber; | |
| 131 | - | |
| 132 | - /** 普通车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 133 | - private Integer ordCarNumber; | |
| 134 | - | |
| 135 | - /** 权证车辆数量 报表需要的字段值 */ | |
| 136 | - private Integer warrantCar; | |
| 137 | - | |
| 138 | - /** 权证配车启用日期 报表需要的字段值 */ | |
| 139 | - private Integer warrantDate; | |
| 140 | - | |
| 141 | - /** 停车场编码 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 142 | - private String carParkCode; | |
| 143 | - | |
| 144 | - /** 线路规划类型 <0:双向;1:环线> int length(11) 运管处接口需要的字段 不能为空 */ | |
| 145 | - private Integer linePlayType; | |
| 146 | - | |
| 147 | - /** 描述 varchar length(255) */ | |
| 148 | - private String descriptions; | |
| 149 | - | |
| 150 | - /** 创建人 int length(11) */ | |
| 151 | - private Integer createBy; | |
| 152 | - | |
| 153 | - /** 修改人 int length(11) */ | |
| 154 | - private Integer updateBy; | |
| 155 | - | |
| 156 | - /** 创建日期 timestamp */ | |
| 157 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 158 | - private Date createDate; | |
| 159 | - | |
| 160 | - /** 修改日期 timestamp */ | |
| 161 | - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 162 | - private Date updateDate; | |
| 163 | - | |
| 164 | - /** 是否在使用 <1:是;0:否> bit length(50) */ | |
| 165 | - private Integer inUse; | |
| 166 | - | |
| 167 | - /** | |
| 168 | - * 逻辑删除标记 为 1:标识已删除 | |
| 169 | - */ | |
| 170 | - private Integer remove = 0; | |
| 171 | - | |
| 172 | - public Integer getSpacGrade() { | |
| 173 | - return spacGrade; | |
| 174 | - } | |
| 175 | - | |
| 176 | - public void setSpacGrade(Integer spacGrade) { | |
| 177 | - this.spacGrade = spacGrade; | |
| 178 | - } | |
| 179 | - | |
| 180 | - public Integer getWarrantCar() { | |
| 181 | - return warrantCar; | |
| 182 | - } | |
| 183 | - | |
| 184 | - public void setWarrantCar(Integer warrantCar) { | |
| 185 | - this.warrantCar = warrantCar; | |
| 186 | - } | |
| 187 | - | |
| 188 | - public Integer getWarrantDate() { | |
| 189 | - return warrantDate; | |
| 190 | - } | |
| 191 | - | |
| 192 | - public void setWarrantDate(Integer warrantDate) { | |
| 193 | - this.warrantDate = warrantDate; | |
| 194 | - } | |
| 195 | - | |
| 196 | - public Integer getLinePlayType() { | |
| 197 | - return linePlayType; | |
| 198 | - } | |
| 199 | - | |
| 200 | - public void setLinePlayType(Integer linePlayType) { | |
| 201 | - this.linePlayType = linePlayType; | |
| 202 | - } | |
| 203 | - | |
| 204 | - public Integer getId() { | |
| 205 | - return id; | |
| 206 | - } | |
| 207 | - | |
| 208 | - public void setId(Integer id) { | |
| 209 | - this.id = id; | |
| 210 | - } | |
| 211 | - | |
| 212 | - public String getLineCode() { | |
| 213 | - return lineCode; | |
| 214 | - } | |
| 215 | - | |
| 216 | - public void setLineCode(String lineCode) { | |
| 217 | - this.lineCode = lineCode; | |
| 218 | - } | |
| 219 | - | |
| 220 | - public String getName() { | |
| 221 | - return name; | |
| 222 | - } | |
| 223 | - | |
| 224 | - public void setName(String name) { | |
| 225 | - this.name = name; | |
| 226 | - } | |
| 227 | - | |
| 228 | - public String getEs() { | |
| 229 | - return es; | |
| 230 | - } | |
| 231 | - | |
| 232 | - public void setEs(String es) { | |
| 233 | - this.es = es; | |
| 234 | - } | |
| 235 | - | |
| 236 | - public String getShortName() { | |
| 237 | - return shortName; | |
| 238 | - } | |
| 239 | - | |
| 240 | - public void setShortName(String shortName) { | |
| 241 | - this.shortName = shortName; | |
| 242 | - } | |
| 243 | - | |
| 244 | - public Integer getCarSumNumber() { | |
| 245 | - return carSumNumber; | |
| 246 | - } | |
| 247 | - | |
| 248 | - public void setCarSumNumber(Integer carSumNumber) { | |
| 249 | - this.carSumNumber = carSumNumber; | |
| 250 | - } | |
| 251 | - | |
| 252 | - public Integer getHvacCarNumber() { | |
| 253 | - return hvacCarNumber; | |
| 254 | - } | |
| 255 | - | |
| 256 | - public void setHvacCarNumber(Integer hvacCarNumber) { | |
| 257 | - this.hvacCarNumber = hvacCarNumber; | |
| 258 | - } | |
| 259 | - | |
| 260 | - public Integer getOrdCarNumber() { | |
| 261 | - return ordCarNumber; | |
| 262 | - } | |
| 263 | - | |
| 264 | - public void setOrdCarNumber(Integer ordCarNumber) { | |
| 265 | - this.ordCarNumber = ordCarNumber; | |
| 266 | - } | |
| 267 | - | |
| 268 | - public String getCarParkCode() { | |
| 269 | - return carParkCode; | |
| 270 | - } | |
| 271 | - | |
| 272 | - public void setCarParkCode(String carParkCode) { | |
| 273 | - this.carParkCode = carParkCode; | |
| 274 | - } | |
| 275 | - | |
| 276 | - public String getStartStationName() { | |
| 277 | - return startStationName; | |
| 278 | - } | |
| 279 | - | |
| 280 | - public void setStartStationName(String startStationName) { | |
| 281 | - this.startStationName = startStationName; | |
| 282 | - } | |
| 283 | - | |
| 284 | - public String getStartStationFirstTime() { | |
| 285 | - return startStationFirstTime; | |
| 286 | - } | |
| 287 | - | |
| 288 | - public void setStartStationFirstTime(String startStationFirstTime) { | |
| 289 | - this.startStationFirstTime = startStationFirstTime; | |
| 290 | - } | |
| 291 | - | |
| 292 | - public String getStartStationEndTime() { | |
| 293 | - return startStationEndTime; | |
| 294 | - } | |
| 295 | - | |
| 296 | - public void setStartStationEndTime(String startStationEndTime) { | |
| 297 | - this.startStationEndTime = startStationEndTime; | |
| 298 | - } | |
| 299 | - | |
| 300 | - public String getEndStationName() { | |
| 301 | - return endStationName; | |
| 302 | - } | |
| 303 | - | |
| 304 | - public void setEndStationName(String endStationName) { | |
| 305 | - this.endStationName = endStationName; | |
| 306 | - } | |
| 307 | - | |
| 308 | - public String getEndStationFirstTime() { | |
| 309 | - return endStationFirstTime; | |
| 310 | - } | |
| 311 | - | |
| 312 | - public void setEndStationFirstTime(String endStationFirstTime) { | |
| 313 | - this.endStationFirstTime = endStationFirstTime; | |
| 314 | - } | |
| 315 | - | |
| 316 | - public String getEndStationEndTime() { | |
| 317 | - return endStationEndTime; | |
| 318 | - } | |
| 319 | - | |
| 320 | - public void setEndStationEndTime(String endStationEndTime) { | |
| 321 | - this.endStationEndTime = endStationEndTime; | |
| 322 | - } | |
| 323 | - | |
| 324 | - public String getCompany() { | |
| 325 | - return company; | |
| 326 | - } | |
| 327 | - | |
| 328 | - public void setCompany(String company) { | |
| 329 | - this.company = company; | |
| 330 | - } | |
| 331 | - | |
| 332 | - public String getBrancheCompany() { | |
| 333 | - return brancheCompany; | |
| 334 | - } | |
| 335 | - | |
| 336 | - public void setBrancheCompany(String brancheCompany) { | |
| 337 | - this.brancheCompany = brancheCompany; | |
| 338 | - } | |
| 339 | - | |
| 340 | - public String getNature() { | |
| 341 | - return nature; | |
| 342 | - } | |
| 343 | - | |
| 344 | - public void setNature(String nature) { | |
| 345 | - this.nature = nature; | |
| 346 | - } | |
| 347 | - | |
| 348 | - public String getLevel() { | |
| 349 | - return level; | |
| 350 | - } | |
| 351 | - | |
| 352 | - public void setLevel(String level) { | |
| 353 | - this.level = level; | |
| 354 | - } | |
| 355 | - | |
| 356 | - public double getLength() { | |
| 357 | - return length; | |
| 358 | - } | |
| 359 | - | |
| 360 | - public void setLength(double length) { | |
| 361 | - this.length = length; | |
| 362 | - } | |
| 363 | - | |
| 364 | - public String getChargeName() { | |
| 365 | - return chargeName; | |
| 366 | - } | |
| 367 | - | |
| 368 | - public void setChargeName(String chargeName) { | |
| 369 | - this.chargeName = chargeName; | |
| 370 | - } | |
| 371 | - | |
| 372 | - public String getTelephone() { | |
| 373 | - return telephone; | |
| 374 | - } | |
| 375 | - | |
| 376 | - public void setTelephone(String telephone) { | |
| 377 | - this.telephone = telephone; | |
| 378 | - } | |
| 379 | - | |
| 380 | - public Integer getDestroy() { | |
| 381 | - return destroy; | |
| 382 | - } | |
| 383 | - | |
| 384 | - public void setDestroy(Integer destroy) { | |
| 385 | - this.destroy = destroy; | |
| 386 | - } | |
| 387 | - | |
| 388 | - public Integer getSupperLine() { | |
| 389 | - return supperLine; | |
| 390 | - } | |
| 391 | - | |
| 392 | - public void setSupperLine(Integer supperLine) { | |
| 393 | - this.supperLine = supperLine; | |
| 394 | - } | |
| 395 | - | |
| 396 | - public String getStartPhone() { | |
| 397 | - return startPhone; | |
| 398 | - } | |
| 399 | - | |
| 400 | - public void setStartPhone(String startPhone) { | |
| 401 | - this.startPhone = startPhone; | |
| 402 | - } | |
| 403 | - | |
| 404 | - public String getEndPhone() { | |
| 405 | - return endPhone; | |
| 406 | - } | |
| 407 | - | |
| 408 | - public void setEndPhone(String endPhone) { | |
| 409 | - this.endPhone = endPhone; | |
| 410 | - } | |
| 411 | - | |
| 412 | - public Date getOpenDate() { | |
| 413 | - return openDate; | |
| 414 | - } | |
| 415 | - | |
| 416 | - public void setOpenDate(Date openDate) { | |
| 417 | - this.openDate = openDate; | |
| 418 | - } | |
| 419 | - | |
| 420 | - public String getHistory() { | |
| 421 | - return history; | |
| 422 | - } | |
| 423 | - | |
| 424 | - public void setHistory(String history) { | |
| 425 | - this.history = history; | |
| 426 | - } | |
| 427 | - | |
| 428 | - public String getShanghaiLinecode() { | |
| 429 | - return shanghaiLinecode; | |
| 430 | - } | |
| 431 | - | |
| 432 | - public void setShanghaiLinecode(String shanghaiLinecode) { | |
| 433 | - this.shanghaiLinecode = shanghaiLinecode; | |
| 434 | - } | |
| 435 | - | |
| 436 | - public String getEqLinecode() { | |
| 437 | - return eqLinecode; | |
| 438 | - } | |
| 439 | - | |
| 440 | - public void setEqLinecode(String eqLinecode) { | |
| 441 | - this.eqLinecode = eqLinecode; | |
| 442 | - } | |
| 443 | - | |
| 444 | - public String getDescriptions() { | |
| 445 | - return descriptions; | |
| 446 | - } | |
| 447 | - | |
| 448 | - public void setDescriptions(String descriptions) { | |
| 449 | - this.descriptions = descriptions; | |
| 450 | - } | |
| 451 | - | |
| 452 | - public Integer getCreateBy() { | |
| 453 | - return createBy; | |
| 454 | - } | |
| 455 | - | |
| 456 | - public void setCreateBy(Integer createBy) { | |
| 457 | - this.createBy = createBy; | |
| 458 | - } | |
| 459 | - | |
| 460 | - public Integer getUpdateBy() { | |
| 461 | - return updateBy; | |
| 462 | - } | |
| 463 | - | |
| 464 | - public void setUpdateBy(Integer updateBy) { | |
| 465 | - this.updateBy = updateBy; | |
| 466 | - } | |
| 467 | - | |
| 468 | - public Date getCreateDate() { | |
| 469 | - return createDate; | |
| 470 | - } | |
| 471 | - | |
| 472 | - public void setCreateDate(Date createDate) { | |
| 473 | - this.createDate = createDate; | |
| 474 | - } | |
| 475 | - | |
| 476 | - public Date getUpdateDate() { | |
| 477 | - return updateDate; | |
| 478 | - } | |
| 479 | - | |
| 480 | - public void setUpdateDate(Date updateDate) { | |
| 481 | - this.updateDate = updateDate; | |
| 482 | - } | |
| 483 | - | |
| 484 | - public Integer getInUse() { return inUse; } | |
| 485 | - | |
| 486 | - public void setInUse(Integer inUse) { this.inUse = inUse; } | |
| 487 | - | |
| 488 | - public String getCgsbm() { | |
| 489 | - return cgsbm; | |
| 490 | - } | |
| 491 | - | |
| 492 | - public void setCgsbm(String cgsbm) { | |
| 493 | - this.cgsbm = cgsbm; | |
| 494 | - } | |
| 495 | - | |
| 496 | - public Integer getSfyy() { | |
| 497 | - return sfyy; | |
| 498 | - } | |
| 499 | - | |
| 500 | - public void setSfyy(Integer sfyy) { | |
| 501 | - this.sfyy = sfyy; | |
| 502 | - } | |
| 503 | - | |
| 504 | - public Integer getRegion() { | |
| 505 | - return region; | |
| 506 | - } | |
| 507 | - | |
| 508 | - public void setRegion(Integer region) { | |
| 509 | - this.region = region; | |
| 510 | - } | |
| 511 | - | |
| 512 | - public Integer getRemove() { | |
| 513 | - return remove; | |
| 514 | - } | |
| 515 | - | |
| 516 | - public void setRemove(Integer remove) { | |
| 517 | - this.remove = remove; | |
| 518 | - } | |
| 519 | -} | |
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | +import org.hibernate.annotations.Formula; | |
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | + | |
| 7 | +import javax.persistence.*; | |
| 8 | +import java.io.Serializable; | |
| 9 | +import java.util.Date; | |
| 10 | + | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * | |
| 14 | + * @ClassName: Line(线路实体类) | |
| 15 | + * | |
| 16 | + * @Description: TODO(线路) | |
| 17 | + * | |
| 18 | + * @Author bsth@lq | |
| 19 | + * | |
| 20 | + * @Date 2016-4-11 16:06:17 | |
| 21 | + * | |
| 22 | + * @Version 公交调度系统BS版 0.1 | |
| 23 | + * | |
| 24 | + */ | |
| 25 | + | |
| 26 | +@Entity | |
| 27 | +@Table(name = "bsth_c_line") | |
| 28 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 29 | +public class Line implements Serializable { | |
| 30 | + | |
| 31 | + @Id | |
| 32 | + /** 线路ID 主键(唯一标识符) int length(11) */ | |
| 33 | + private Integer id; | |
| 34 | + | |
| 35 | + /** 线路名称 varchar length(50) 不能为空 */ | |
| 36 | + private String name; | |
| 37 | + | |
| 38 | + /** 线路编码 varchar length(50) 不能为空 */ | |
| 39 | + private String lineCode; | |
| 40 | + | |
| 41 | + /** 英文名 varchar length(50) */ | |
| 42 | + private String es; | |
| 43 | + | |
| 44 | + /** 简称 varchar length(50) */ | |
| 45 | + private String shortName; | |
| 46 | + | |
| 47 | + /** 起始站名称 varchar length(50) 不能为空 | |
| 48 | + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */ | |
| 49 | + private String startStationName; | |
| 50 | + | |
| 51 | + /** 终点站名称 varchar length(50) 不能为空 | |
| 52 | + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */ | |
| 53 | + private String endStationName; | |
| 54 | + | |
| 55 | + /** 起始站首班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */ | |
| 56 | + private String startStationFirstTime; | |
| 57 | + | |
| 58 | + /** 起始站末班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */ | |
| 59 | + private String startStationEndTime; | |
| 60 | + | |
| 61 | + /** 终点站首班时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空*/ | |
| 62 | + private String endStationFirstTime; | |
| 63 | + | |
| 64 | + /** 终点站末班时间 00:00 上海公交APP中某个接口所需要的字段值 */ | |
| 65 | + private String endStationEndTime; | |
| 66 | + | |
| 67 | + /** 所属公司 varchar length(50) */ | |
| 68 | + private String company; | |
| 69 | + | |
| 70 | + /** 分公司 varchar length(50)*/ | |
| 71 | + private String brancheCompany; | |
| 72 | + | |
| 73 | + /** 组合公司分公司编码 */ | |
| 74 | + @Formula(" concat(company, '_', branche_company) ") | |
| 75 | + private String cgsbm; | |
| 76 | + | |
| 77 | + /** 性质(线路类型) varchar length(50) */ | |
| 78 | + private String nature; | |
| 79 | + | |
| 80 | + /** 线路等级 varchar length(50) */ | |
| 81 | + private String level; | |
| 82 | + | |
| 83 | + /** 线路长度 */ | |
| 84 | + private double length; | |
| 85 | + | |
| 86 | + /** 线路负责人 varchar length(50) */ | |
| 87 | + private String chargeName; | |
| 88 | + | |
| 89 | + /** 负责人电话 varchar length(50) */ | |
| 90 | + private String telephone; | |
| 91 | + | |
| 92 | + /** 是否撤销 <1:是;0:否> bit length(50) */ | |
| 93 | + private Integer destroy; | |
| 94 | + | |
| 95 | + /** 是否夜宵线 <1:是;0:否> bit length(50)*/ | |
| 96 | + private Integer supperLine; | |
| 97 | + | |
| 98 | + /** 是否营运 <1:是;0:否> bit length(50)*/ | |
| 99 | + private Integer sfyy; | |
| 100 | + | |
| 101 | + /** 线路区域 <0:区内,1:区外> bit length(1)*/ | |
| 102 | + private Integer region; | |
| 103 | + | |
| 104 | + /** 起始调度电话 varchar length(50) */ | |
| 105 | + private String startPhone; | |
| 106 | + | |
| 107 | + /** 终点调度电话 varchar length(50) */ | |
| 108 | + private String endPhone; | |
| 109 | + | |
| 110 | + /** 开辟日期 date*/ | |
| 111 | + @DateTimeFormat(pattern ="yyyy-MM-dd") | |
| 112 | + private Date openDate; | |
| 113 | + | |
| 114 | + /** 大间隔等级 */ | |
| 115 | + private Integer spacGrade; | |
| 116 | + | |
| 117 | + /** 线路沿革 varchar length(50) */ | |
| 118 | + private String history; | |
| 119 | + | |
| 120 | + /** 上海市线路编码 varchar length(50) */ | |
| 121 | + private String shanghaiLinecode; | |
| 122 | + | |
| 123 | + /** 设备线路编码 varchar length(50) */ | |
| 124 | + private String eqLinecode; | |
| 125 | + | |
| 126 | + /** 配置车辆总数 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11)*/ | |
| 127 | + private Integer carSumNumber; | |
| 128 | + | |
| 129 | + /** 空调车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 130 | + private Integer hvacCarNumber; | |
| 131 | + | |
| 132 | + /** 普通车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 133 | + private Integer ordCarNumber; | |
| 134 | + | |
| 135 | + /** 权证车辆数量 报表需要的字段值 */ | |
| 136 | + private Integer warrantCar; | |
| 137 | + | |
| 138 | + /** 权证配车启用日期 报表需要的字段值 */ | |
| 139 | + private Integer warrantDate; | |
| 140 | + | |
| 141 | + /** 停车场编码 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */ | |
| 142 | + private String carParkCode; | |
| 143 | + | |
| 144 | + /** 线路规划类型 <0:双向;1:环线> int length(11) 运管处接口需要的字段 不能为空 */ | |
| 145 | + private Integer linePlayType; | |
| 146 | + | |
| 147 | + /** 描述 varchar length(255) */ | |
| 148 | + private String descriptions; | |
| 149 | + | |
| 150 | + /** 创建人 int length(11) */ | |
| 151 | + private Integer createBy; | |
| 152 | + | |
| 153 | + /** 修改人 int length(11) */ | |
| 154 | + private Integer updateBy; | |
| 155 | + | |
| 156 | + /** 创建日期 timestamp */ | |
| 157 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 158 | + private Date createDate; | |
| 159 | + | |
| 160 | + /** 修改日期 timestamp */ | |
| 161 | + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 162 | + private Date updateDate; | |
| 163 | + | |
| 164 | + /** 是否在使用 <1:是;0:否> bit length(50) */ | |
| 165 | + private Integer inUse; | |
| 166 | + | |
| 167 | + private Double ticketPrice; | |
| 168 | + | |
| 169 | + /** | |
| 170 | + * 逻辑删除标记 为 1:标识已删除 | |
| 171 | + */ | |
| 172 | + private Integer remove = 0; | |
| 173 | + | |
| 174 | + public Integer getSpacGrade() { | |
| 175 | + return spacGrade; | |
| 176 | + } | |
| 177 | + | |
| 178 | + public void setSpacGrade(Integer spacGrade) { | |
| 179 | + this.spacGrade = spacGrade; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public Integer getWarrantCar() { | |
| 183 | + return warrantCar; | |
| 184 | + } | |
| 185 | + | |
| 186 | + public void setWarrantCar(Integer warrantCar) { | |
| 187 | + this.warrantCar = warrantCar; | |
| 188 | + } | |
| 189 | + | |
| 190 | + public Integer getWarrantDate() { | |
| 191 | + return warrantDate; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public void setWarrantDate(Integer warrantDate) { | |
| 195 | + this.warrantDate = warrantDate; | |
| 196 | + } | |
| 197 | + | |
| 198 | + public Integer getLinePlayType() { | |
| 199 | + return linePlayType; | |
| 200 | + } | |
| 201 | + | |
| 202 | + public void setLinePlayType(Integer linePlayType) { | |
| 203 | + this.linePlayType = linePlayType; | |
| 204 | + } | |
| 205 | + | |
| 206 | + public Integer getId() { | |
| 207 | + return id; | |
| 208 | + } | |
| 209 | + | |
| 210 | + public void setId(Integer id) { | |
| 211 | + this.id = id; | |
| 212 | + } | |
| 213 | + | |
| 214 | + public String getLineCode() { | |
| 215 | + return lineCode; | |
| 216 | + } | |
| 217 | + | |
| 218 | + public void setLineCode(String lineCode) { | |
| 219 | + this.lineCode = lineCode; | |
| 220 | + } | |
| 221 | + | |
| 222 | + public String getName() { | |
| 223 | + return name; | |
| 224 | + } | |
| 225 | + | |
| 226 | + public void setName(String name) { | |
| 227 | + this.name = name; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public String getEs() { | |
| 231 | + return es; | |
| 232 | + } | |
| 233 | + | |
| 234 | + public void setEs(String es) { | |
| 235 | + this.es = es; | |
| 236 | + } | |
| 237 | + | |
| 238 | + public String getShortName() { | |
| 239 | + return shortName; | |
| 240 | + } | |
| 241 | + | |
| 242 | + public void setShortName(String shortName) { | |
| 243 | + this.shortName = shortName; | |
| 244 | + } | |
| 245 | + | |
| 246 | + public Integer getCarSumNumber() { | |
| 247 | + return carSumNumber; | |
| 248 | + } | |
| 249 | + | |
| 250 | + public void setCarSumNumber(Integer carSumNumber) { | |
| 251 | + this.carSumNumber = carSumNumber; | |
| 252 | + } | |
| 253 | + | |
| 254 | + public Integer getHvacCarNumber() { | |
| 255 | + return hvacCarNumber; | |
| 256 | + } | |
| 257 | + | |
| 258 | + public void setHvacCarNumber(Integer hvacCarNumber) { | |
| 259 | + this.hvacCarNumber = hvacCarNumber; | |
| 260 | + } | |
| 261 | + | |
| 262 | + public Integer getOrdCarNumber() { | |
| 263 | + return ordCarNumber; | |
| 264 | + } | |
| 265 | + | |
| 266 | + public void setOrdCarNumber(Integer ordCarNumber) { | |
| 267 | + this.ordCarNumber = ordCarNumber; | |
| 268 | + } | |
| 269 | + | |
| 270 | + public String getCarParkCode() { | |
| 271 | + return carParkCode; | |
| 272 | + } | |
| 273 | + | |
| 274 | + public void setCarParkCode(String carParkCode) { | |
| 275 | + this.carParkCode = carParkCode; | |
| 276 | + } | |
| 277 | + | |
| 278 | + public String getStartStationName() { | |
| 279 | + return startStationName; | |
| 280 | + } | |
| 281 | + | |
| 282 | + public void setStartStationName(String startStationName) { | |
| 283 | + this.startStationName = startStationName; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public String getStartStationFirstTime() { | |
| 287 | + return startStationFirstTime; | |
| 288 | + } | |
| 289 | + | |
| 290 | + public void setStartStationFirstTime(String startStationFirstTime) { | |
| 291 | + this.startStationFirstTime = startStationFirstTime; | |
| 292 | + } | |
| 293 | + | |
| 294 | + public String getStartStationEndTime() { | |
| 295 | + return startStationEndTime; | |
| 296 | + } | |
| 297 | + | |
| 298 | + public void setStartStationEndTime(String startStationEndTime) { | |
| 299 | + this.startStationEndTime = startStationEndTime; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public String getEndStationName() { | |
| 303 | + return endStationName; | |
| 304 | + } | |
| 305 | + | |
| 306 | + public void setEndStationName(String endStationName) { | |
| 307 | + this.endStationName = endStationName; | |
| 308 | + } | |
| 309 | + | |
| 310 | + public String getEndStationFirstTime() { | |
| 311 | + return endStationFirstTime; | |
| 312 | + } | |
| 313 | + | |
| 314 | + public void setEndStationFirstTime(String endStationFirstTime) { | |
| 315 | + this.endStationFirstTime = endStationFirstTime; | |
| 316 | + } | |
| 317 | + | |
| 318 | + public String getEndStationEndTime() { | |
| 319 | + return endStationEndTime; | |
| 320 | + } | |
| 321 | + | |
| 322 | + public void setEndStationEndTime(String endStationEndTime) { | |
| 323 | + this.endStationEndTime = endStationEndTime; | |
| 324 | + } | |
| 325 | + | |
| 326 | + public String getCompany() { | |
| 327 | + return company; | |
| 328 | + } | |
| 329 | + | |
| 330 | + public void setCompany(String company) { | |
| 331 | + this.company = company; | |
| 332 | + } | |
| 333 | + | |
| 334 | + public String getBrancheCompany() { | |
| 335 | + return brancheCompany; | |
| 336 | + } | |
| 337 | + | |
| 338 | + public void setBrancheCompany(String brancheCompany) { | |
| 339 | + this.brancheCompany = brancheCompany; | |
| 340 | + } | |
| 341 | + | |
| 342 | + public String getNature() { | |
| 343 | + return nature; | |
| 344 | + } | |
| 345 | + | |
| 346 | + public void setNature(String nature) { | |
| 347 | + this.nature = nature; | |
| 348 | + } | |
| 349 | + | |
| 350 | + public String getLevel() { | |
| 351 | + return level; | |
| 352 | + } | |
| 353 | + | |
| 354 | + public void setLevel(String level) { | |
| 355 | + this.level = level; | |
| 356 | + } | |
| 357 | + | |
| 358 | + public double getLength() { | |
| 359 | + return length; | |
| 360 | + } | |
| 361 | + | |
| 362 | + public void setLength(double length) { | |
| 363 | + this.length = length; | |
| 364 | + } | |
| 365 | + | |
| 366 | + public String getChargeName() { | |
| 367 | + return chargeName; | |
| 368 | + } | |
| 369 | + | |
| 370 | + public void setChargeName(String chargeName) { | |
| 371 | + this.chargeName = chargeName; | |
| 372 | + } | |
| 373 | + | |
| 374 | + public String getTelephone() { | |
| 375 | + return telephone; | |
| 376 | + } | |
| 377 | + | |
| 378 | + public void setTelephone(String telephone) { | |
| 379 | + this.telephone = telephone; | |
| 380 | + } | |
| 381 | + | |
| 382 | + public Integer getDestroy() { | |
| 383 | + return destroy; | |
| 384 | + } | |
| 385 | + | |
| 386 | + public void setDestroy(Integer destroy) { | |
| 387 | + this.destroy = destroy; | |
| 388 | + } | |
| 389 | + | |
| 390 | + public Integer getSupperLine() { | |
| 391 | + return supperLine; | |
| 392 | + } | |
| 393 | + | |
| 394 | + public void setSupperLine(Integer supperLine) { | |
| 395 | + this.supperLine = supperLine; | |
| 396 | + } | |
| 397 | + | |
| 398 | + public String getStartPhone() { | |
| 399 | + return startPhone; | |
| 400 | + } | |
| 401 | + | |
| 402 | + public void setStartPhone(String startPhone) { | |
| 403 | + this.startPhone = startPhone; | |
| 404 | + } | |
| 405 | + | |
| 406 | + public String getEndPhone() { | |
| 407 | + return endPhone; | |
| 408 | + } | |
| 409 | + | |
| 410 | + public void setEndPhone(String endPhone) { | |
| 411 | + this.endPhone = endPhone; | |
| 412 | + } | |
| 413 | + | |
| 414 | + public Date getOpenDate() { | |
| 415 | + return openDate; | |
| 416 | + } | |
| 417 | + | |
| 418 | + public void setOpenDate(Date openDate) { | |
| 419 | + this.openDate = openDate; | |
| 420 | + } | |
| 421 | + | |
| 422 | + public String getHistory() { | |
| 423 | + return history; | |
| 424 | + } | |
| 425 | + | |
| 426 | + public void setHistory(String history) { | |
| 427 | + this.history = history; | |
| 428 | + } | |
| 429 | + | |
| 430 | + public String getShanghaiLinecode() { | |
| 431 | + return shanghaiLinecode; | |
| 432 | + } | |
| 433 | + | |
| 434 | + public void setShanghaiLinecode(String shanghaiLinecode) { | |
| 435 | + this.shanghaiLinecode = shanghaiLinecode; | |
| 436 | + } | |
| 437 | + | |
| 438 | + public String getEqLinecode() { | |
| 439 | + return eqLinecode; | |
| 440 | + } | |
| 441 | + | |
| 442 | + public void setEqLinecode(String eqLinecode) { | |
| 443 | + this.eqLinecode = eqLinecode; | |
| 444 | + } | |
| 445 | + | |
| 446 | + public String getDescriptions() { | |
| 447 | + return descriptions; | |
| 448 | + } | |
| 449 | + | |
| 450 | + public void setDescriptions(String descriptions) { | |
| 451 | + this.descriptions = descriptions; | |
| 452 | + } | |
| 453 | + | |
| 454 | + public Integer getCreateBy() { | |
| 455 | + return createBy; | |
| 456 | + } | |
| 457 | + | |
| 458 | + public void setCreateBy(Integer createBy) { | |
| 459 | + this.createBy = createBy; | |
| 460 | + } | |
| 461 | + | |
| 462 | + public Integer getUpdateBy() { | |
| 463 | + return updateBy; | |
| 464 | + } | |
| 465 | + | |
| 466 | + public void setUpdateBy(Integer updateBy) { | |
| 467 | + this.updateBy = updateBy; | |
| 468 | + } | |
| 469 | + | |
| 470 | + public Date getCreateDate() { | |
| 471 | + return createDate; | |
| 472 | + } | |
| 473 | + | |
| 474 | + public void setCreateDate(Date createDate) { | |
| 475 | + this.createDate = createDate; | |
| 476 | + } | |
| 477 | + | |
| 478 | + public Date getUpdateDate() { | |
| 479 | + return updateDate; | |
| 480 | + } | |
| 481 | + | |
| 482 | + public void setUpdateDate(Date updateDate) { | |
| 483 | + this.updateDate = updateDate; | |
| 484 | + } | |
| 485 | + | |
| 486 | + public Integer getInUse() { return inUse; } | |
| 487 | + | |
| 488 | + public void setInUse(Integer inUse) { this.inUse = inUse; } | |
| 489 | + | |
| 490 | + public String getCgsbm() { | |
| 491 | + return cgsbm; | |
| 492 | + } | |
| 493 | + | |
| 494 | + public void setCgsbm(String cgsbm) { | |
| 495 | + this.cgsbm = cgsbm; | |
| 496 | + } | |
| 497 | + | |
| 498 | + public Integer getSfyy() { | |
| 499 | + return sfyy; | |
| 500 | + } | |
| 501 | + | |
| 502 | + public void setSfyy(Integer sfyy) { | |
| 503 | + this.sfyy = sfyy; | |
| 504 | + } | |
| 505 | + | |
| 506 | + public Integer getRegion() { | |
| 507 | + return region; | |
| 508 | + } | |
| 509 | + | |
| 510 | + public void setRegion(Integer region) { | |
| 511 | + this.region = region; | |
| 512 | + } | |
| 513 | + | |
| 514 | + public Integer getRemove() { | |
| 515 | + return remove; | |
| 516 | + } | |
| 517 | + | |
| 518 | + public void setRemove(Integer remove) { | |
| 519 | + this.remove = remove; | |
| 520 | + } | |
| 521 | + | |
| 522 | + public Double getTicketPrice() { | |
| 523 | + return ticketPrice; | |
| 524 | + } | |
| 525 | + | |
| 526 | + public void setTicketPrice(Double ticketPrice) { | |
| 527 | + this.ticketPrice = ticketPrice; | |
| 528 | + } | |
| 529 | + | |
| 530 | +} | ... | ... |
src/main/java/com/bsth/entity/LsStationRoute.java
| 1 | -package com.bsth.entity; | |
| 2 | - | |
| 3 | -import javax.persistence.*; | |
| 4 | -import java.util.Date; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * | |
| 8 | - * @ClassName : StationRoute(历史站点路由实体类) | |
| 9 | - * | |
| 10 | - * @Author : bsth@lq | |
| 11 | - * | |
| 12 | - * @Description : TODO(历史站点路由) | |
| 13 | - * | |
| 14 | - * @Version 公交调度系统BS版 0.1 | |
| 15 | - * | |
| 16 | - */ | |
| 17 | - | |
| 18 | -@Entity | |
| 19 | -@Table(name = "bsth_c_ls_stationroute") | |
| 20 | -@NamedEntityGraphs({ | |
| 21 | - @NamedEntityGraph(name = "ls_stationRoute_station", attributeNodes = { | |
| 22 | - @NamedAttributeNode("station"), | |
| 23 | - @NamedAttributeNode("line") | |
| 24 | - }) | |
| 25 | -}) | |
| 26 | -public class LsStationRoute { | |
| 27 | - | |
| 28 | - //站点路由ID | |
| 29 | - @Id | |
| 30 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 31 | - private Integer id; | |
| 32 | - | |
| 33 | - // 站点路由序号 | |
| 34 | - private Integer stationRouteCode; | |
| 35 | - | |
| 36 | - // 站点编码 | |
| 37 | - private String stationCode; | |
| 38 | - | |
| 39 | - // 站点名称 | |
| 40 | - private String stationName; | |
| 41 | - | |
| 42 | - // 线路编码 | |
| 43 | - private String lineCode; | |
| 44 | - | |
| 45 | - // 行业编码 | |
| 46 | - private String industryCode; | |
| 47 | - /** | |
| 48 | - * 站点类型 | |
| 49 | - * | |
| 50 | - * ------ B:起点站 | |
| 51 | - * | |
| 52 | - * ------ Z:中途站 | |
| 53 | - * | |
| 54 | - * ------ E:终点站 | |
| 55 | - * | |
| 56 | - * ------ T:停车场 | |
| 57 | - * | |
| 58 | - */ | |
| 59 | - private String stationMark; | |
| 60 | - | |
| 61 | - // 站点路由出站序号 | |
| 62 | - private Integer outStationNmber; | |
| 63 | - | |
| 64 | - // 站点路由到站距离 | |
| 65 | - private Double distances; | |
| 66 | - | |
| 67 | - // 站点路由到站时间 | |
| 68 | - private Double toTime; | |
| 69 | - | |
| 70 | - // 首班时间 | |
| 71 | - private String firstTime; | |
| 72 | - | |
| 73 | - // 末班时间 | |
| 74 | - private String endTime; | |
| 75 | - | |
| 76 | - // 站点路由方向 | |
| 77 | - private Integer directions; | |
| 78 | - | |
| 79 | - // 版本号 | |
| 80 | - private Integer versions; | |
| 81 | - | |
| 82 | - // 是否撤销 | |
| 83 | - private Integer destroy; | |
| 84 | - | |
| 85 | - // 描述 | |
| 86 | - private String descriptions; | |
| 87 | - | |
| 88 | - // 创建人 | |
| 89 | - private Integer createBy; | |
| 90 | - | |
| 91 | - // 修改人 | |
| 92 | - private Integer updateBy; | |
| 93 | - | |
| 94 | - // 创建日期 | |
| 95 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 96 | - private Date createDate; | |
| 97 | - | |
| 98 | - // 修改日期 | |
| 99 | - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 100 | - private Date updateDate; | |
| 101 | - | |
| 102 | - // 站点信息 | |
| 103 | - @ManyToOne(fetch = FetchType.LAZY) | |
| 104 | - private Station station; | |
| 105 | - | |
| 106 | - // 线路信息 | |
| 107 | - @ManyToOne | |
| 108 | - private Line line; | |
| 109 | - | |
| 110 | - public Integer getId() { | |
| 111 | - return id; | |
| 112 | - } | |
| 113 | - | |
| 114 | - public void setId(Integer id) { | |
| 115 | - this.id = id; | |
| 116 | - } | |
| 117 | - | |
| 118 | - public Integer getStationRouteCode() { | |
| 119 | - return stationRouteCode; | |
| 120 | - } | |
| 121 | - | |
| 122 | - public void setStationRouteCode(Integer stationRouteCode) { | |
| 123 | - this.stationRouteCode = stationRouteCode; | |
| 124 | - } | |
| 125 | - | |
| 126 | - public String getStationCode() { | |
| 127 | - return stationCode; | |
| 128 | - } | |
| 129 | - | |
| 130 | - public void setStationCode(String stationCode) { | |
| 131 | - this.stationCode = stationCode; | |
| 132 | - } | |
| 133 | - | |
| 134 | - public String getStationName() { | |
| 135 | - return stationName; | |
| 136 | - } | |
| 137 | - | |
| 138 | - public void setStationName(String stationName) { | |
| 139 | - this.stationName = stationName; | |
| 140 | - } | |
| 141 | - | |
| 142 | - public String getLineCode() { | |
| 143 | - return lineCode; | |
| 144 | - } | |
| 145 | - | |
| 146 | - public void setLineCode(String lineCode) { | |
| 147 | - this.lineCode = lineCode; | |
| 148 | - } | |
| 149 | - | |
| 150 | - public String getIndustryCode() { | |
| 151 | - return industryCode; | |
| 152 | - } | |
| 153 | - | |
| 154 | - public void setIndustryCode(String industryCode) { | |
| 155 | - this.industryCode = industryCode; | |
| 156 | - } | |
| 157 | - | |
| 158 | - public String getStationMark() { | |
| 159 | - return stationMark; | |
| 160 | - } | |
| 161 | - | |
| 162 | - public void setStationMark(String stationMark) { | |
| 163 | - this.stationMark = stationMark; | |
| 164 | - } | |
| 165 | - | |
| 166 | - public Integer getOutStationNmber() { | |
| 167 | - return outStationNmber; | |
| 168 | - } | |
| 169 | - | |
| 170 | - public void setOutStationNmber(Integer outStationNmber) { | |
| 171 | - this.outStationNmber = outStationNmber; | |
| 172 | - } | |
| 173 | - | |
| 174 | - public Double getDistances() { | |
| 175 | - return distances; | |
| 176 | - } | |
| 177 | - | |
| 178 | - public void setDistances(Double distances) { | |
| 179 | - this.distances = distances; | |
| 180 | - } | |
| 181 | - | |
| 182 | - public Double getToTime() { | |
| 183 | - return toTime; | |
| 184 | - } | |
| 185 | - | |
| 186 | - public void setToTime(Double toTime) { | |
| 187 | - this.toTime = toTime; | |
| 188 | - } | |
| 189 | - | |
| 190 | - public String getFirstTime() { | |
| 191 | - return firstTime; | |
| 192 | - } | |
| 193 | - | |
| 194 | - public void setFirstTime(String firstTime) { | |
| 195 | - this.firstTime = firstTime; | |
| 196 | - } | |
| 197 | - | |
| 198 | - public String getEndTime() { | |
| 199 | - return endTime; | |
| 200 | - } | |
| 201 | - | |
| 202 | - public void setEndTime(String endTime) { | |
| 203 | - this.endTime = endTime; | |
| 204 | - } | |
| 205 | - | |
| 206 | - public Integer getDirections() { | |
| 207 | - return directions; | |
| 208 | - } | |
| 209 | - | |
| 210 | - public void setDirections(Integer directions) { | |
| 211 | - this.directions = directions; | |
| 212 | - } | |
| 213 | - | |
| 214 | - public Integer getVersions() { | |
| 215 | - return versions; | |
| 216 | - } | |
| 217 | - | |
| 218 | - public void setVersions(Integer versions) { | |
| 219 | - this.versions = versions; | |
| 220 | - } | |
| 221 | - | |
| 222 | - public Integer getDestroy() { | |
| 223 | - return destroy; | |
| 224 | - } | |
| 225 | - | |
| 226 | - public void setDestroy(Integer destroy) { | |
| 227 | - this.destroy = destroy; | |
| 228 | - } | |
| 229 | - | |
| 230 | - public String getDescriptions() { | |
| 231 | - return descriptions; | |
| 232 | - } | |
| 233 | - | |
| 234 | - public void setDescriptions(String descriptions) { | |
| 235 | - this.descriptions = descriptions; | |
| 236 | - } | |
| 237 | - | |
| 238 | - public Integer getCreateBy() { | |
| 239 | - return createBy; | |
| 240 | - } | |
| 241 | - | |
| 242 | - public void setCreateBy(Integer createBy) { | |
| 243 | - this.createBy = createBy; | |
| 244 | - } | |
| 245 | - | |
| 246 | - public Integer getUpdateBy() { | |
| 247 | - return updateBy; | |
| 248 | - } | |
| 249 | - | |
| 250 | - public void setUpdateBy(Integer updateBy) { | |
| 251 | - this.updateBy = updateBy; | |
| 252 | - } | |
| 253 | - | |
| 254 | - public Date getCreateDate() { | |
| 255 | - return createDate; | |
| 256 | - } | |
| 257 | - | |
| 258 | - public void setCreateDate(Date createDate) { | |
| 259 | - this.createDate = createDate; | |
| 260 | - } | |
| 261 | - | |
| 262 | - public Date getUpdateDate() { | |
| 263 | - return updateDate; | |
| 264 | - } | |
| 265 | - | |
| 266 | - public void setUpdateDate(Date updateDate) { | |
| 267 | - this.updateDate = updateDate; | |
| 268 | - } | |
| 269 | - | |
| 270 | - public Station getStation() { | |
| 271 | - return station; | |
| 272 | - } | |
| 273 | - | |
| 274 | - public void setStation(Station station) { | |
| 275 | - this.station = station; | |
| 276 | - } | |
| 277 | - | |
| 278 | - public Line getLine() { | |
| 279 | - return line; | |
| 280 | - } | |
| 281 | - | |
| 282 | - public void setLine(Line line) { | |
| 283 | - this.line = line; | |
| 284 | - } | |
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import javax.persistence.*; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * | |
| 8 | + * @ClassName : StationRoute(历史站点路由实体类) | |
| 9 | + * | |
| 10 | + * @Author : bsth@lq | |
| 11 | + * | |
| 12 | + * @Description : TODO(历史站点路由) | |
| 13 | + * | |
| 14 | + * @Version 公交调度系统BS版 0.1 | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +@Entity | |
| 19 | +@Table(name = "bsth_c_ls_stationroute") | |
| 20 | +@NamedEntityGraphs({ | |
| 21 | + @NamedEntityGraph(name = "ls_stationRoute_station", attributeNodes = { | |
| 22 | + @NamedAttributeNode("station"), | |
| 23 | + @NamedAttributeNode("line") | |
| 24 | + }) | |
| 25 | +}) | |
| 26 | +public class LsStationRoute { | |
| 27 | + | |
| 28 | + //站点路由ID | |
| 29 | + @Id | |
| 30 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 31 | + private Integer id; | |
| 32 | + | |
| 33 | + // 站点路由序号 | |
| 34 | + private Integer stationRouteCode; | |
| 35 | + | |
| 36 | + // 站点编码 | |
| 37 | + private String stationCode; | |
| 38 | + | |
| 39 | + // 站点名称 | |
| 40 | + private String stationName; | |
| 41 | + // 站点名称 | |
| 42 | + private String stationNameEn; | |
| 43 | + | |
| 44 | + // 线路编码 | |
| 45 | + private String lineCode; | |
| 46 | + | |
| 47 | + // 行业编码 | |
| 48 | + private String industryCode; | |
| 49 | + /** | |
| 50 | + * 站点类型 | |
| 51 | + * | |
| 52 | + * ------ B:起点站 | |
| 53 | + * | |
| 54 | + * ------ Z:中途站 | |
| 55 | + * | |
| 56 | + * ------ E:终点站 | |
| 57 | + * | |
| 58 | + * ------ T:停车场 | |
| 59 | + * | |
| 60 | + */ | |
| 61 | + private String stationMark; | |
| 62 | + | |
| 63 | + // 站点路由出站序号 | |
| 64 | + private Integer outStationNmber; | |
| 65 | + | |
| 66 | + // 站点路由到站距离 | |
| 67 | + private Double distances; | |
| 68 | + | |
| 69 | + // 站点路由到站时间 | |
| 70 | + private Double toTime; | |
| 71 | + | |
| 72 | + // 首班时间 | |
| 73 | + private String firstTime; | |
| 74 | + | |
| 75 | + // 末班时间 | |
| 76 | + private String endTime; | |
| 77 | + | |
| 78 | + // 站点路由方向 | |
| 79 | + private Integer directions; | |
| 80 | + | |
| 81 | + // 版本号 | |
| 82 | + private Integer versions; | |
| 83 | + | |
| 84 | + // 是否撤销 | |
| 85 | + private Integer destroy; | |
| 86 | + | |
| 87 | + // 描述 | |
| 88 | + private String descriptions; | |
| 89 | + | |
| 90 | + // 创建人 | |
| 91 | + private Integer createBy; | |
| 92 | + | |
| 93 | + // 修改人 | |
| 94 | + private Integer updateBy; | |
| 95 | + | |
| 96 | + // 创建日期 | |
| 97 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 98 | + private Date createDate; | |
| 99 | + | |
| 100 | + // 修改日期 | |
| 101 | + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 102 | + private Date updateDate; | |
| 103 | + | |
| 104 | + // 站点信息 | |
| 105 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 106 | + private Station station; | |
| 107 | + | |
| 108 | + // 线路信息 | |
| 109 | + @ManyToOne | |
| 110 | + private Line line; | |
| 111 | + | |
| 112 | + public Integer getId() { | |
| 113 | + return id; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setId(Integer id) { | |
| 117 | + this.id = id; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public Integer getStationRouteCode() { | |
| 121 | + return stationRouteCode; | |
| 122 | + } | |
| 123 | + | |
| 124 | + public void setStationRouteCode(Integer stationRouteCode) { | |
| 125 | + this.stationRouteCode = stationRouteCode; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public String getStationCode() { | |
| 129 | + return stationCode; | |
| 130 | + } | |
| 131 | + | |
| 132 | + public void setStationCode(String stationCode) { | |
| 133 | + this.stationCode = stationCode; | |
| 134 | + } | |
| 135 | + | |
| 136 | + public String getStationName() { | |
| 137 | + return stationName; | |
| 138 | + } | |
| 139 | + | |
| 140 | + public void setStationName(String stationName) { | |
| 141 | + this.stationName = stationName; | |
| 142 | + } | |
| 143 | + | |
| 144 | + public String getLineCode() { | |
| 145 | + return lineCode; | |
| 146 | + } | |
| 147 | + | |
| 148 | + public void setLineCode(String lineCode) { | |
| 149 | + this.lineCode = lineCode; | |
| 150 | + } | |
| 151 | + | |
| 152 | + public String getIndustryCode() { | |
| 153 | + return industryCode; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public void setIndustryCode(String industryCode) { | |
| 157 | + this.industryCode = industryCode; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public String getStationMark() { | |
| 161 | + return stationMark; | |
| 162 | + } | |
| 163 | + | |
| 164 | + public void setStationMark(String stationMark) { | |
| 165 | + this.stationMark = stationMark; | |
| 166 | + } | |
| 167 | + | |
| 168 | + public Integer getOutStationNmber() { | |
| 169 | + return outStationNmber; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public void setOutStationNmber(Integer outStationNmber) { | |
| 173 | + this.outStationNmber = outStationNmber; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public Double getDistances() { | |
| 177 | + return distances; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public void setDistances(Double distances) { | |
| 181 | + this.distances = distances; | |
| 182 | + } | |
| 183 | + | |
| 184 | + public Double getToTime() { | |
| 185 | + return toTime; | |
| 186 | + } | |
| 187 | + | |
| 188 | + public void setToTime(Double toTime) { | |
| 189 | + this.toTime = toTime; | |
| 190 | + } | |
| 191 | + | |
| 192 | + public String getFirstTime() { | |
| 193 | + return firstTime; | |
| 194 | + } | |
| 195 | + | |
| 196 | + public void setFirstTime(String firstTime) { | |
| 197 | + this.firstTime = firstTime; | |
| 198 | + } | |
| 199 | + | |
| 200 | + public String getEndTime() { | |
| 201 | + return endTime; | |
| 202 | + } | |
| 203 | + | |
| 204 | + public void setEndTime(String endTime) { | |
| 205 | + this.endTime = endTime; | |
| 206 | + } | |
| 207 | + | |
| 208 | + public Integer getDirections() { | |
| 209 | + return directions; | |
| 210 | + } | |
| 211 | + | |
| 212 | + public void setDirections(Integer directions) { | |
| 213 | + this.directions = directions; | |
| 214 | + } | |
| 215 | + | |
| 216 | + public Integer getVersions() { | |
| 217 | + return versions; | |
| 218 | + } | |
| 219 | + | |
| 220 | + public void setVersions(Integer versions) { | |
| 221 | + this.versions = versions; | |
| 222 | + } | |
| 223 | + | |
| 224 | + public Integer getDestroy() { | |
| 225 | + return destroy; | |
| 226 | + } | |
| 227 | + | |
| 228 | + public void setDestroy(Integer destroy) { | |
| 229 | + this.destroy = destroy; | |
| 230 | + } | |
| 231 | + | |
| 232 | + public String getDescriptions() { | |
| 233 | + return descriptions; | |
| 234 | + } | |
| 235 | + | |
| 236 | + public void setDescriptions(String descriptions) { | |
| 237 | + this.descriptions = descriptions; | |
| 238 | + } | |
| 239 | + | |
| 240 | + public Integer getCreateBy() { | |
| 241 | + return createBy; | |
| 242 | + } | |
| 243 | + | |
| 244 | + public void setCreateBy(Integer createBy) { | |
| 245 | + this.createBy = createBy; | |
| 246 | + } | |
| 247 | + | |
| 248 | + public Integer getUpdateBy() { | |
| 249 | + return updateBy; | |
| 250 | + } | |
| 251 | + | |
| 252 | + public void setUpdateBy(Integer updateBy) { | |
| 253 | + this.updateBy = updateBy; | |
| 254 | + } | |
| 255 | + | |
| 256 | + public Date getCreateDate() { | |
| 257 | + return createDate; | |
| 258 | + } | |
| 259 | + | |
| 260 | + public void setCreateDate(Date createDate) { | |
| 261 | + this.createDate = createDate; | |
| 262 | + } | |
| 263 | + | |
| 264 | + public Date getUpdateDate() { | |
| 265 | + return updateDate; | |
| 266 | + } | |
| 267 | + | |
| 268 | + public void setUpdateDate(Date updateDate) { | |
| 269 | + this.updateDate = updateDate; | |
| 270 | + } | |
| 271 | + | |
| 272 | + public Station getStation() { | |
| 273 | + return station; | |
| 274 | + } | |
| 275 | + | |
| 276 | + public void setStation(Station station) { | |
| 277 | + this.station = station; | |
| 278 | + } | |
| 279 | + | |
| 280 | + public Line getLine() { | |
| 281 | + return line; | |
| 282 | + } | |
| 283 | + | |
| 284 | + public void setLine(Line line) { | |
| 285 | + this.line = line; | |
| 286 | + } | |
| 287 | + | |
| 288 | + public String getStationNameEn() { | |
| 289 | + return stationNameEn; | |
| 290 | + } | |
| 291 | + | |
| 292 | + public void setStationNameEn(String stationNameEn) { | |
| 293 | + this.stationNameEn = stationNameEn; | |
| 294 | + } | |
| 295 | + | |
| 285 | 296 | } |
| 286 | 297 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/entity/StationRoute.java
| 1 | -package com.bsth.entity; | |
| 2 | - | |
| 3 | -import javax.persistence.*; | |
| 4 | -import java.util.Date; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * | |
| 8 | - * @ClassName : StationRoute(站点路由实体类) | |
| 9 | - * | |
| 10 | - * @Author : bsth@lq | |
| 11 | - * | |
| 12 | - * @Description : TODO(站点路由) | |
| 13 | - * | |
| 14 | - * @Data :2016-04-19 | |
| 15 | - * | |
| 16 | - * @Version 公交调度系统BS版 0.1 | |
| 17 | - * | |
| 18 | - */ | |
| 19 | - | |
| 20 | -@Entity | |
| 21 | -@Table(name = "bsth_c_stationroute") | |
| 22 | -@NamedEntityGraphs({ | |
| 23 | - @NamedEntityGraph(name = "stationRoute_station", attributeNodes = { | |
| 24 | - @NamedAttributeNode("station"), | |
| 25 | - @NamedAttributeNode("line") | |
| 26 | - }) | |
| 27 | -}) | |
| 28 | -public class StationRoute { | |
| 29 | - | |
| 30 | - //站点路由ID | |
| 31 | - @Id | |
| 32 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | - private Integer id; | |
| 34 | - | |
| 35 | - // 站点路由序号 | |
| 36 | - private Integer stationRouteCode; | |
| 37 | - | |
| 38 | - // 站点编码 | |
| 39 | - private String stationCode; | |
| 40 | - | |
| 41 | - // 站点名称 | |
| 42 | - private String stationName; | |
| 43 | - | |
| 44 | - // 线路编码 | |
| 45 | - private String lineCode; | |
| 46 | - | |
| 47 | - // 行业编码 | |
| 48 | - private String industryCode; | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * 站点类型 | |
| 52 | - * | |
| 53 | - * ------ B:起点站 | |
| 54 | - * | |
| 55 | - * ------ Z:中途站 | |
| 56 | - * | |
| 57 | - * ------ E:终点站 | |
| 58 | - * | |
| 59 | - * ------ T:停车场 | |
| 60 | - * | |
| 61 | - */ | |
| 62 | - private String stationMark; | |
| 63 | - | |
| 64 | - // 站点路由出站序号 | |
| 65 | - private Integer outStationNmber; | |
| 66 | - | |
| 67 | - // 站点路由到站距离 | |
| 68 | - private Double distances; | |
| 69 | - | |
| 70 | - // 站点路由到站时间 | |
| 71 | - private Double toTime; | |
| 72 | - | |
| 73 | - // 首班时间 | |
| 74 | - private String firstTime; | |
| 75 | - | |
| 76 | - // 末班时间 | |
| 77 | - private String endTime; | |
| 78 | - | |
| 79 | - // 站点路由方向 | |
| 80 | - private Integer directions; | |
| 81 | - | |
| 82 | - // 版本号 | |
| 83 | - private Integer versions; | |
| 84 | - | |
| 85 | - // 是否撤销 | |
| 86 | - private Integer destroy; | |
| 87 | - | |
| 88 | - // 描述 | |
| 89 | - private String descriptions; | |
| 90 | - | |
| 91 | - // 创建人 | |
| 92 | - private Integer createBy; | |
| 93 | - | |
| 94 | - // 修改人 | |
| 95 | - private Integer updateBy; | |
| 96 | - | |
| 97 | - // 创建日期 | |
| 98 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 99 | - private Date createDate; | |
| 100 | - | |
| 101 | - // 修改日期 | |
| 102 | - @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 103 | - private Date updateDate; | |
| 104 | - | |
| 105 | - // 站点信息 | |
| 106 | - @ManyToOne(fetch = FetchType.LAZY) | |
| 107 | - private Station station; | |
| 108 | - | |
| 109 | - // 线路信息 | |
| 110 | - @ManyToOne | |
| 111 | - private Line line; | |
| 112 | - | |
| 113 | - public Integer getId() { | |
| 114 | - return id; | |
| 115 | - } | |
| 116 | - | |
| 117 | - public void setId(Integer id) { | |
| 118 | - this.id = id; | |
| 119 | - } | |
| 120 | - | |
| 121 | - public Integer getStationRouteCode() { | |
| 122 | - return stationRouteCode; | |
| 123 | - } | |
| 124 | - | |
| 125 | - public void setStationRouteCode(Integer stationRouteCode) { | |
| 126 | - this.stationRouteCode = stationRouteCode; | |
| 127 | - } | |
| 128 | - | |
| 129 | - public String getStationCode() { | |
| 130 | - return stationCode; | |
| 131 | - } | |
| 132 | - | |
| 133 | - public void setStationCode(String stationCode) { | |
| 134 | - this.stationCode = stationCode; | |
| 135 | - } | |
| 136 | - | |
| 137 | - public String getStationName() { | |
| 138 | - return stationName; | |
| 139 | - } | |
| 140 | - | |
| 141 | - public void setStationName(String stationName) { | |
| 142 | - this.stationName = stationName; | |
| 143 | - } | |
| 144 | - | |
| 145 | - public String getLineCode() { | |
| 146 | - return lineCode; | |
| 147 | - } | |
| 148 | - | |
| 149 | - public void setLineCode(String lineCode) { | |
| 150 | - this.lineCode = lineCode; | |
| 151 | - } | |
| 152 | - | |
| 153 | - public String getIndustryCode() { | |
| 154 | - return industryCode; | |
| 155 | - } | |
| 156 | - | |
| 157 | - public void setIndustryCode(String industryCode) { | |
| 158 | - this.industryCode = industryCode; | |
| 159 | - } | |
| 160 | - | |
| 161 | - public String getStationMark() { | |
| 162 | - return stationMark; | |
| 163 | - } | |
| 164 | - | |
| 165 | - public void setStationMark(String stationMark) { | |
| 166 | - this.stationMark = stationMark; | |
| 167 | - } | |
| 168 | - | |
| 169 | - public Integer getOutStationNmber() { | |
| 170 | - return outStationNmber; | |
| 171 | - } | |
| 172 | - | |
| 173 | - public void setOutStationNmber(Integer outStationNmber) { | |
| 174 | - this.outStationNmber = outStationNmber; | |
| 175 | - } | |
| 176 | - | |
| 177 | - public Double getDistances() { | |
| 178 | - return distances; | |
| 179 | - } | |
| 180 | - | |
| 181 | - public void setDistances(Double distances) { | |
| 182 | - this.distances = distances; | |
| 183 | - } | |
| 184 | - | |
| 185 | - public Double getToTime() { | |
| 186 | - return toTime; | |
| 187 | - } | |
| 188 | - | |
| 189 | - public void setToTime(Double toTime) { | |
| 190 | - this.toTime = toTime; | |
| 191 | - } | |
| 192 | - | |
| 193 | - public String getFirstTime() { | |
| 194 | - return firstTime; | |
| 195 | - } | |
| 196 | - | |
| 197 | - public void setFirstTime(String firstTime) { | |
| 198 | - this.firstTime = firstTime; | |
| 199 | - } | |
| 200 | - | |
| 201 | - public String getEndTime() { | |
| 202 | - return endTime; | |
| 203 | - } | |
| 204 | - | |
| 205 | - public void setEndTime(String endTime) { | |
| 206 | - this.endTime = endTime; | |
| 207 | - } | |
| 208 | - | |
| 209 | - public Integer getDirections() { | |
| 210 | - return directions; | |
| 211 | - } | |
| 212 | - | |
| 213 | - public void setDirections(Integer directions) { | |
| 214 | - this.directions = directions; | |
| 215 | - } | |
| 216 | - | |
| 217 | - public Integer getVersions() { | |
| 218 | - return versions; | |
| 219 | - } | |
| 220 | - | |
| 221 | - public void setVersions(Integer versions) { | |
| 222 | - this.versions = versions; | |
| 223 | - } | |
| 224 | - | |
| 225 | - public Integer getDestroy() { | |
| 226 | - return destroy; | |
| 227 | - } | |
| 228 | - | |
| 229 | - public void setDestroy(Integer destroy) { | |
| 230 | - this.destroy = destroy; | |
| 231 | - } | |
| 232 | - | |
| 233 | - public String getDescriptions() { | |
| 234 | - return descriptions; | |
| 235 | - } | |
| 236 | - | |
| 237 | - public void setDescriptions(String descriptions) { | |
| 238 | - this.descriptions = descriptions; | |
| 239 | - } | |
| 240 | - | |
| 241 | - public Integer getCreateBy() { | |
| 242 | - return createBy; | |
| 243 | - } | |
| 244 | - | |
| 245 | - public void setCreateBy(Integer createBy) { | |
| 246 | - this.createBy = createBy; | |
| 247 | - } | |
| 248 | - | |
| 249 | - public Integer getUpdateBy() { | |
| 250 | - return updateBy; | |
| 251 | - } | |
| 252 | - | |
| 253 | - public void setUpdateBy(Integer updateBy) { | |
| 254 | - this.updateBy = updateBy; | |
| 255 | - } | |
| 256 | - | |
| 257 | - public Date getCreateDate() { | |
| 258 | - return createDate; | |
| 259 | - } | |
| 260 | - | |
| 261 | - public void setCreateDate(Date createDate) { | |
| 262 | - this.createDate = createDate; | |
| 263 | - } | |
| 264 | - | |
| 265 | - public Date getUpdateDate() { | |
| 266 | - return updateDate; | |
| 267 | - } | |
| 268 | - | |
| 269 | - public void setUpdateDate(Date updateDate) { | |
| 270 | - this.updateDate = updateDate; | |
| 271 | - } | |
| 272 | - | |
| 273 | - public Station getStation() { | |
| 274 | - return station; | |
| 275 | - } | |
| 276 | - | |
| 277 | - public void setStation(Station station) { | |
| 278 | - this.station = station; | |
| 279 | - } | |
| 280 | - | |
| 281 | - public Line getLine() { | |
| 282 | - return line; | |
| 283 | - } | |
| 284 | - | |
| 285 | - public void setLine(Line line) { | |
| 286 | - this.line = line; | |
| 287 | - } | |
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import javax.persistence.*; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * | |
| 8 | + * @ClassName : StationRoute(站点路由实体类) | |
| 9 | + * | |
| 10 | + * @Author : bsth@lq | |
| 11 | + * | |
| 12 | + * @Description : TODO(站点路由) | |
| 13 | + * | |
| 14 | + * @Data :2016-04-19 | |
| 15 | + * | |
| 16 | + * @Version 公交调度系统BS版 0.1 | |
| 17 | + * | |
| 18 | + */ | |
| 19 | + | |
| 20 | +@Entity | |
| 21 | +@Table(name = "bsth_c_stationroute") | |
| 22 | +@NamedEntityGraphs({ | |
| 23 | + @NamedEntityGraph(name = "stationRoute_station", attributeNodes = { | |
| 24 | + @NamedAttributeNode("station"), | |
| 25 | + @NamedAttributeNode("line") | |
| 26 | + }) | |
| 27 | +}) | |
| 28 | +public class StationRoute { | |
| 29 | + | |
| 30 | + //站点路由ID | |
| 31 | + @Id | |
| 32 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | + private Integer id; | |
| 34 | + | |
| 35 | + // 站点路由序号 | |
| 36 | + private Integer stationRouteCode; | |
| 37 | + | |
| 38 | + // 站点编码 | |
| 39 | + private String stationCode; | |
| 40 | + | |
| 41 | + // 站点名称 | |
| 42 | + private String stationName; | |
| 43 | + | |
| 44 | + // 站点名称 | |
| 45 | + private String stationNameEn; | |
| 46 | + // 线路编码 | |
| 47 | + private String lineCode; | |
| 48 | + | |
| 49 | + // 行业编码 | |
| 50 | + private String industryCode; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 站点类型 | |
| 54 | + * | |
| 55 | + * ------ B:起点站 | |
| 56 | + * | |
| 57 | + * ------ Z:中途站 | |
| 58 | + * | |
| 59 | + * ------ E:终点站 | |
| 60 | + * | |
| 61 | + * ------ T:停车场 | |
| 62 | + * | |
| 63 | + */ | |
| 64 | + private String stationMark; | |
| 65 | + | |
| 66 | + // 站点路由出站序号 | |
| 67 | + private Integer outStationNmber; | |
| 68 | + | |
| 69 | + // 站点路由到站距离 | |
| 70 | + private Double distances; | |
| 71 | + | |
| 72 | + // 站点路由到站时间 | |
| 73 | + private Double toTime; | |
| 74 | + | |
| 75 | + // 首班时间 | |
| 76 | + private String firstTime; | |
| 77 | + | |
| 78 | + // 末班时间 | |
| 79 | + private String endTime; | |
| 80 | + | |
| 81 | + // 站点路由方向 | |
| 82 | + private Integer directions; | |
| 83 | + | |
| 84 | + // 版本号 | |
| 85 | + private Integer versions; | |
| 86 | + | |
| 87 | + // 是否撤销 | |
| 88 | + private Integer destroy; | |
| 89 | + | |
| 90 | + // 描述 | |
| 91 | + private String descriptions; | |
| 92 | + | |
| 93 | + // 创建人 | |
| 94 | + private Integer createBy; | |
| 95 | + | |
| 96 | + // 修改人 | |
| 97 | + private Integer updateBy; | |
| 98 | + | |
| 99 | + // 创建日期 | |
| 100 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 101 | + private Date createDate; | |
| 102 | + | |
| 103 | + // 修改日期 | |
| 104 | + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 105 | + private Date updateDate; | |
| 106 | + | |
| 107 | + // 站点信息 | |
| 108 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 109 | + private Station station; | |
| 110 | + | |
| 111 | + // 线路信息 | |
| 112 | + @ManyToOne | |
| 113 | + private Line line; | |
| 114 | + | |
| 115 | + public Integer getId() { | |
| 116 | + return id; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setId(Integer id) { | |
| 120 | + this.id = id; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public Integer getStationRouteCode() { | |
| 124 | + return stationRouteCode; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public void setStationRouteCode(Integer stationRouteCode) { | |
| 128 | + this.stationRouteCode = stationRouteCode; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public String getStationCode() { | |
| 132 | + return stationCode; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public void setStationCode(String stationCode) { | |
| 136 | + this.stationCode = stationCode; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public String getStationName() { | |
| 140 | + return stationName; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public void setStationName(String stationName) { | |
| 144 | + this.stationName = stationName; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public String getLineCode() { | |
| 148 | + return lineCode; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setLineCode(String lineCode) { | |
| 152 | + this.lineCode = lineCode; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public String getIndustryCode() { | |
| 156 | + return industryCode; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public void setIndustryCode(String industryCode) { | |
| 160 | + this.industryCode = industryCode; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public String getStationMark() { | |
| 164 | + return stationMark; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public void setStationMark(String stationMark) { | |
| 168 | + this.stationMark = stationMark; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public Integer getOutStationNmber() { | |
| 172 | + return outStationNmber; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void setOutStationNmber(Integer outStationNmber) { | |
| 176 | + this.outStationNmber = outStationNmber; | |
| 177 | + } | |
| 178 | + | |
| 179 | + public Double getDistances() { | |
| 180 | + return distances; | |
| 181 | + } | |
| 182 | + | |
| 183 | + public void setDistances(Double distances) { | |
| 184 | + this.distances = distances; | |
| 185 | + } | |
| 186 | + | |
| 187 | + public Double getToTime() { | |
| 188 | + return toTime; | |
| 189 | + } | |
| 190 | + | |
| 191 | + public void setToTime(Double toTime) { | |
| 192 | + this.toTime = toTime; | |
| 193 | + } | |
| 194 | + | |
| 195 | + public String getFirstTime() { | |
| 196 | + return firstTime; | |
| 197 | + } | |
| 198 | + | |
| 199 | + public void setFirstTime(String firstTime) { | |
| 200 | + this.firstTime = firstTime; | |
| 201 | + } | |
| 202 | + | |
| 203 | + public String getEndTime() { | |
| 204 | + return endTime; | |
| 205 | + } | |
| 206 | + | |
| 207 | + public void setEndTime(String endTime) { | |
| 208 | + this.endTime = endTime; | |
| 209 | + } | |
| 210 | + | |
| 211 | + public Integer getDirections() { | |
| 212 | + return directions; | |
| 213 | + } | |
| 214 | + | |
| 215 | + public void setDirections(Integer directions) { | |
| 216 | + this.directions = directions; | |
| 217 | + } | |
| 218 | + | |
| 219 | + public Integer getVersions() { | |
| 220 | + return versions; | |
| 221 | + } | |
| 222 | + | |
| 223 | + public void setVersions(Integer versions) { | |
| 224 | + this.versions = versions; | |
| 225 | + } | |
| 226 | + | |
| 227 | + public Integer getDestroy() { | |
| 228 | + return destroy; | |
| 229 | + } | |
| 230 | + | |
| 231 | + public void setDestroy(Integer destroy) { | |
| 232 | + this.destroy = destroy; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public String getDescriptions() { | |
| 236 | + return descriptions; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public void setDescriptions(String descriptions) { | |
| 240 | + this.descriptions = descriptions; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public Integer getCreateBy() { | |
| 244 | + return createBy; | |
| 245 | + } | |
| 246 | + | |
| 247 | + public void setCreateBy(Integer createBy) { | |
| 248 | + this.createBy = createBy; | |
| 249 | + } | |
| 250 | + | |
| 251 | + public Integer getUpdateBy() { | |
| 252 | + return updateBy; | |
| 253 | + } | |
| 254 | + | |
| 255 | + public void setUpdateBy(Integer updateBy) { | |
| 256 | + this.updateBy = updateBy; | |
| 257 | + } | |
| 258 | + | |
| 259 | + public Date getCreateDate() { | |
| 260 | + return createDate; | |
| 261 | + } | |
| 262 | + | |
| 263 | + public void setCreateDate(Date createDate) { | |
| 264 | + this.createDate = createDate; | |
| 265 | + } | |
| 266 | + | |
| 267 | + public Date getUpdateDate() { | |
| 268 | + return updateDate; | |
| 269 | + } | |
| 270 | + | |
| 271 | + public void setUpdateDate(Date updateDate) { | |
| 272 | + this.updateDate = updateDate; | |
| 273 | + } | |
| 274 | + | |
| 275 | + public Station getStation() { | |
| 276 | + return station; | |
| 277 | + } | |
| 278 | + | |
| 279 | + public void setStation(Station station) { | |
| 280 | + this.station = station; | |
| 281 | + } | |
| 282 | + | |
| 283 | + public Line getLine() { | |
| 284 | + return line; | |
| 285 | + } | |
| 286 | + | |
| 287 | + public void setLine(Line line) { | |
| 288 | + this.line = line; | |
| 289 | + } | |
| 290 | + | |
| 291 | + public String getStationNameEn() { | |
| 292 | + return stationNameEn; | |
| 293 | + } | |
| 294 | + | |
| 295 | + public void setStationNameEn(String stationNameEn) { | |
| 296 | + this.stationNameEn = stationNameEn; | |
| 297 | + } | |
| 298 | + | |
| 288 | 299 | } |
| 289 | 300 | \ No newline at end of file | ... | ... |
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 | - @Query("SELECT L FROM Line L") | |
| 55 | - List<Line> findAll(); | |
| 56 | - | |
| 57 | - @Modifying | |
| 58 | - @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " | |
| 59 | - + "l.level=?4, l.nature=?5, l.startStationName=?6, l.endStationName=?7, l.startStationFirstTime=?8, " | |
| 60 | - + "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, " | |
| 61 | - + "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, " | |
| 62 | - + "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, " | |
| 63 | - + "l.descriptions=?24, l.destroy=?25, l.supperLine=?26, l.spacGrade=?27, l.warrantCar=?28, l.region=?30 where " | |
| 64 | - + "l.lineCode=?29") | |
| 65 | - public int update(String name, String company, String brancheCompany, String level, String nature, | |
| 66 | - String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime, | |
| 67 | - String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es, | |
| 68 | - String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone, | |
| 69 | - Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions, | |
| 70 | - Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region); | |
| 71 | -} | |
| 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 | + @Query("SELECT L FROM Line L") | |
| 55 | + List<Line> findAll(); | |
| 56 | + | |
| 57 | + @Modifying | |
| 58 | + @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " | |
| 59 | + + "l.level=?4, l.nature=?5, l.startStationName=?6, l.endStationName=?7, l.startStationFirstTime=?8, " | |
| 60 | + + "l.startStationEndTime=?9, l.endStationFirstTime=?10, l.endStationEndTime=?11, l.linePlayType=?12, " | |
| 61 | + + "l.openDate=?13, l.es=?14, l.shortName=?15, l.shanghaiLinecode=?16, l.eqLinecode=?17, l.startPhone=?18, " | |
| 62 | + + "l.endPhone=?19, l.carSumNumber=?20, l.hvacCarNumber=?21, l.ordCarNumber=?22, l.history=?23, " | |
| 63 | + + "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 " | |
| 64 | + + "l.lineCode=?29") | |
| 65 | + int update(String name, String company, String brancheCompany, String level, String nature, | |
| 66 | + String startStationName, String endStationName, String startStationFirstTime, String startStationEndTime, | |
| 67 | + String endStationFirstTime, String endStationEndTime, Integer linePlayType, Date openDate, String es, | |
| 68 | + String shortName, String shanghaiLinecode, String eqLinecode, String startPhone, String endPhone, | |
| 69 | + Integer carSumNumber, Integer hvacCarNumber, Integer ordCarNumber, String history, String descriptions, | |
| 70 | + Integer destroy, Integer supperLine, Integer spacGrade, Integer warrantCar, String lineCode, Integer region, Integer inUser, Double ticketPrice); | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 查询线路版本文件 | |
| 74 | + * @param lineId | |
| 75 | + * @return | |
| 76 | + */ | |
| 77 | + @Query(value = "SELECT version_count FROM bsth_c_line_file_version where line = ?1", nativeQuery = true) | |
| 78 | + Integer findfileVersions(Integer lineId); | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 添加线路文件版本 | |
| 82 | + * @param lineId | |
| 83 | + * @param line_code | |
| 84 | + */ | |
| 85 | + @Transactional | |
| 86 | + @Modifying | |
| 87 | + @Query(value = "INSERT INTO bsth_c_line_file_version (line,line_code,version_count) VALUES (?1,?2,1)", nativeQuery = true) | |
| 88 | + public void addFileVersions(Integer lineId, String line_code); | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 线路文件版本修改 | |
| 92 | + * @param lineId | |
| 93 | + * @param version_count | |
| 94 | + */ | |
| 95 | + @Transactional | |
| 96 | + @Modifying | |
| 97 | + @Query(value = "UPDATE bsth_c_line_file_version set version_count=?2 WHERE line = ?1", nativeQuery = true) | |
| 98 | + public void editFileVersions(Integer lineId, Integer version_count); | |
| 99 | + | |
| 100 | +} | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| 1 | -package com.bsth.repository; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | -import java.util.Map; | |
| 5 | - | |
| 6 | -import org.springframework.data.domain.Page; | |
| 7 | -import org.springframework.data.domain.Pageable; | |
| 8 | -import org.springframework.data.domain.Sort; | |
| 9 | -import org.springframework.data.jpa.domain.Specification; | |
| 10 | -import org.springframework.data.jpa.repository.EntityGraph; | |
| 11 | -import org.springframework.data.jpa.repository.Modifying; | |
| 12 | -import org.springframework.data.jpa.repository.Query; | |
| 13 | -import org.springframework.stereotype.Repository; | |
| 14 | -import org.springframework.transaction.annotation.Transactional; | |
| 15 | - | |
| 16 | -import com.bsth.entity.Line; | |
| 17 | -import com.bsth.entity.StationRoute; | |
| 18 | - | |
| 19 | -/** | |
| 20 | - * | |
| 21 | - * @Interface: StationRouteRepository(站点路由Repository数据持久层接口) | |
| 22 | - * | |
| 23 | - * @Extends : BaseRepository | |
| 24 | - * | |
| 25 | - * @Description: TODO(站点路由Repository数据持久层接口) | |
| 26 | - * | |
| 27 | - * @Author bsth@lq | |
| 28 | - * | |
| 29 | - * @Date 2016年5月03日 上午9:21:17 | |
| 30 | - * | |
| 31 | - * @Version 公交调度系统BS版 0.1 | |
| 32 | - * | |
| 33 | - */ | |
| 34 | - | |
| 35 | -@Repository | |
| 36 | -public interface StationRouteRepository extends BaseRepository<StationRoute, Integer> { | |
| 37 | - | |
| 38 | - @Query(value = "SELECT a.`stationRoute.id`," + | |
| 39 | - "a.`stationRoute.line`," + | |
| 40 | - "a.`stationRoute.station`," + | |
| 41 | - "a.`stationRoute.stationName`," + | |
| 42 | - "a.`stationRoute.stationRouteCode`," + | |
| 43 | - "a.`stationRoute.lineCode`," + | |
| 44 | - "a.`stationRoute.stationMark`," + | |
| 45 | - "a.`stationRoute.outStationNmber`," + | |
| 46 | - "a.`stationRoute.directions`," + | |
| 47 | - "a.`stationRoute.distances`," + | |
| 48 | - "a.`stationRoute.toTime`," + | |
| 49 | - "a.`stationRoute.firstTime`," + | |
| 50 | - "a.`stationRoute.endTime`," + | |
| 51 | - "a.`stationRoute.descriptions`," + | |
| 52 | - "a.`stationRoute.versions`," + | |
| 53 | - "b.id AS 'station.id'," + | |
| 54 | - "b.station_cod AS 'station.stationCod'," + | |
| 55 | - "b.station_name AS 'station.stationName'," + | |
| 56 | - "b.road_coding AS 'station.roadCoding'," + | |
| 57 | - "b.db_type AS 'station.dbType'," + | |
| 58 | - "b.b_jwpoints AS 'station.bJwpoints'," + | |
| 59 | - "b.g_lonx AS 'station.gLonx'," + | |
| 60 | - "b.g_lonx AS 'station.gLaty'," + | |
| 61 | - "b.x AS 'station.x'," + | |
| 62 | - "b.y AS 'station.y'," + | |
| 63 | - "b.shapes_type AS 'station.shapesType'," + | |
| 64 | - "b.radius AS 'station.radius'," + | |
| 65 | - "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," + | |
| 66 | - "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," + | |
| 67 | - "b.destroy AS 'station.destroy'," + | |
| 68 | - "b.versions AS 'station.versions'," + | |
| 69 | - "b.descriptions AS 'station.descriptions', " + | |
| 70 | - "a.`stationRoute.industryCode` " + | |
| 71 | - " FROM (" + | |
| 72 | - "SELECT r.id AS 'stationRoute.id'," + | |
| 73 | - " r.line AS 'stationRoute.line'," + | |
| 74 | - "r.station AS 'stationRoute.station'," + | |
| 75 | - "r.station_name AS 'stationRoute.stationName'," + | |
| 76 | - "r.station_route_code as 'stationRoute.stationRouteCode'," + | |
| 77 | - "r.line_code AS 'stationRoute.lineCode'," + | |
| 78 | - "r.station_mark AS 'stationRoute.stationMark'," + | |
| 79 | - "r.out_station_nmber AS 'stationRoute.outStationNmber'," + | |
| 80 | - "r.directions AS 'stationRoute.directions'," + | |
| 81 | - "r.distances AS 'stationRoute.distances'," + | |
| 82 | - "r.to_time AS 'stationRoute.toTime'," + | |
| 83 | - "r.first_time AS 'stationRoute.firstTime'," + | |
| 84 | - "r.end_time AS 'stationRoute.endTime'," + | |
| 85 | - "r.descriptions AS 'stationRoute.descriptions'," + | |
| 86 | - "r.versions AS 'stationRoute.versions', " + | |
| 87 | - "r.industry_code AS 'stationRoute.industryCode' " + | |
| 88 | - " FROM bsth_c_stationroute r WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0) a " + | |
| 89 | - "LEFT JOIN bsth_c_station b " + | |
| 90 | - "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true) | |
| 91 | - List<Object[]> findPoints(int line, int directions); | |
| 92 | - | |
| 93 | - @Query("select r from StationRoute r where r.line.id=?1 and r.destroy=0 order by r.directions ASC ,r.stationRouteCode ASC") | |
| 94 | - // @Query(value = "SELECT * from bsth_c_stationroute line = ?1 and destroy=0 bsth_c_station ORDER BY directions ASC, stationRouteCode ASC", nativeQuery=true) | |
| 95 | - List<StationRoute> findStationExport(int line); | |
| 96 | - | |
| 97 | - /** | |
| 98 | - * @Description :TODO(查询线路某方向下的站点序号与类型) | |
| 99 | - * | |
| 100 | - * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | |
| 101 | - * | |
| 102 | - * @return List<Map<String, Object>> | |
| 103 | - */ | |
| 104 | - @Query(value = "select t.station_route_code,t.station_mark from bsth_c_stationroute t where " + | |
| 105 | - " t.station_route_code =(" + | |
| 106 | - "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " + | |
| 107 | - "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true) | |
| 108 | - List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); | |
| 109 | - | |
| 110 | - /** | |
| 111 | - * @Description :TODO(查询下个站点) | |
| 112 | - * | |
| 113 | - * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | |
| 114 | - * | |
| 115 | - * @return List<Map<String, Object>> | |
| 116 | - */ | |
| 117 | - @Query(value = "SELECT a.stationRouteLine," + | |
| 118 | - " a.stationRouteStation," + | |
| 119 | - " a.stationRouteCode," + | |
| 120 | - " a.stationRouteLIneCode," + | |
| 121 | - " a.stationRouteStationMark," + | |
| 122 | - " a.stationOutStationNmber," + | |
| 123 | - " a.stationRoutedirections," + | |
| 124 | - " a.stationRouteDistances," + | |
| 125 | - " a.stationRouteToTime," + | |
| 126 | - " a.staitonRouteFirstTime," + | |
| 127 | - " a.stationRouteEndTime," + | |
| 128 | - " a.stationRouteDescriptions," + | |
| 129 | - " a.stationRouteDestroy," + | |
| 130 | - " a.stationRouteVersions," + | |
| 131 | - " a.stationRouteCreateBy," + | |
| 132 | - " a.stationRouteCreateDate," + | |
| 133 | - " a.stationRouteUpdateBy," + | |
| 134 | - " a.stationRouteUpdateDate," + | |
| 135 | - " b.id AS stationId," + | |
| 136 | - " b.station_cod AS stationCode," + | |
| 137 | - " a.stationRouteName," + | |
| 138 | - " b.road_coding AS stationRoadCoding," + | |
| 139 | - " b.db_type AS stationDbType," + | |
| 140 | - " b.b_jwpoints AS stationJwpoints," + | |
| 141 | - " b.g_lonx AS stationGlonx," + | |
| 142 | - " b.g_laty AS stationGlaty," + | |
| 143 | - " b.x AS stationX," + | |
| 144 | - " b.y AS stationY," + | |
| 145 | - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 146 | - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 147 | - " b.destroy AS stationDestroy," + | |
| 148 | - " b.radius AS stationRadius," + | |
| 149 | - " b.shapes_type AS stationShapesType," + | |
| 150 | - " b.versions AS stationVersions," + | |
| 151 | - " b.descriptions AS sttationDescriptions," + | |
| 152 | - " b.create_by AS stationCreateBy," + | |
| 153 | - " b.create_date AS stationCreateDate," + | |
| 154 | - " b.update_by AS stationUpdateBy," + | |
| 155 | - " b.update_date AS stationUpdateDate," + | |
| 156 | - " a.stationRouteId, " + | |
| 157 | - " b.station_name as zdmc, " + | |
| 158 | - " a.industryCode"+ | |
| 159 | - " FROM " + | |
| 160 | - "( SELECT s.id AS stationRouteId," + | |
| 161 | - " s.line AS stationRouteLine," + | |
| 162 | - " s.station as stationRouteStation," + | |
| 163 | - " s.station_name AS stationRouteName," + | |
| 164 | - " s.station_route_code as stationRouteCode," + | |
| 165 | - " s.industry_code as industryCode," + | |
| 166 | - " s.line_code AS stationRouteLIneCode," + | |
| 167 | - " s.station_mark AS stationRouteStationMark," + | |
| 168 | - " s.out_station_nmber AS stationOutStationNmber," + | |
| 169 | - " s.directions AS stationRoutedirections," + | |
| 170 | - " s.distances AS stationRouteDistances," + | |
| 171 | - " s.to_time AS stationRouteToTime," + | |
| 172 | - " s.first_time AS staitonRouteFirstTime," + | |
| 173 | - " s.end_time AS stationRouteEndTime," + | |
| 174 | - " s.descriptions AS stationRouteDescriptions," + | |
| 175 | - " s.destroy AS stationRouteDestroy," + | |
| 176 | - " s.versions AS stationRouteVersions," + | |
| 177 | - " s.create_by AS stationRouteCreateBy," + | |
| 178 | - " s.create_date AS stationRouteCreateDate," + | |
| 179 | - " s.update_by AS stationRouteUpdateBy," + | |
| 180 | - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.station_route_code =(" + | |
| 181 | - "select MIN(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " + | |
| 182 | - "r.line=?1 and r.directions =?2 and station_route_code > ?3 and r.destroy = 0 ) and s.line=?1 and s.directions = ?2 AND s.destroy = 0) a " + | |
| 183 | - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | |
| 184 | - List<Object[]> findDownStationRoute(Integer id,Integer direction,Integer stationRouteCode); | |
| 185 | - | |
| 186 | - /** | |
| 187 | - * @Description :TODO(站点中心点坐标查询) | |
| 188 | - * | |
| 189 | - * @param map <lineId:线路ID; direction:方向> | |
| 190 | - * | |
| 191 | - * @return List<Object[]> | |
| 192 | - */ | |
| 193 | - /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" + | |
| 194 | - "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + | |
| 195 | - "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/ | |
| 196 | - @Query(value = "SELECT s.b_jwpoints,r.station_name,r.station_route_code FROM (" + | |
| 197 | - "SELECT b.station,b.station_route_code,b.station_name FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + | |
| 198 | - "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true) | |
| 199 | - List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction); | |
| 200 | - | |
| 201 | - /** | |
| 202 | - * @Description :TODO(撤销站点) | |
| 203 | - * | |
| 204 | - * @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)> | |
| 205 | - * | |
| 206 | - */ | |
| 207 | - @Transactional | |
| 208 | - @Modifying | |
| 209 | - @Query(value="UPDATE bsth_c_stationroute SET " + | |
| 210 | - "destroy = ?2 WHERE id = ?1", nativeQuery=true) | |
| 211 | - public void stationRouteIsDestroyUpd(Integer stationRouteId, Integer destroy); | |
| 212 | - | |
| 213 | - | |
| 214 | - /** | |
| 215 | - * @Description : TODO(根据线路ID生成行单) | |
| 216 | - * | |
| 217 | - * @param lineId:线路ID | |
| 218 | - * | |
| 219 | - * @return List<Object[]>:{[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标) | |
| 220 | - * | |
| 221 | - * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码); | |
| 222 | - * | |
| 223 | - * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)} | |
| 224 | - */ | |
| 225 | - @Query(value = "SELECT * FROM ("+ | |
| 226 | - "SELECT b.g_lonx," + | |
| 227 | - "b.g_laty,b.b_jwpoints," + | |
| 228 | - "a.station_mark," + | |
| 229 | - "a.station_route_code," + | |
| 230 | - "b.station_cod," + | |
| 231 | - "a.distances,"+ | |
| 232 | - "b.station_name," + | |
| 233 | - "a.directions FROM (SELECT " + | |
| 234 | - "s.station_mark," + | |
| 235 | - "s.station_route_code," + | |
| 236 | - "s.directions," + | |
| 237 | - "s.distances,"+ | |
| 238 | - "s.station FROM bsth_c_stationroute s where s.line = ?1 and s.destroy=0) a " + | |
| 239 | - "LEFT JOIN bsth_c_station b " + | |
| 240 | - " on a.station = b.id ORDER BY a.directions ASC ) k ORDER BY k.directions,k.station_route_code ASC", nativeQuery=true) | |
| 241 | - List<Object[]> usingSingle(Integer lineId); | |
| 242 | - | |
| 243 | - /** | |
| 244 | - * @Description : TODO(根据站点路由Id查询详情) | |
| 245 | - * | |
| 246 | - * @param id:站点路由ID | |
| 247 | - * | |
| 248 | - * @return List<Object[]> | |
| 249 | - */ | |
| 250 | - @Query(value = "SELECT a.stationRouteLine," + | |
| 251 | - " a.stationRouteStation," + | |
| 252 | - " a.stationRouteCode," + | |
| 253 | - " a.stationRouteLIneCode," + | |
| 254 | - " a.stationRouteStationMark," + | |
| 255 | - " a.stationOutStationNmber," + | |
| 256 | - " a.stationRoutedirections," + | |
| 257 | - " a.stationRouteDistances," + | |
| 258 | - " a.stationRouteToTime," + | |
| 259 | - " a.staitonRouteFirstTime," + | |
| 260 | - " a.stationRouteEndTime," + | |
| 261 | - " a.stationRouteDescriptions," + | |
| 262 | - " a.stationRouteDestroy," + | |
| 263 | - " a.stationRouteVersions," + | |
| 264 | - " a.stationRouteCreateBy," + | |
| 265 | - " a.stationRouteCreateDate," + | |
| 266 | - " a.stationRouteUpdateBy," + | |
| 267 | - " a.stationRouteUpdateDate," + | |
| 268 | - " b.id AS stationId," + | |
| 269 | - " b.station_cod AS stationCode," + | |
| 270 | - " a.stationRouteName," + | |
| 271 | - " b.road_coding AS stationRoadCoding," + | |
| 272 | - " b.db_type AS stationDbType," + | |
| 273 | - " b.b_jwpoints AS stationJwpoints," + | |
| 274 | - " b.g_lonx AS stationGlonx," + | |
| 275 | - " b.g_laty AS stationGlaty," + | |
| 276 | - " b.x AS stationX," + | |
| 277 | - " b.y AS stationY," + | |
| 278 | - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 279 | - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 280 | - " b.destroy AS stationDestroy," + | |
| 281 | - " b.radius AS stationRadius," + | |
| 282 | - " b.shapes_type AS stationShapesType," + | |
| 283 | - " b.versions AS stationVersions," + | |
| 284 | - " b.descriptions AS sttationDescriptions," + | |
| 285 | - " b.create_by AS stationCreateBy," + | |
| 286 | - " b.create_date AS stationCreateDate," + | |
| 287 | - " b.update_by AS stationUpdateBy," + | |
| 288 | - " b.update_date AS stationUpdateDate," + | |
| 289 | - " a.stationRouteId,b.station_name as zdmc, " + | |
| 290 | - " a.industryCode "+ | |
| 291 | - " FROM " + | |
| 292 | - "( SELECT s.id AS stationRouteId," + | |
| 293 | - " s.line AS stationRouteLine," + | |
| 294 | - " s.station as stationRouteStation," + | |
| 295 | - " s.station_name AS stationRouteName," + | |
| 296 | - " s.station_route_code as stationRouteCode," + | |
| 297 | - " s.industry_code as industryCode," + | |
| 298 | - " s.line_code AS stationRouteLIneCode," + | |
| 299 | - " s.station_mark AS stationRouteStationMark," + | |
| 300 | - " s.out_station_nmber AS stationOutStationNmber," + | |
| 301 | - " s.directions AS stationRoutedirections," + | |
| 302 | - " s.distances AS stationRouteDistances," + | |
| 303 | - " s.to_time AS stationRouteToTime," + | |
| 304 | - " s.first_time AS staitonRouteFirstTime," + | |
| 305 | - " s.end_time AS stationRouteEndTime," + | |
| 306 | - " s.descriptions AS stationRouteDescriptions," + | |
| 307 | - " s.destroy AS stationRouteDestroy," + | |
| 308 | - " s.versions AS stationRouteVersions," + | |
| 309 | - " s.create_by AS stationRouteCreateBy," + | |
| 310 | - " s.create_date AS stationRouteCreateDate," + | |
| 311 | - " s.update_by AS stationRouteUpdateBy," + | |
| 312 | - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " + | |
| 313 | - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | |
| 314 | - List<Object[]> findStationRouteInfo(Integer id); | |
| 315 | - | |
| 316 | - /** | |
| 317 | - * @Description : TODO(根据站点路由Id查询详情) | |
| 318 | - * | |
| 319 | - * @param id:站点路由ID | |
| 320 | - * | |
| 321 | - * @return List<Object[]> | |
| 322 | - */ | |
| 323 | - @Query(value = "SELECT a.stationRouteLine," + | |
| 324 | - " a.stationRouteStation," + | |
| 325 | - " a.stationRouteCode," + | |
| 326 | - " a.stationRouteLIneCode," + | |
| 327 | - " a.stationRouteStationMark," + | |
| 328 | - " a.stationOutStationNmber," + | |
| 329 | - " a.stationRoutedirections," + | |
| 330 | - " a.stationRouteDistances," + | |
| 331 | - " a.stationRouteToTime," + | |
| 332 | - " a.staitonRouteFirstTime," + | |
| 333 | - " a.stationRouteEndTime," + | |
| 334 | - " a.stationRouteDescriptions," + | |
| 335 | - " a.stationRouteDestroy," + | |
| 336 | - " a.stationRouteVersions," + | |
| 337 | - " a.stationRouteCreateBy," + | |
| 338 | - " a.stationRouteCreateDate," + | |
| 339 | - " a.stationRouteUpdateBy," + | |
| 340 | - " a.stationRouteUpdateDate," + | |
| 341 | - " b.id AS stationId," + | |
| 342 | - " b.station_cod AS stationCode," + | |
| 343 | - " a.stationRouteName," + | |
| 344 | - " b.road_coding AS stationRoadCoding," + | |
| 345 | - " b.db_type AS stationDbType," + | |
| 346 | - " b.b_jwpoints AS stationJwpoints," + | |
| 347 | - " b.g_lonx AS stationGlonx," + | |
| 348 | - " b.g_laty AS stationGlaty," + | |
| 349 | - " b.x AS stationX," + | |
| 350 | - " b.y AS stationY," + | |
| 351 | - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 352 | - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 353 | - " b.destroy AS stationDestroy," + | |
| 354 | - " b.radius AS stationRadius," + | |
| 355 | - " b.shapes_type AS stationShapesType," + | |
| 356 | - " b.versions AS stationVersions," + | |
| 357 | - " b.descriptions AS sttationDescriptions," + | |
| 358 | - " b.create_by AS stationCreateBy," + | |
| 359 | - " b.create_date AS stationCreateDate," + | |
| 360 | - " b.update_by AS stationUpdateBy," + | |
| 361 | - " b.update_date AS stationUpdateDate," + | |
| 362 | - " a.stationRouteId," + | |
| 363 | - "b.station_name as zdmc, "+ | |
| 364 | - "a.industryCode "+ | |
| 365 | - " FROM ( SELECT s.id AS stationRouteId," + | |
| 366 | - " s.line AS stationRouteLine," + | |
| 367 | - " s.station as stationRouteStation," + | |
| 368 | - " s.station_name AS stationRouteName," + | |
| 369 | - " s.station_route_code as stationRouteCode," + | |
| 370 | - " s.industry_code as industryCode," + | |
| 371 | - " s.line_code AS stationRouteLIneCode," + | |
| 372 | - " s.station_mark AS stationRouteStationMark," + | |
| 373 | - " s.out_station_nmber AS stationOutStationNmber," + | |
| 374 | - " s.directions AS stationRoutedirections," + | |
| 375 | - " s.distances AS stationRouteDistances," + | |
| 376 | - " s.to_time AS stationRouteToTime," + | |
| 377 | - " s.first_time AS staitonRouteFirstTime," + | |
| 378 | - " s.end_time AS stationRouteEndTime," + | |
| 379 | - " s.descriptions AS stationRouteDescriptions," + | |
| 380 | - " s.destroy AS stationRouteDestroy," + | |
| 381 | - " s.versions AS stationRouteVersions," + | |
| 382 | - " s.create_by AS stationRouteCreateBy," + | |
| 383 | - " s.create_date AS stationRouteCreateDate," + | |
| 384 | - " s.update_by AS stationRouteUpdateBy," + | |
| 385 | - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " + | |
| 386 | - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id order by a.stationRouteCode", nativeQuery=true) | |
| 387 | - List<Object[]> getStationRouteList(Integer lineId, Integer dir); | |
| 388 | - | |
| 389 | - List<StationRoute> findByLine(Line line); | |
| 390 | - | |
| 391 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 392 | - @Query("select s from StationRoute s where s.destroy=0") | |
| 393 | - List<StationRoute> findAllEffective(); | |
| 394 | - | |
| 395 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 396 | - @Override | |
| 397 | - Page<StationRoute> findAll(Specification<StationRoute> spec, Pageable pageable); | |
| 398 | - | |
| 399 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 400 | - @Override | |
| 401 | - List<StationRoute> findAll(Specification<StationRoute> spec); | |
| 402 | - | |
| 403 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 404 | - @Override | |
| 405 | - List<StationRoute> findAll(Specification<StationRoute> spec, Sort sort); | |
| 406 | - | |
| 407 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 408 | - @Override | |
| 409 | - @Query(value = "select r from StationRoute r where r.destroy=0") | |
| 410 | - List<StationRoute> findAll(); | |
| 411 | - | |
| 412 | - @Query("select new map(sr.station.id as stationid, sr.stationName as stationname) from StationRoute sr where sr.line.id=?1 and sr.directions=?2") | |
| 413 | - List<Map<String, Object>> findStations(Integer xlid, Integer xldir); | |
| 414 | - | |
| 415 | - @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 416 | - List<StationRoute> findByLine(String lineCode, int updown); | |
| 417 | - | |
| 418 | - @Query("select r from StationRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 419 | - List<StationRoute> findByLine(Integer lineId, Integer dir); | |
| 420 | - | |
| 421 | - @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 422 | - @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") | |
| 423 | - List<StationRoute> findByLineCode(String lineCode); | |
| 424 | - | |
| 425 | - @Query("SELECT new map(" + | |
| 426 | - "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 427 | - "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 428 | - "FROM " + | |
| 429 | - "StationRoute s " + | |
| 430 | - "WHERE " + | |
| 431 | - "s.destroy = 0 " + | |
| 432 | - "and s.lineCode in(select lineCode from Line where inUse = 1) " + | |
| 433 | - "ORDER BY " + | |
| 434 | - "lineCode,directions,stationRouteCode") | |
| 435 | - List<Map<String, String>> findLineWithYgcAndInuse(); | |
| 436 | - | |
| 437 | - @Query("SELECT new map(" + | |
| 438 | - "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 439 | - "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 440 | - "FROM " + | |
| 441 | - "StationRoute s " + | |
| 442 | - "WHERE " + | |
| 443 | - "s.destroy = 0 " + | |
| 444 | - "ORDER BY " + | |
| 445 | - "lineCode,directions,stationRouteCode") | |
| 446 | - List<Map<String, String>> findAllLineWithYgc(); | |
| 447 | - | |
| 448 | - @Query("SELECT new map(" + | |
| 449 | - "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 450 | - "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 451 | - "FROM " + | |
| 452 | - "StationRoute s " + | |
| 453 | - "WHERE " + | |
| 454 | - "s.destroy = 0 and s.lineCode = ?1 " + | |
| 455 | - "ORDER BY " + | |
| 456 | - "lineCode,directions,stationRouteCode") | |
| 457 | - List<Map<String, String>> findLineWithYgcByLine(String lineCode); | |
| 458 | - | |
| 459 | - @Modifying | |
| 460 | - @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line = ?1 ", nativeQuery=true) | |
| 461 | - public void stationRouteDir(Integer line); | |
| 462 | - | |
| 463 | - @Modifying | |
| 464 | - @Query(value="update bsth_c_stationroute set distances =?2 where id = ?1 ", nativeQuery=true) | |
| 465 | - public void upddis(Integer id, Double dis); | |
| 466 | - | |
| 467 | - @Modifying | |
| 468 | - @Query(value="UPDATE bsth_c_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true) | |
| 469 | - public void stationUpdStationRouteCode(Integer line, Integer dir, Integer routeCod); | |
| 470 | - | |
| 471 | - /** | |
| 472 | - * 更新路线前撤销线路原有站点 | |
| 473 | - * | |
| 474 | - * @param line | |
| 475 | - * @param dir | |
| 476 | - */ | |
| 477 | - @Modifying | |
| 478 | - @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where line = ?1 and directions = ?2", nativeQuery=true) | |
| 479 | - public void stationRouteUpdDestroy(Integer line, Integer dir); | |
| 480 | - | |
| 481 | - @Modifying | |
| 482 | - @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where id = ?1", nativeQuery=true) | |
| 483 | - public void stationRouteIsDestroyUpdBatch(Integer ids); | |
| 484 | - | |
| 485 | - /** | |
| 486 | - * | |
| 487 | - * | |
| 488 | - * @param line | |
| 489 | - * @param dir | |
| 490 | - */ | |
| 491 | - @Modifying | |
| 492 | - @Query(value="insert into (select * from bsth_c_stationroute_cache where line = ?1 and directions = ?2) bsth_c_stationroute", nativeQuery=true) | |
| 493 | - public void stationRouteUpdate(Integer line, Integer dir); | |
| 494 | - | |
| 495 | - // 更具线路批量撤销 | |
| 496 | - @Modifying | |
| 497 | - @Query(value="UPDATE StationRoute sr set sr.destroy = 1 where sr.line.id = ?1 and sr.lineCode = ?2") | |
| 498 | - void batchUpdate(Integer lineId, String lineCode); | |
| 499 | - | |
| 500 | - // 批量删除 | |
| 501 | - @Modifying | |
| 502 | - @Query(value="delete from StationRoute sr where sr.line.id = ?1 and sr.lineCode = ?2") | |
| 503 | - void batchDelete(Integer lineId, String lineCode); | |
| 504 | -} | |
| 1 | +package com.bsth.repository; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import org.springframework.data.domain.Page; | |
| 7 | +import org.springframework.data.domain.Pageable; | |
| 8 | +import org.springframework.data.domain.Sort; | |
| 9 | +import org.springframework.data.jpa.domain.Specification; | |
| 10 | +import org.springframework.data.jpa.repository.EntityGraph; | |
| 11 | +import org.springframework.data.jpa.repository.Modifying; | |
| 12 | +import org.springframework.data.jpa.repository.Query; | |
| 13 | +import org.springframework.stereotype.Repository; | |
| 14 | +import org.springframework.transaction.annotation.Transactional; | |
| 15 | + | |
| 16 | +import com.bsth.entity.Line; | |
| 17 | +import com.bsth.entity.StationRoute; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * | |
| 21 | + * @Interface: StationRouteRepository(站点路由Repository数据持久层接口) | |
| 22 | + * | |
| 23 | + * @Extends : BaseRepository | |
| 24 | + * | |
| 25 | + * @Description: TODO(站点路由Repository数据持久层接口) | |
| 26 | + * | |
| 27 | + * @Author bsth@lq | |
| 28 | + * | |
| 29 | + * @Date 2016年5月03日 上午9:21:17 | |
| 30 | + * | |
| 31 | + * @Version 公交调度系统BS版 0.1 | |
| 32 | + * | |
| 33 | + */ | |
| 34 | + | |
| 35 | +@Repository | |
| 36 | +public interface StationRouteRepository extends BaseRepository<StationRoute, Integer> { | |
| 37 | + | |
| 38 | + @Query(value = "SELECT a.`stationRoute.id`," + | |
| 39 | + "a.`stationRoute.line`," + | |
| 40 | + "a.`stationRoute.station`," + | |
| 41 | + "a.`stationRoute.stationName`," + | |
| 42 | + "a.`stationRoute.stationRouteCode`," + | |
| 43 | + "a.`stationRoute.lineCode`," + | |
| 44 | + "a.`stationRoute.stationMark`," + | |
| 45 | + "a.`stationRoute.outStationNmber`," + | |
| 46 | + "a.`stationRoute.directions`," + | |
| 47 | + "a.`stationRoute.distances`," + | |
| 48 | + "a.`stationRoute.toTime`," + | |
| 49 | + "a.`stationRoute.firstTime`," + | |
| 50 | + "a.`stationRoute.endTime`," + | |
| 51 | + "a.`stationRoute.descriptions`," + | |
| 52 | + "a.`stationRoute.versions`," + | |
| 53 | + "b.id AS 'station.id'," + | |
| 54 | + "b.station_cod AS 'station.stationCod'," + | |
| 55 | + "b.station_name AS 'station.stationName'," + | |
| 56 | + "b.road_coding AS 'station.roadCoding'," + | |
| 57 | + "b.db_type AS 'station.dbType'," + | |
| 58 | + "b.b_jwpoints AS 'station.bJwpoints'," + | |
| 59 | + "b.g_lonx AS 'station.gLonx'," + | |
| 60 | + "b.g_lonx AS 'station.gLaty'," + | |
| 61 | + "b.x AS 'station.x'," + | |
| 62 | + "b.y AS 'station.y'," + | |
| 63 | + "b.shapes_type AS 'station.shapesType'," + | |
| 64 | + "b.radius AS 'station.radius'," + | |
| 65 | + "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," + | |
| 66 | + "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," + | |
| 67 | + "b.destroy AS 'station.destroy'," + | |
| 68 | + "b.versions AS 'station.versions'," + | |
| 69 | + "b.descriptions AS 'station.descriptions', " + | |
| 70 | + "a.`stationRoute.industryCode` " + | |
| 71 | + " FROM (" + | |
| 72 | + "SELECT r.id AS 'stationRoute.id'," + | |
| 73 | + " r.line AS 'stationRoute.line'," + | |
| 74 | + "r.station AS 'stationRoute.station'," + | |
| 75 | + "r.station_name AS 'stationRoute.stationName'," + | |
| 76 | + "r.station_route_code as 'stationRoute.stationRouteCode'," + | |
| 77 | + "r.line_code AS 'stationRoute.lineCode'," + | |
| 78 | + "r.station_mark AS 'stationRoute.stationMark'," + | |
| 79 | + "r.out_station_nmber AS 'stationRoute.outStationNmber'," + | |
| 80 | + "r.directions AS 'stationRoute.directions'," + | |
| 81 | + "r.distances AS 'stationRoute.distances'," + | |
| 82 | + "r.to_time AS 'stationRoute.toTime'," + | |
| 83 | + "r.first_time AS 'stationRoute.firstTime'," + | |
| 84 | + "r.end_time AS 'stationRoute.endTime'," + | |
| 85 | + "r.descriptions AS 'stationRoute.descriptions'," + | |
| 86 | + "r.versions AS 'stationRoute.versions', " + | |
| 87 | + "r.industry_code AS 'stationRoute.industryCode' " + | |
| 88 | + " FROM bsth_c_stationroute r WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0) a " + | |
| 89 | + "LEFT JOIN bsth_c_station b " + | |
| 90 | + "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true) | |
| 91 | + List<Object[]> findPoints(int line,int directions); | |
| 92 | + | |
| 93 | + @Query("select r from StationRoute r where r.line.id=?1 and r.destroy=0 order by r.directions ASC ,r.stationRouteCode ASC") | |
| 94 | + // @Query(value = "SELECT * from bsth_c_stationroute line = ?1 and destroy=0 bsth_c_station ORDER BY directions ASC, stationRouteCode ASC", nativeQuery=true) | |
| 95 | + List<StationRoute> findStationExport(int line); | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * @Description :TODO(查询线路某方向下的站点序号与类型) | |
| 99 | + * | |
| 100 | + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | |
| 101 | + * | |
| 102 | + * @return List<Map<String, Object>> | |
| 103 | + */ | |
| 104 | + @Query(value = "select t.station_route_code,t.station_mark from bsth_c_stationroute t where " + | |
| 105 | + " t.station_route_code =(" + | |
| 106 | + "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " + | |
| 107 | + "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true) | |
| 108 | + List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * @param version | |
| 112 | + * @Description :TODO(查询下个站点) | |
| 113 | + * | |
| 114 | + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | |
| 115 | + * | |
| 116 | + * @return List<Map<String, Object>> | |
| 117 | + */ | |
| 118 | + @Query(value = "SELECT a.stationRouteLine," + | |
| 119 | + " a.stationRouteStation," + | |
| 120 | + " a.stationRouteCode," + | |
| 121 | + " a.stationRouteLIneCode," + | |
| 122 | + " a.stationRouteStationMark," + | |
| 123 | + " a.stationOutStationNmber," + | |
| 124 | + " a.stationRoutedirections," + | |
| 125 | + " a.stationRouteDistances," + | |
| 126 | + " a.stationRouteToTime," + | |
| 127 | + " a.staitonRouteFirstTime," + | |
| 128 | + " a.stationRouteEndTime," + | |
| 129 | + " a.stationRouteDescriptions," + | |
| 130 | + " a.stationRouteDestroy," + | |
| 131 | + " a.stationRouteVersions," + | |
| 132 | + " a.stationRouteCreateBy," + | |
| 133 | + " a.stationRouteCreateDate," + | |
| 134 | + " a.stationRouteUpdateBy," + | |
| 135 | + " a.stationRouteUpdateDate," + | |
| 136 | + " b.id AS stationId," + | |
| 137 | + " b.station_cod AS stationCode," + | |
| 138 | + " a.stationRouteName," + | |
| 139 | + " b.road_coding AS stationRoadCoding," + | |
| 140 | + " b.db_type AS stationDbType," + | |
| 141 | + " b.b_jwpoints AS stationJwpoints," + | |
| 142 | + " b.g_lonx AS stationGlonx," + | |
| 143 | + " b.g_laty AS stationGlaty," + | |
| 144 | + " b.x AS stationX," + | |
| 145 | + " b.y AS stationY," + | |
| 146 | + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 147 | + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 148 | + " b.destroy AS stationDestroy," + | |
| 149 | + " b.radius AS stationRadius," + | |
| 150 | + " b.shapes_type AS stationShapesType," + | |
| 151 | + " b.versions AS stationVersions," + | |
| 152 | + " b.descriptions AS sttationDescriptions," + | |
| 153 | + " b.create_by AS stationCreateBy," + | |
| 154 | + " b.create_date AS stationCreateDate," + | |
| 155 | + " b.update_by AS stationUpdateBy," + | |
| 156 | + " b.update_date AS stationUpdateDate," + | |
| 157 | + " a.stationRouteId, " + | |
| 158 | + " b.station_name as zdmc, " + | |
| 159 | + " a.industryCode"+ | |
| 160 | + " FROM " + | |
| 161 | + "( SELECT s.id AS stationRouteId," + | |
| 162 | + " s.line AS stationRouteLine," + | |
| 163 | + " s.station as stationRouteStation," + | |
| 164 | + " s.station_name AS stationRouteName," + | |
| 165 | + " s.station_route_code as stationRouteCode," + | |
| 166 | + " s.industry_code as industryCode," + | |
| 167 | + " s.line_code AS stationRouteLIneCode," + | |
| 168 | + " s.station_mark AS stationRouteStationMark," + | |
| 169 | + " s.out_station_nmber AS stationOutStationNmber," + | |
| 170 | + " s.directions AS stationRoutedirections," + | |
| 171 | + " s.distances AS stationRouteDistances," + | |
| 172 | + " s.to_time AS stationRouteToTime," + | |
| 173 | + " s.first_time AS staitonRouteFirstTime," + | |
| 174 | + " s.end_time AS stationRouteEndTime," + | |
| 175 | + " s.descriptions AS stationRouteDescriptions," + | |
| 176 | + " s.destroy AS stationRouteDestroy," + | |
| 177 | + " s.versions AS stationRouteVersions," + | |
| 178 | + " s.create_by AS stationRouteCreateBy," + | |
| 179 | + " s.create_date AS stationRouteCreateDate," + | |
| 180 | + " s.update_by AS stationRouteUpdateBy," + | |
| 181 | + " s.update_date AS stationRouteUpdateDate FROM bsth_c_ls_stationroute s WHERE s.versions = ?4 and s.station_route_code =(" + | |
| 182 | + "select MIN(station_route_code) as stationRouteCode from bsth_c_ls_stationroute r WHERE " + | |
| 183 | + "r.line=?1 and r.directions =?2 and station_route_code > ?3 and r.destroy = 0 and versions = ?4 ) and s.line=?1 and s.directions = ?2 AND s.destroy = 0) a " + | |
| 184 | + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | |
| 185 | + List<Object[]> findDownStationRoute(Integer id,Integer direction,Integer stationRouteCode, Integer version); | |
| 186 | + | |
| 187 | + /** | |
| 188 | + * @Description :TODO(站点中心点坐标查询) | |
| 189 | + * | |
| 190 | + * @param map <lineId:线路ID; direction:方向> | |
| 191 | + * | |
| 192 | + * @return List<Object[]> | |
| 193 | + */ | |
| 194 | + /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" + | |
| 195 | + "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + | |
| 196 | + "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/ | |
| 197 | + @Query(value = "SELECT s.b_jwpoints,r.station_name,r.station_route_code FROM (" + | |
| 198 | + "SELECT b.station,b.station_route_code,b.station_name FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + | |
| 199 | + "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true) | |
| 200 | + List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction); | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * @Description :TODO(撤销站点) | |
| 204 | + * | |
| 205 | + * @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)> | |
| 206 | + * | |
| 207 | + */ | |
| 208 | + @Transactional | |
| 209 | + @Modifying | |
| 210 | + @Query(value="UPDATE bsth_c_stationroute SET " + | |
| 211 | + "destroy = ?2 WHERE id = ?1", nativeQuery=true) | |
| 212 | + void stationRouteIsDestroyUpd(Integer stationRouteId, Integer destroy); | |
| 213 | + | |
| 214 | + | |
| 215 | + /** | |
| 216 | + * @Description : TODO(根据线路ID生成行单) | |
| 217 | + * | |
| 218 | + * @param lineId:线路ID | |
| 219 | + * | |
| 220 | + * @return List<Object[]>:{[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标) | |
| 221 | + * | |
| 222 | + * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码); | |
| 223 | + * | |
| 224 | + * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)} | |
| 225 | + */ | |
| 226 | + @Query(value = "SELECT * FROM ("+ | |
| 227 | + "SELECT b.g_lonx," + | |
| 228 | + "b.g_laty,b.b_jwpoints," + | |
| 229 | + "a.station_mark," + | |
| 230 | + "a.station_route_code," + | |
| 231 | + "b.station_cod," + | |
| 232 | + "a.distances,"+ | |
| 233 | + "a.station_name," + | |
| 234 | + "a.directions," + | |
| 235 | + "a.station_name_en FROM (SELECT " + | |
| 236 | + "s.station_mark," + | |
| 237 | + "s.station_route_code," + | |
| 238 | + "s.directions," + | |
| 239 | + "s.distances,"+ | |
| 240 | + "s.station_name,"+ | |
| 241 | + "s.station_name_en,"+ | |
| 242 | + "s.station FROM bsth_c_stationroute s where s.line = ?1 and s.destroy=0) a " + | |
| 243 | + "LEFT JOIN bsth_c_station b " + | |
| 244 | + " on a.station = b.id ORDER BY a.directions ASC ) k ORDER BY k.directions,k.station_route_code ASC", nativeQuery=true) | |
| 245 | + List<Object[]> usingSingle(Integer lineId); | |
| 246 | + | |
| 247 | + /** | |
| 248 | + * @Description : TODO(根据站点路由Id查询详情) | |
| 249 | + * | |
| 250 | + * @param id:站点路由ID | |
| 251 | + * | |
| 252 | + * @return List<Object[]> | |
| 253 | + */ | |
| 254 | + @Query(value = "SELECT a.stationRouteLine," + | |
| 255 | + " a.stationRouteStation," + | |
| 256 | + " a.stationRouteCode," + | |
| 257 | + " a.stationRouteLIneCode," + | |
| 258 | + " a.stationRouteStationMark," + | |
| 259 | + " a.stationOutStationNmber," + | |
| 260 | + " a.stationRoutedirections," + | |
| 261 | + " a.stationRouteDistances," + | |
| 262 | + " a.stationRouteToTime," + | |
| 263 | + " a.staitonRouteFirstTime," + | |
| 264 | + " a.stationRouteEndTime," + | |
| 265 | + " a.stationRouteDescriptions," + | |
| 266 | + " a.stationRouteDestroy," + | |
| 267 | + " a.stationRouteVersions," + | |
| 268 | + " a.stationRouteCreateBy," + | |
| 269 | + " a.stationRouteCreateDate," + | |
| 270 | + " a.stationRouteUpdateBy," + | |
| 271 | + " a.stationRouteUpdateDate," + | |
| 272 | + " b.id AS stationId," + | |
| 273 | + " b.station_cod AS stationCode," + | |
| 274 | + " a.stationRouteName," + | |
| 275 | + " b.road_coding AS stationRoadCoding," + | |
| 276 | + " b.db_type AS stationDbType," + | |
| 277 | + " b.b_jwpoints AS stationJwpoints," + | |
| 278 | + " b.g_lonx AS stationGlonx," + | |
| 279 | + " b.g_laty AS stationGlaty," + | |
| 280 | + " b.x AS stationX," + | |
| 281 | + " b.y AS stationY," + | |
| 282 | + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 283 | + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 284 | + " b.destroy AS stationDestroy," + | |
| 285 | + " b.radius AS stationRadius," + | |
| 286 | + " b.shapes_type AS stationShapesType," + | |
| 287 | + " b.versions AS stationVersions," + | |
| 288 | + " b.descriptions AS sttationDescriptions," + | |
| 289 | + " b.create_by AS stationCreateBy," + | |
| 290 | + " b.create_date AS stationCreateDate," + | |
| 291 | + " b.update_by AS stationUpdateBy," + | |
| 292 | + " b.update_date AS stationUpdateDate," + | |
| 293 | + " a.stationRouteId,b.station_name as zdmc, " + | |
| 294 | + " a.industryCode "+ | |
| 295 | + " FROM " + | |
| 296 | + "( SELECT s.id AS stationRouteId," + | |
| 297 | + " s.line AS stationRouteLine," + | |
| 298 | + " s.station as stationRouteStation," + | |
| 299 | + " s.station_name AS stationRouteName," + | |
| 300 | + " s.station_route_code as stationRouteCode," + | |
| 301 | + " s.industry_code as industryCode," + | |
| 302 | + " s.line_code AS stationRouteLIneCode," + | |
| 303 | + " s.station_mark AS stationRouteStationMark," + | |
| 304 | + " s.out_station_nmber AS stationOutStationNmber," + | |
| 305 | + " s.directions AS stationRoutedirections," + | |
| 306 | + " s.distances AS stationRouteDistances," + | |
| 307 | + " s.to_time AS stationRouteToTime," + | |
| 308 | + " s.first_time AS staitonRouteFirstTime," + | |
| 309 | + " s.end_time AS stationRouteEndTime," + | |
| 310 | + " s.descriptions AS stationRouteDescriptions," + | |
| 311 | + " s.destroy AS stationRouteDestroy," + | |
| 312 | + " s.versions AS stationRouteVersions," + | |
| 313 | + " s.create_by AS stationRouteCreateBy," + | |
| 314 | + " s.create_date AS stationRouteCreateDate," + | |
| 315 | + " s.update_by AS stationRouteUpdateBy," + | |
| 316 | + " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " + | |
| 317 | + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) | |
| 318 | + List<Object[]> findStationRouteInfo(Integer id); | |
| 319 | + | |
| 320 | + /** | |
| 321 | + * @Description : TODO(根据站点路由Id查询详情) | |
| 322 | + * | |
| 323 | + * @param id:站点路由ID | |
| 324 | + * | |
| 325 | + * @return List<Object[]> | |
| 326 | + */ | |
| 327 | + @Query(value = "SELECT a.stationRouteLine," + | |
| 328 | + " a.stationRouteStation," + | |
| 329 | + " a.stationRouteCode," + | |
| 330 | + " a.stationRouteLIneCode," + | |
| 331 | + " a.stationRouteStationMark," + | |
| 332 | + " a.stationOutStationNmber," + | |
| 333 | + " a.stationRoutedirections," + | |
| 334 | + " a.stationRouteDistances," + | |
| 335 | + " a.stationRouteToTime," + | |
| 336 | + " a.staitonRouteFirstTime," + | |
| 337 | + " a.stationRouteEndTime," + | |
| 338 | + " a.stationRouteDescriptions," + | |
| 339 | + " a.stationRouteDestroy," + | |
| 340 | + " a.stationRouteVersions," + | |
| 341 | + " a.stationRouteCreateBy," + | |
| 342 | + " a.stationRouteCreateDate," + | |
| 343 | + " a.stationRouteUpdateBy," + | |
| 344 | + " a.stationRouteUpdateDate," + | |
| 345 | + " b.id AS stationId," + | |
| 346 | + " b.station_cod AS stationCode," + | |
| 347 | + " a.stationRouteName," + | |
| 348 | + " b.road_coding AS stationRoadCoding," + | |
| 349 | + " b.db_type AS stationDbType," + | |
| 350 | + " b.b_jwpoints AS stationJwpoints," + | |
| 351 | + " b.g_lonx AS stationGlonx," + | |
| 352 | + " b.g_laty AS stationGlaty," + | |
| 353 | + " b.x AS stationX," + | |
| 354 | + " b.y AS stationY," + | |
| 355 | + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," + | |
| 356 | + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " + | |
| 357 | + " b.destroy AS stationDestroy," + | |
| 358 | + " b.radius AS stationRadius," + | |
| 359 | + " b.shapes_type AS stationShapesType," + | |
| 360 | + " b.versions AS stationVersions," + | |
| 361 | + " b.descriptions AS sttationDescriptions," + | |
| 362 | + " b.create_by AS stationCreateBy," + | |
| 363 | + " b.create_date AS stationCreateDate," + | |
| 364 | + " b.update_by AS stationUpdateBy," + | |
| 365 | + " b.update_date AS stationUpdateDate," + | |
| 366 | + " a.stationRouteId," + | |
| 367 | + "b.station_name as zdmc, "+ | |
| 368 | + "a.industryCode "+ | |
| 369 | + " FROM ( SELECT s.id AS stationRouteId," + | |
| 370 | + " s.line AS stationRouteLine," + | |
| 371 | + " s.station as stationRouteStation," + | |
| 372 | + " s.station_name AS stationRouteName," + | |
| 373 | + " s.station_route_code as stationRouteCode," + | |
| 374 | + " s.industry_code as industryCode," + | |
| 375 | + " s.line_code AS stationRouteLIneCode," + | |
| 376 | + " s.station_mark AS stationRouteStationMark," + | |
| 377 | + " s.out_station_nmber AS stationOutStationNmber," + | |
| 378 | + " s.directions AS stationRoutedirections," + | |
| 379 | + " s.distances AS stationRouteDistances," + | |
| 380 | + " s.to_time AS stationRouteToTime," + | |
| 381 | + " s.first_time AS staitonRouteFirstTime," + | |
| 382 | + " s.end_time AS stationRouteEndTime," + | |
| 383 | + " s.descriptions AS stationRouteDescriptions," + | |
| 384 | + " s.destroy AS stationRouteDestroy," + | |
| 385 | + " s.versions AS stationRouteVersions," + | |
| 386 | + " s.create_by AS stationRouteCreateBy," + | |
| 387 | + " s.create_date AS stationRouteCreateDate," + | |
| 388 | + " s.update_by AS stationRouteUpdateBy," + | |
| 389 | + " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " + | |
| 390 | + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id order by a.stationRouteCode", nativeQuery=true) | |
| 391 | + List<Object[]> getStationRouteList(Integer lineId, Integer dir); | |
| 392 | + | |
| 393 | + List<StationRoute> findByLine(Line line); | |
| 394 | + | |
| 395 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 396 | + @Query("select s from StationRoute s where s.destroy=0") | |
| 397 | + List<StationRoute> findAllEffective(); | |
| 398 | + | |
| 399 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 400 | + @Override | |
| 401 | + Page<StationRoute> findAll(Specification<StationRoute> spec, Pageable pageable); | |
| 402 | + | |
| 403 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 404 | + @Override | |
| 405 | + List<StationRoute> findAll(Specification<StationRoute> spec); | |
| 406 | + | |
| 407 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 408 | + @Override | |
| 409 | + List<StationRoute> findAll(Specification<StationRoute> spec, Sort sort); | |
| 410 | + | |
| 411 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 412 | + @Override | |
| 413 | + @Query(value = "select r from StationRoute r where r.destroy=0") | |
| 414 | + List<StationRoute> findAll(); | |
| 415 | + | |
| 416 | + @Query("select new map(sr.station.id as stationid, sr.stationName as stationname) from StationRoute sr where sr.line.id=?1 and sr.directions=?2") | |
| 417 | + List<Map<String, Object>> findStations(Integer xlid, Integer xldir); | |
| 418 | + | |
| 419 | + @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 420 | + List<StationRoute> findByLine(String lineCode, int updown); | |
| 421 | + | |
| 422 | + @Query("select r from StationRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | |
| 423 | + List<StationRoute> findByLine(Integer lineId, Integer dir); | |
| 424 | + | |
| 425 | + @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and versions is not null order by r.destroy, r.stationRouteCode") | |
| 426 | + List<StationRoute> findAllByLine(String lineCode, int updown); | |
| 427 | + | |
| 428 | + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | |
| 429 | + @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") | |
| 430 | + List<StationRoute> findByLineCode(String lineCode); | |
| 431 | + | |
| 432 | + @Query("SELECT new map(" + | |
| 433 | + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 434 | + "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 435 | + "FROM " + | |
| 436 | + "StationRoute s " + | |
| 437 | + "WHERE " + | |
| 438 | + "s.destroy = 0 " + | |
| 439 | + "and s.lineCode in(select lineCode from Line where inUse = 1) " + | |
| 440 | + "ORDER BY " + | |
| 441 | + "lineCode,directions,stationRouteCode") | |
| 442 | + List<Map<String, String>> findLineWithYgcAndInuse(); | |
| 443 | + | |
| 444 | + @Query("SELECT new map(" + | |
| 445 | + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 446 | + "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 447 | + "FROM " + | |
| 448 | + "StationRoute s " + | |
| 449 | + "WHERE " + | |
| 450 | + "s.destroy = 0 " + | |
| 451 | + "ORDER BY " + | |
| 452 | + "lineCode,directions,stationRouteCode") | |
| 453 | + List<Map<String, String>> findAllLineWithYgc(); | |
| 454 | + | |
| 455 | + @Query("SELECT new map(" + | |
| 456 | + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," + | |
| 457 | + "line.linePlayType as linePlayType,s.stationMark as stationMark) " + | |
| 458 | + "FROM " + | |
| 459 | + "StationRoute s " + | |
| 460 | + "WHERE " + | |
| 461 | + "s.destroy = 0 and s.lineCode = ?1 " + | |
| 462 | + "ORDER BY " + | |
| 463 | + "lineCode,directions,stationRouteCode") | |
| 464 | + List<Map<String, String>> findLineWithYgcByLine(String lineCode); | |
| 465 | + | |
| 466 | + @Modifying | |
| 467 | + @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line = ?1 ", nativeQuery=true) | |
| 468 | + void stationRouteDir(Integer line); | |
| 469 | + | |
| 470 | + @Modifying | |
| 471 | + @Query(value="update bsth_c_stationroute set distances =?2 where id = ?1 ", nativeQuery=true) | |
| 472 | + void upddis(Integer id,Double dis); | |
| 473 | + | |
| 474 | + @Modifying | |
| 475 | + @Query(value="UPDATE bsth_c_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true) | |
| 476 | + void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod); | |
| 477 | + | |
| 478 | + /** | |
| 479 | + * 更新路线前撤销线路原有站点 | |
| 480 | + * | |
| 481 | + * @param line | |
| 482 | + * @param dir | |
| 483 | + */ | |
| 484 | + @Modifying | |
| 485 | + @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where line = ?1 and directions = ?2", nativeQuery=true) | |
| 486 | + public void stationRouteUpdDestroy(Integer line, Integer dir); | |
| 487 | + | |
| 488 | + @Modifying | |
| 489 | + @Query(value="UPDATE bsth_c_stationroute set destroy = 1 where id = ?1", nativeQuery=true) | |
| 490 | + public void stationRouteIsDestroyUpdBatch(Integer ids); | |
| 491 | + | |
| 492 | + /** | |
| 493 | + * | |
| 494 | + * | |
| 495 | + * @param line | |
| 496 | + * @param dir | |
| 497 | + */ | |
| 498 | + @Modifying | |
| 499 | + @Query(value="insert into (select * from bsth_c_stationroute_cache where line = ?1 and directions = ?2) bsth_c_stationroute", nativeQuery=true) | |
| 500 | + void stationRouteUpdate(Integer line, Integer dir); | |
| 501 | + | |
| 502 | + // 更具线路批量撤销 | |
| 503 | + @Modifying | |
| 504 | + @Query(value="UPDATE StationRoute sr set sr.destroy = 1 where sr.line.id = ?1 and sr.lineCode = ?2") | |
| 505 | + void batchUpdate(Integer lineId, String lineCode); | |
| 506 | + | |
| 507 | + // 批量删除 | |
| 508 | + @Modifying | |
| 509 | + @Query(value="delete from StationRoute sr where sr.line.id = ?1 and sr.lineCode = ?2") | |
| 510 | + void batchDelete(Integer lineId, String lineCode); | |
| 511 | + | |
| 512 | + | |
| 513 | + // 批量修改站点行业编码 | |
| 514 | + @Modifying | |
| 515 | + @Query(value="update bsth_c_stationroute set industry_code =?2 where id = ?1 ", nativeQuery=true) | |
| 516 | + void updIndustryCode(Integer id,String IndustryCode); | |
| 517 | +} | ... | ... |
src/main/java/com/bsth/service/impl/LineServiceImpl.java
| 1 | -package com.bsth.service.impl; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.Line; | |
| 5 | -import com.bsth.repository.LineRepository; | |
| 6 | -import com.bsth.service.LineService; | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.jdbc.core.JdbcTemplate; | |
| 9 | -import org.springframework.jdbc.core.RowMapper; | |
| 10 | -import org.springframework.stereotype.Service; | |
| 11 | -import org.springframework.transaction.annotation.Transactional; | |
| 12 | - | |
| 13 | -import java.sql.ResultSet; | |
| 14 | -import java.sql.SQLException; | |
| 15 | -import java.util.HashMap; | |
| 16 | -import java.util.List; | |
| 17 | -import java.util.Map; | |
| 18 | - | |
| 19 | -/** | |
| 20 | - * | |
| 21 | - * @ClassName: LineServiceImpl(线路service业务层实现类) | |
| 22 | - * | |
| 23 | - * @Extends : BaseService | |
| 24 | - * | |
| 25 | - * @Description: TODO(线路service业务层) | |
| 26 | - * | |
| 27 | - * @Author bsth@lq | |
| 28 | - * | |
| 29 | - * @Date 2016年4月28日 上午9:21:17 | |
| 30 | - * | |
| 31 | - * @Version 公交调度系统BS版 0.1 | |
| 32 | - * | |
| 33 | - */ | |
| 34 | - | |
| 35 | -@Service | |
| 36 | -public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements LineService { | |
| 37 | - | |
| 38 | - @Autowired | |
| 39 | - private LineRepository repository; | |
| 40 | - | |
| 41 | - @Autowired | |
| 42 | - JdbcTemplate jdbcTemplate; | |
| 43 | - | |
| 44 | - /** | |
| 45 | - * 获取线路编码 | |
| 46 | - * | |
| 47 | - * @return int <lineCode:线路编码> | |
| 48 | - */ | |
| 49 | - public long selectMaxIdToLineCode() { | |
| 50 | - // TODO Auto-generated method stub | |
| 51 | - return repository.selectMaxIdToLineCode(); | |
| 52 | - } | |
| 53 | - | |
| 54 | - @Override | |
| 55 | - public Line findByLineCode(String lineCode) { | |
| 56 | - return repository.findByLineCode(lineCode); | |
| 57 | - } | |
| 58 | - | |
| 59 | - @Override | |
| 60 | - public Line findById(Integer id) { | |
| 61 | - // TODO Auto-generated method stub | |
| 62 | - return repository.findOne(id); | |
| 63 | - } | |
| 64 | - | |
| 65 | - @Override | |
| 66 | - public String lineCodeVerification(String lineCode) { | |
| 67 | - String state = "true"; | |
| 68 | - Line line = repository.findByLineCode(lineCode); | |
| 69 | - if (line != null) { | |
| 70 | - state = "false"; | |
| 71 | - } | |
| 72 | - return state; | |
| 73 | - } | |
| 74 | - | |
| 75 | - @Transactional | |
| 76 | - @Override | |
| 77 | - public Map<String, Object> update(Line l) { | |
| 78 | - Map<String, Object> map = new HashMap<>(); | |
| 79 | - | |
| 80 | - int status = repository.update(l.getName(), l.getCompany(), l.getBrancheCompany(), l.getLevel(), l.getNature(), | |
| 81 | - l.getStartStationName(), l.getEndStationName(), l.getStartStationFirstTime(), | |
| 82 | - l.getStartStationEndTime(), l.getEndStationFirstTime(), l.getEndStationEndTime(), l.getLinePlayType(), | |
| 83 | - l.getOpenDate(), l.getEs(), l.getShortName(), l.getShanghaiLinecode(), l.getEqLinecode(), | |
| 84 | - l.getStartPhone(), l.getEndPhone(), l.getCarSumNumber(), l.getHvacCarNumber(), l.getOrdCarNumber(), | |
| 85 | - l.getHistory(), l.getDescriptions(), l.getDestroy(), l.getSupperLine(), l.getSpacGrade(), | |
| 86 | - l.getWarrantCar(), l.getLineCode(), l.getRegion()); | |
| 87 | - if (status==1) { | |
| 88 | - map.put("status", ResponseCode.SUCCESS); | |
| 89 | - } else { | |
| 90 | - map.put("status", ResponseCode.ERROR); | |
| 91 | - } | |
| 92 | - | |
| 93 | - return map; | |
| 94 | - } | |
| 95 | - | |
| 96 | - @Override | |
| 97 | - public Map<String, Object> remove(Integer id) { | |
| 98 | - Map<String, Object> map = new HashMap<>(); | |
| 99 | - | |
| 100 | - try{ | |
| 101 | - if(null == id){ | |
| 102 | - map.put("status", ResponseCode.ERROR); | |
| 103 | - map.put("msg", "参数异常"); | |
| 104 | - return map; | |
| 105 | - } | |
| 106 | - | |
| 107 | - int destroy = jdbcTemplate.queryForObject("select destroy from bsth_c_line where id=" + id, Integer.class); | |
| 108 | - | |
| 109 | - if(destroy==0){ | |
| 110 | - map.put("status", ResponseCode.ERROR); | |
| 111 | - map.put("msg", "你只能删除已撤销的线路!"); | |
| 112 | - return map; | |
| 113 | - } | |
| 114 | - | |
| 115 | - jdbcTemplate.update("update bsth_c_line set `remove`=1 where id=?", id); | |
| 116 | - map.put("status", ResponseCode.SUCCESS); | |
| 117 | - }catch (Exception e){ | |
| 118 | - logger.error("", e); | |
| 119 | - map.put("status", ResponseCode.ERROR); | |
| 120 | - map.put("msg", e.getMessage()); | |
| 121 | - } | |
| 122 | - return map; | |
| 123 | - } | |
| 124 | - | |
| 125 | - /*获取线路性质*/ | |
| 126 | - @Override | |
| 127 | - public Map<String, Boolean> lineNature() { | |
| 128 | - // TODO Auto-generated method stub | |
| 129 | -// List<Line> lineList=repository.findLineBygsBm(gsBm, fgsBm, line); | |
| 130 | - String sql="select * from bsth_c_line "; | |
| 131 | - List<Line> lineList=jdbcTemplate.query(sql, | |
| 132 | - new RowMapper<Line>(){ | |
| 133 | - @Override | |
| 134 | - public Line mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 135 | - Line l=new Line(); | |
| 136 | - l.setLineCode(rs.getString("line_code")); | |
| 137 | - l.setNature(rs.getString("nature")); | |
| 138 | - return l; | |
| 139 | - } | |
| 140 | - }); | |
| 141 | - Map<String, Boolean> map=new HashMap<String,Boolean>(); | |
| 142 | - for (int i = 0; i < lineList.size(); i++) { | |
| 143 | - Line t=lineList.get(i); | |
| 144 | - String nature=t.getNature()==null?"":t.getNature(); | |
| 145 | - if(nature.equals("yxl")||nature.equals("cgxl")||nature.equals("gjxl") | |
| 146 | - ||nature.equals("csbs")||nature.equals("cctxl")){ | |
| 147 | - map.put(t.getLineCode(), true); | |
| 148 | - }else{ | |
| 149 | - map.put(t.getLineCode(), false); | |
| 150 | - } | |
| 151 | - } | |
| 152 | - return map; | |
| 153 | - } | |
| 154 | -} | |
| 1 | +package com.bsth.service.impl; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.entity.Line; | |
| 5 | +import com.bsth.entity.StationMatchData; | |
| 6 | +import com.bsth.repository.LineRepository; | |
| 7 | +import com.bsth.service.LineService; | |
| 8 | +import com.bsth.util.db.DBUtils_station; | |
| 9 | +import org.apache.commons.lang3.StringUtils; | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 12 | +import org.springframework.jdbc.core.RowMapper; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.transaction.annotation.Transactional; | |
| 15 | + | |
| 16 | +import java.sql.Connection; | |
| 17 | +import java.sql.PreparedStatement; | |
| 18 | +import java.sql.ResultSet; | |
| 19 | +import java.sql.SQLException; | |
| 20 | +import java.util.ArrayList; | |
| 21 | +import java.util.HashMap; | |
| 22 | +import java.util.List; | |
| 23 | +import java.util.Map; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * | |
| 27 | + * @ClassName: LineServiceImpl(线路service业务层实现类) | |
| 28 | + * | |
| 29 | + * @Extends : BaseService | |
| 30 | + * | |
| 31 | + * @Description: TODO(线路service业务层) | |
| 32 | + * | |
| 33 | + * @Author bsth@lq | |
| 34 | + * | |
| 35 | + * @Date 2016年4月28日 上午9:21:17 | |
| 36 | + * | |
| 37 | + * @Version 公交调度系统BS版 0.1 | |
| 38 | + * | |
| 39 | + */ | |
| 40 | + | |
| 41 | +@Service | |
| 42 | +public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements LineService { | |
| 43 | + | |
| 44 | + @Autowired | |
| 45 | + private LineRepository repository; | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + JdbcTemplate jdbcTemplate; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 获取线路编码 | |
| 52 | + * | |
| 53 | + * @return int <lineCode:线路编码> | |
| 54 | + */ | |
| 55 | + public long selectMaxIdToLineCode() { | |
| 56 | + // TODO Auto-generated method stub | |
| 57 | + return repository.selectMaxIdToLineCode(); | |
| 58 | + } | |
| 59 | + | |
| 60 | + @Override | |
| 61 | + public Line findByLineCode(String lineCode) { | |
| 62 | + return repository.findByLineCode(lineCode); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Override | |
| 66 | + public Line findById(Integer id) { | |
| 67 | + // TODO Auto-generated method stub | |
| 68 | + return repository.findById(id).get(); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public String lineCodeVerification(String lineCode) { | |
| 73 | + String state = "true"; | |
| 74 | + Line line = repository.findByLineCode(lineCode); | |
| 75 | + if (line != null) { | |
| 76 | + state = "false"; | |
| 77 | + } | |
| 78 | + return state; | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Transactional | |
| 82 | + @Override | |
| 83 | + public Map<String, Object> update(Line l) { | |
| 84 | + Map<String, Object> map = new HashMap<>(); | |
| 85 | + | |
| 86 | + if(l.getDestroy() == 0){ | |
| 87 | + l.setInUse(1); | |
| 88 | + } else | |
| 89 | + l.setInUse(0); | |
| 90 | + | |
| 91 | + int status = repository.update(l.getName(), l.getCompany(), l.getBrancheCompany(), l.getLevel(), l.getNature(), | |
| 92 | + l.getStartStationName(), l.getEndStationName(), l.getStartStationFirstTime(), | |
| 93 | + l.getStartStationEndTime(), l.getEndStationFirstTime(), l.getEndStationEndTime(), l.getLinePlayType(), | |
| 94 | + l.getOpenDate(), l.getEs(), l.getShortName(), l.getShanghaiLinecode(), l.getEqLinecode(), | |
| 95 | + l.getStartPhone(), l.getEndPhone(), l.getCarSumNumber(), l.getHvacCarNumber(), l.getOrdCarNumber(), | |
| 96 | + l.getHistory(), l.getDescriptions(), l.getDestroy(), l.getSupperLine(), l.getSpacGrade(), | |
| 97 | + l.getWarrantCar(), l.getLineCode(), l.getRegion(),l.getInUse(),l.getTicketPrice()); | |
| 98 | + if (status==1) { | |
| 99 | + map.put("status", ResponseCode.SUCCESS); | |
| 100 | + } else { | |
| 101 | + map.put("status", ResponseCode.ERROR); | |
| 102 | + } | |
| 103 | + | |
| 104 | + return map; | |
| 105 | + } | |
| 106 | + | |
| 107 | + @Override | |
| 108 | + public Map<String, Object> remove(Integer id) { | |
| 109 | + Map<String, Object> map = new HashMap<>(); | |
| 110 | + | |
| 111 | + try{ | |
| 112 | + if(null == id){ | |
| 113 | + map.put("status", ResponseCode.ERROR); | |
| 114 | + map.put("msg", "参数异常"); | |
| 115 | + return map; | |
| 116 | + } | |
| 117 | + | |
| 118 | + int destroy = jdbcTemplate.queryForObject("select destroy from bsth_c_line where id=" + id, Integer.class); | |
| 119 | + | |
| 120 | + if(destroy==0){ | |
| 121 | + map.put("status", ResponseCode.ERROR); | |
| 122 | + map.put("msg", "你只能删除已撤销的线路!"); | |
| 123 | + return map; | |
| 124 | + } | |
| 125 | + | |
| 126 | + jdbcTemplate.update("update bsth_c_line set `remove`=1 where id=?", id); | |
| 127 | + map.put("status", ResponseCode.SUCCESS); | |
| 128 | + }catch (Exception e){ | |
| 129 | + logger.error("", e); | |
| 130 | + map.put("status", ResponseCode.ERROR); | |
| 131 | + map.put("msg", e.getMessage()); | |
| 132 | + } | |
| 133 | + return map; | |
| 134 | + } | |
| 135 | + | |
| 136 | + /*获取线路性质*/ | |
| 137 | + @Override | |
| 138 | + public Map<String, Boolean> lineNature() { | |
| 139 | + // TODO Auto-generated method stub | |
| 140 | +// List<Line> lineList=repository.findLineBygsBm(gsBm, fgsBm, line); | |
| 141 | + String sql="select * from bsth_c_line "; | |
| 142 | + List<Line> lineList=jdbcTemplate.query(sql, | |
| 143 | + new RowMapper<Line>(){ | |
| 144 | + @Override | |
| 145 | + public Line mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 146 | + Line l=new Line(); | |
| 147 | + l.setLineCode(rs.getString("line_code")); | |
| 148 | + l.setNature(rs.getString("nature")); | |
| 149 | + return l; | |
| 150 | + } | |
| 151 | + }); | |
| 152 | + Map<String, Boolean> map=new HashMap<String,Boolean>(); | |
| 153 | + for (int i = 0; i < lineList.size(); i++) { | |
| 154 | + Line t=lineList.get(i); | |
| 155 | + String nature=t.getNature()==null?"":t.getNature(); | |
| 156 | + if(nature.equals("yxl")||nature.equals("cgxl")||nature.equals("gjxl") | |
| 157 | + ||nature.equals("csbs")||nature.equals("cctxl")){ | |
| 158 | + map.put(t.getLineCode(), true); | |
| 159 | + }else{ | |
| 160 | + map.put(t.getLineCode(), false); | |
| 161 | + } | |
| 162 | + } | |
| 163 | + return map; | |
| 164 | + } | |
| 165 | + | |
| 166 | + @Override | |
| 167 | + public Map<String, Object> getLineMatchStationIsUpdate(Integer id){ | |
| 168 | + Map<String, Object> map = new HashMap<>(); | |
| 169 | + Line l = repository.findById(id).get(); | |
| 170 | + Connection conn = null; | |
| 171 | + PreparedStatement ps = null; | |
| 172 | + ResultSet rs = null; | |
| 173 | + | |
| 174 | + List<StationMatchData> listMD = new ArrayList<>(); | |
| 175 | + String sql = "select `type` from roadline where RoadLine =\""+l.getName()+"\""; | |
| 176 | + if(!StringUtils.isEmpty(l.getShanghaiLinecode())){ | |
| 177 | + sql += " or LineStandardCode=\""+l.getShanghaiLinecode()+"\""; | |
| 178 | + } | |
| 179 | + try { | |
| 180 | + conn = DBUtils_station.getConnection(); | |
| 181 | + ps = conn.prepareStatement(sql); | |
| 182 | +// int stauts = ps.executeQuery().getInt(1); | |
| 183 | + String stauts = "0"; | |
| 184 | + rs = ps.executeQuery(); | |
| 185 | + while (rs.next()) { | |
| 186 | + stauts = rs.getString("type"); | |
| 187 | + } | |
| 188 | + map.put("status",ResponseCode.SUCCESS); | |
| 189 | + map.put("data",stauts); | |
| 190 | + }catch(Exception e){ | |
| 191 | + logger.error(e.toString(), e); | |
| 192 | + map.put("status",ResponseCode.ERROR); | |
| 193 | + }finally { | |
| 194 | + DBUtils_station.close(rs, ps, conn); | |
| 195 | + } | |
| 196 | + return map; | |
| 197 | + } | |
| 198 | +} | ... | ... |