正在显示
16 个修改的文件
包含
1050 行增加
和
60 行删除
| 1 | package com.sunyo.wlpt.vehicle.manage; | 1 | package com.sunyo.wlpt.vehicle.manage; |
| 2 | 2 | ||
| 3 | +import org.mybatis.spring.annotation.MapperScan; | ||
| 3 | import org.springframework.boot.SpringApplication; | 4 | import org.springframework.boot.SpringApplication; |
| 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 6 | +import org.springframework.cache.annotation.EnableCaching; | ||
| 7 | +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
| 8 | +import org.springframework.cloud.openfeign.EnableFeignClients; | ||
| 9 | +import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
| 5 | 10 | ||
| 6 | /** | 11 | /** |
| 7 | * @author 子诚 | 12 | * @author 子诚 |
| 8 | */ | 13 | */ |
| 14 | +@EnableCaching | ||
| 9 | @SpringBootApplication | 15 | @SpringBootApplication |
| 16 | +@MapperScan("com.sunyo.wlpt.vehicle.manage.mapper") | ||
| 17 | +@EnableFeignClients | ||
| 18 | +@EnableEurekaClient | ||
| 19 | +@EnableTransactionManagement | ||
| 10 | public class VehicleManageApplication { | 20 | public class VehicleManageApplication { |
| 11 | public static void main(String[] args) | 21 | public static void main(String[] args) |
| 12 | { | 22 | { |
| 1 | package com.sunyo.wlpt.vehicle.manage.cache; | 1 | package com.sunyo.wlpt.vehicle.manage.cache; |
| 2 | 2 | ||
| 3 | +import lombok.extern.slf4j.Slf4j; | ||
| 3 | import org.apache.ibatis.cache.Cache; | 4 | import org.apache.ibatis.cache.Cache; |
| 4 | -import org.slf4j.Logger; | ||
| 5 | -import org.slf4j.LoggerFactory; | ||
| 6 | import org.springframework.data.redis.core.RedisTemplate; | 5 | import org.springframework.data.redis.core.RedisTemplate; |
| 7 | import org.springframework.data.redis.serializer.StringRedisSerializer; | 6 | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| 8 | import org.springframework.util.DigestUtils; | 7 | import org.springframework.util.DigestUtils; |
| @@ -27,14 +26,10 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; | @@ -27,14 +26,10 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; | ||
| 27 | * <p> | 26 | * <p> |
| 28 | * 时间:2020/8/6 9:37 | 27 | * 时间:2020/8/6 9:37 |
| 29 | */ | 28 | */ |
| 29 | +@Slf4j | ||
| 30 | public class RedisCache implements Cache { | 30 | public class RedisCache implements Cache { |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | - * slf4j的日志记录器 | ||
| 34 | - */ | ||
| 35 | - private static final Logger logger = LoggerFactory.getLogger(com.sunyo.wlpt.vehicle.manage.cache.RedisCache.class); | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | * 用于事务性缓存操作的读写锁 | 33 | * 用于事务性缓存操作的读写锁 |
| 39 | */ | 34 | */ |
| 40 | private static final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); | 35 | private static final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); |
| @@ -71,14 +66,20 @@ public class RedisCache implements Cache { | @@ -71,14 +66,20 @@ public class RedisCache implements Cache { | ||
| 71 | public void putObject(Object key, Object value) | 66 | public void putObject(Object key, Object value) |
| 72 | { | 67 | { |
| 73 | RedisTemplate redisTemplate = getRedisTemplate(); | 68 | RedisTemplate redisTemplate = getRedisTemplate(); |
| 74 | - // 使用redis的hash类型作为缓存存储模型 | 69 | + /** |
| 70 | + * 使用redis的hash类型作为缓存存储模型 | ||
| 71 | + */ | ||
| 75 | redisTemplate.opsForHash().put(id.toString(), encryptionKey(key.toString()), value); | 72 | redisTemplate.opsForHash().put(id.toString(), encryptionKey(key.toString()), value); |
| 76 | 73 | ||
| 77 | /** | 74 | /** |
| 78 | * 根据业务的不同,设置不同的缓存时间,解决掉缓存雪崩 | 75 | * 根据业务的不同,设置不同的缓存时间,解决掉缓存雪崩 |
| 79 | */ | 76 | */ |
| 80 | - if (id.equals("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper")) { | ||
| 81 | - // 车辆查询 | 77 | + if ("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper".equals(id)) { |
| 78 | + // 车辆信息 | ||
| 79 | + redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES); | ||
| 80 | + } | ||
| 81 | + if ("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper".equals(id)) { | ||
| 82 | + // 挂车信息 | ||
| 82 | redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES); | 83 | redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES); |
| 83 | } else { | 84 | } else { |
| 84 | // 其他,作为补充 | 85 | // 其他,作为补充 |
| @@ -123,7 +124,7 @@ public class RedisCache implements Cache { | @@ -123,7 +124,7 @@ public class RedisCache implements Cache { | ||
| 123 | @Override | 124 | @Override |
| 124 | public void clear() | 125 | public void clear() |
| 125 | { | 126 | { |
| 126 | - logger.info("清空->{}<-缓存", id); | 127 | + log.info("清空->{}<-缓存", id); |
| 127 | RedisTemplate redisTemplate = getRedisTemplate(); | 128 | RedisTemplate redisTemplate = getRedisTemplate(); |
| 128 | // 清空 namespace | 129 | // 清空 namespace |
| 129 | redisTemplate.delete(id.toString()); | 130 | redisTemplate.delete(id.toString()); |
src/main/java/com/sunyo/wlpt/vehicle/manage/controller/LandRoadTrailerRecordController.java
0 → 100644
| 1 | +package com.sunyo.wlpt.vehicle.manage.controller; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord; | ||
| 4 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord; | ||
| 5 | +import com.sunyo.wlpt.vehicle.manage.response.ResultJson; | ||
| 6 | +import com.sunyo.wlpt.vehicle.manage.service.LandRoadTrailerRecordService; | ||
| 7 | +import org.springframework.web.bind.annotation.*; | ||
| 8 | + | ||
| 9 | +import javax.annotation.Resource; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author 子诚 | ||
| 13 | + * Description:挂车管理,控制器 | ||
| 14 | + * 时间:2020/9/23 15:25 | ||
| 15 | + */ | ||
| 16 | +@CrossOrigin | ||
| 17 | +@RequestMapping("trailer") | ||
| 18 | +@RestController | ||
| 19 | +public class LandRoadTrailerRecordController { | ||
| 20 | + | ||
| 21 | + @Resource | ||
| 22 | + private LandRoadTrailerRecordService landRoadTrailerRecordService; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 分页查询,挂车信息 | ||
| 26 | + * | ||
| 27 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 28 | + * @param pageNum 当前页 | ||
| 29 | + * @param pageSize 每页大小 | ||
| 30 | + * @return | ||
| 31 | + */ | ||
| 32 | + @GetMapping("/page") | ||
| 33 | + public ResultJson selectListByPage( | ||
| 34 | + @RequestParam(value = "trailerLicenseNo", required = false) String trailerLicenseNo, | ||
| 35 | + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, | ||
| 36 | + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) | ||
| 37 | + { | ||
| 38 | + LandRoadTrailerRecord landRoadTrailerRecord = LandRoadTrailerRecord.builder().trailerLicenseNo(trailerLicenseNo).build(); | ||
| 39 | + return landRoadTrailerRecordService.selectListByPage(landRoadTrailerRecord, pageNum, pageSize); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 修改 or 编辑 | ||
| 44 | + * | ||
| 45 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 46 | + * @return 成功 or 失败 | ||
| 47 | + */ | ||
| 48 | + @PutMapping("/update") | ||
| 49 | + public ResultJson updateTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 50 | + { | ||
| 51 | + return landRoadTrailerRecordService.updateByPrimaryKeySelective(landRoadTrailerRecord); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 新增 | ||
| 56 | + * | ||
| 57 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 58 | + * @return 成功 or 失败 | ||
| 59 | + */ | ||
| 60 | + @PostMapping("/insert") | ||
| 61 | + public ResultJson insertTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 62 | + { | ||
| 63 | + return landRoadTrailerRecordService.insertSelective(landRoadTrailerRecord); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 删除 | ||
| 68 | + * 条件:id | ||
| 69 | + * | ||
| 70 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 71 | + * @return | ||
| 72 | + */ | ||
| 73 | + @DeleteMapping("/delete") | ||
| 74 | + public ResultJson deleteTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 75 | + { | ||
| 76 | + return landRoadTrailerRecordService.deleteByPrimaryKey(landRoadTrailerRecord.getId()); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 批量删除 | ||
| 81 | + * 条件:{id: id1,id2...} | ||
| 82 | + * | ||
| 83 | + * @param landRoadTrailerRecord 车辆信息 {@link LandRoadTrailerRecord} | ||
| 84 | + * @return | ||
| 85 | + */ | ||
| 86 | + @DeleteMapping("/batchRemove") | ||
| 87 | + public ResultJson batchRemoveTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 88 | + { | ||
| 89 | + String id = landRoadTrailerRecord.getId(); | ||
| 90 | + return id.contains(",") ? landRoadTrailerRecordService.batchRemoveByIds(id) | ||
| 91 | + : landRoadTrailerRecordService.deleteByPrimaryKey(id); | ||
| 92 | + } | ||
| 93 | +} |
| @@ -10,7 +10,7 @@ import javax.annotation.Resource; | @@ -10,7 +10,7 @@ import javax.annotation.Resource; | ||
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * @author 子诚 | 12 | * @author 子诚 |
| 13 | - * Description: | 13 | + * Description:车辆管理,控制器 |
| 14 | * 时间:2020/9/22 17:58 | 14 | * 时间:2020/9/22 17:58 |
| 15 | */ | 15 | */ |
| 16 | @CrossOrigin | 16 | @CrossOrigin |
| @@ -32,7 +32,7 @@ public class LandRoadVeRecordController { | @@ -32,7 +32,7 @@ public class LandRoadVeRecordController { | ||
| 32 | * @return | 32 | * @return |
| 33 | */ | 33 | */ |
| 34 | @GetMapping("/page") | 34 | @GetMapping("/page") |
| 35 | - public ResultJson selectBusExchangeList( | 35 | + public ResultJson selectListByPage( |
| 36 | @RequestParam(value = "domesticLisenceNo", required = false) String domesticLisenceNo, | 36 | @RequestParam(value = "domesticLisenceNo", required = false) String domesticLisenceNo, |
| 37 | @RequestParam(value = "veType", required = false) String veType, | 37 | @RequestParam(value = "veType", required = false) String veType, |
| 38 | @RequestParam(value = "veState", required = false) String veState, | 38 | @RequestParam(value = "veState", required = false) String veState, |
| @@ -47,13 +47,26 @@ public class LandRoadVeRecordController { | @@ -47,13 +47,26 @@ public class LandRoadVeRecordController { | ||
| 47 | return landRoadVeRecordService.selectListByPage(landRoadVeRecord, pageNum, pageSize); | 47 | return landRoadVeRecordService.selectListByPage(landRoadVeRecord, pageNum, pageSize); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | + /** | ||
| 51 | + * 删除 | ||
| 52 | + * 条件:id | ||
| 53 | + * | ||
| 54 | + * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} | ||
| 55 | + * @return | ||
| 56 | + */ | ||
| 50 | @DeleteMapping("/delete") | 57 | @DeleteMapping("/delete") |
| 51 | public ResultJson deleteLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) | 58 | public ResultJson deleteLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) |
| 52 | { | 59 | { |
| 53 | return landRoadVeRecordService.deleteByPrimaryKey(landRoadVeRecord.getId()); | 60 | return landRoadVeRecordService.deleteByPrimaryKey(landRoadVeRecord.getId()); |
| 54 | } | 61 | } |
| 55 | 62 | ||
| 56 | - | 63 | + /** |
| 64 | + * 批量删除 | ||
| 65 | + * 条件:{id: id1,id2...} | ||
| 66 | + * | ||
| 67 | + * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} | ||
| 68 | + * @return | ||
| 69 | + */ | ||
| 57 | @DeleteMapping("/batchRemove") | 70 | @DeleteMapping("/batchRemove") |
| 58 | public ResultJson batchRemoveLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) | 71 | public ResultJson batchRemoveLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) |
| 59 | { | 72 | { |
| @@ -63,11 +76,24 @@ public class LandRoadVeRecordController { | @@ -63,11 +76,24 @@ public class LandRoadVeRecordController { | ||
| 63 | : landRoadVeRecordService.deleteByPrimaryKey(id); | 76 | : landRoadVeRecordService.deleteByPrimaryKey(id); |
| 64 | } | 77 | } |
| 65 | 78 | ||
| 79 | + /** | ||
| 80 | + * 新增 | ||
| 81 | + * | ||
| 82 | + * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} | ||
| 83 | + * @return | ||
| 84 | + */ | ||
| 66 | @PostMapping("/insert") | 85 | @PostMapping("/insert") |
| 67 | public ResultJson insertLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) | 86 | public ResultJson insertLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) |
| 68 | { | 87 | { |
| 69 | return landRoadVeRecordService.insertSelective(landRoadVeRecord); | 88 | return landRoadVeRecordService.insertSelective(landRoadVeRecord); |
| 70 | } | 89 | } |
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 修改 or 编辑 | ||
| 93 | + * | ||
| 94 | + * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} | ||
| 95 | + * @return | ||
| 96 | + */ | ||
| 71 | @PutMapping("/update") | 97 | @PutMapping("/update") |
| 72 | public ResultJson updateLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) | 98 | public ResultJson updateLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord) |
| 73 | { | 99 | { |
| 1 | +package com.sunyo.wlpt.vehicle.manage.domain; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | + | ||
| 6 | +import java.io.Serializable; | ||
| 7 | +import java.util.Date; | ||
| 8 | + | ||
| 9 | +import lombok.AllArgsConstructor; | ||
| 10 | +import lombok.Builder; | ||
| 11 | +import lombok.Data; | ||
| 12 | +import lombok.NoArgsConstructor; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @author 子诚 | ||
| 16 | + * Description:挂车信息 | ||
| 17 | + * 时间:2020/9/23 15:17 | ||
| 18 | + */ | ||
| 19 | +@ApiModel("挂车信息") | ||
| 20 | +@Data | ||
| 21 | +@Builder | ||
| 22 | +@AllArgsConstructor | ||
| 23 | +@NoArgsConstructor | ||
| 24 | +public class LandRoadTrailerRecord implements Serializable { | ||
| 25 | + | ||
| 26 | + private static final long serialVersionUID = -7494420606904422510L; | ||
| 27 | + | ||
| 28 | + @ApiModelProperty(value = "主键id") | ||
| 29 | + private String id; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 电子口岸报文ID(电子口岸与海关数据传输使用,企业无需填写) | ||
| 33 | + */ | ||
| 34 | + @ApiModelProperty(value = "电子口岸报文ID(电子口岸与海关数据传输使用,企业无需填写)") | ||
| 35 | + private String eportId; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 主管海关代码 | ||
| 39 | + */ | ||
| 40 | + @ApiModelProperty(value = "主管海关代码") | ||
| 41 | + private String mainPort; | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 挂车牌号 | ||
| 45 | + */ | ||
| 46 | + @ApiModelProperty(value = "挂车牌号") | ||
| 47 | + private String trailerLicenseNo; | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 挂车注册地 | ||
| 51 | + */ | ||
| 52 | + @ApiModelProperty(value = "挂车注册地") | ||
| 53 | + private String trailerRegPlace; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 车架号码 | ||
| 57 | + */ | ||
| 58 | + @ApiModelProperty(value = "车架号码") | ||
| 59 | + private String frameNo; | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 挂车重量 | ||
| 63 | + */ | ||
| 64 | + @ApiModelProperty(value = "挂车重量") | ||
| 65 | + private String trailerWt; | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 挂车颜色 | ||
| 69 | + */ | ||
| 70 | + @ApiModelProperty(value = "挂车颜色") | ||
| 71 | + private String trailerColor; | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 车厢照片 | ||
| 75 | + */ | ||
| 76 | + @ApiModelProperty(value = "车厢照片") | ||
| 77 | + private String veConPic; | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 申请人 | ||
| 81 | + */ | ||
| 82 | + @ApiModelProperty(value = "申请人") | ||
| 83 | + private String proposer; | ||
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * 申请时间 | ||
| 87 | + */ | ||
| 88 | + @ApiModelProperty(value = "申请时间") | ||
| 89 | + private Date proposeTime; | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 挂车备案类别:1是进出境挂车;2是来往港澳挂车 | ||
| 93 | + */ | ||
| 94 | + @ApiModelProperty(value = "挂车备案类别:1是进出境挂车;2是来往港澳挂车") | ||
| 95 | + private String trailerClassFlag; | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 数据操作类型 | ||
| 99 | + */ | ||
| 100 | + @ApiModelProperty(value = "数据操作类型") | ||
| 101 | + private String operationType; | ||
| 102 | + | ||
| 103 | + /** | ||
| 104 | + * 挂车牌号图片 | ||
| 105 | + */ | ||
| 106 | + @ApiModelProperty(value = "挂车牌号图片") | ||
| 107 | + private String trailerLicenseNoPic; | ||
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 回执内容 | ||
| 111 | + */ | ||
| 112 | + @ApiModelProperty(value = "回执内容") | ||
| 113 | + private String returnmessage; | ||
| 114 | + | ||
| 115 | + @ApiModelProperty(value = "被谁创建") | ||
| 116 | + private String createBy; | ||
| 117 | + | ||
| 118 | + @ApiModelProperty(value = "创建时间") | ||
| 119 | + private Date createDate; | ||
| 120 | + | ||
| 121 | + @ApiModelProperty(value = "被谁修改") | ||
| 122 | + private String updateBy; | ||
| 123 | + | ||
| 124 | + @ApiModelProperty(value = "修改时间") | ||
| 125 | + private Date updateDate; | ||
| 126 | +} |
| @@ -6,6 +6,7 @@ package com.sunyo.wlpt.vehicle.manage.exception; | @@ -6,6 +6,7 @@ package com.sunyo.wlpt.vehicle.manage.exception; | ||
| 6 | * 时间:2020/7/17 16:43 | 6 | * 时间:2020/7/17 16:43 |
| 7 | */ | 7 | */ |
| 8 | public class CustomException extends RuntimeException { | 8 | public class CustomException extends RuntimeException { |
| 9 | + | ||
| 9 | private static final long serialVersionUID = 6098063244016154220L; | 10 | private static final long serialVersionUID = 6098063244016154220L; |
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| @@ -18,22 +19,32 @@ public class CustomException extends RuntimeException { | @@ -18,22 +19,32 @@ public class CustomException extends RuntimeException { | ||
| 18 | */ | 19 | */ |
| 19 | private String message; | 20 | private String message; |
| 20 | 21 | ||
| 21 | - public CustomException(CustomExceptionType exceptionTypeEnum, String message) { | 22 | + public CustomException(CustomExceptionType exceptionTypeEnum, String message) |
| 23 | + { | ||
| 22 | this.code = exceptionTypeEnum.getCode(); | 24 | this.code = exceptionTypeEnum.getCode(); |
| 23 | this.message = message; | 25 | this.message = message; |
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | - public CustomException(CustomExceptionType exceptionTypeEnum) { | 28 | + public CustomException(String code, String message) |
| 29 | + { | ||
| 30 | + this.code = code; | ||
| 31 | + this.message = message; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public CustomException(CustomExceptionType exceptionTypeEnum) | ||
| 35 | + { | ||
| 27 | this.code = exceptionTypeEnum.getCode(); | 36 | this.code = exceptionTypeEnum.getCode(); |
| 28 | this.message = exceptionTypeEnum.getMsg(); | 37 | this.message = exceptionTypeEnum.getMsg(); |
| 29 | } | 38 | } |
| 30 | 39 | ||
| 31 | - public String getCode() { | 40 | + public String getCode() |
| 41 | + { | ||
| 32 | return code; | 42 | return code; |
| 33 | } | 43 | } |
| 34 | 44 | ||
| 35 | @Override | 45 | @Override |
| 36 | - public String getMessage() { | 46 | + public String getMessage() |
| 47 | + { | ||
| 37 | return message; | 48 | return message; |
| 38 | } | 49 | } |
| 39 | 50 |
| @@ -4,6 +4,7 @@ package com.sunyo.wlpt.vehicle.manage.exception; | @@ -4,6 +4,7 @@ package com.sunyo.wlpt.vehicle.manage.exception; | ||
| 4 | import com.sunyo.wlpt.vehicle.manage.response.ResultJson; | 4 | import com.sunyo.wlpt.vehicle.manage.response.ResultJson; |
| 5 | import org.slf4j.Logger; | 5 | import org.slf4j.Logger; |
| 6 | import org.slf4j.LoggerFactory; | 6 | import org.slf4j.LoggerFactory; |
| 7 | +import org.springframework.web.bind.annotation.ControllerAdvice; | ||
| 7 | import org.springframework.web.bind.annotation.ExceptionHandler; | 8 | import org.springframework.web.bind.annotation.ExceptionHandler; |
| 8 | import org.springframework.web.bind.annotation.ResponseBody; | 9 | import org.springframework.web.bind.annotation.ResponseBody; |
| 9 | 10 | ||
| @@ -12,19 +13,16 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -12,19 +13,16 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 12 | * Description:自定义全局异常处理类 | 13 | * Description:自定义全局异常处理类 |
| 13 | * 时间:2020/7/17 17:44 | 14 | * 时间:2020/7/17 17:44 |
| 14 | */ | 15 | */ |
| 15 | -//@ControllerAdvice | 16 | +@ControllerAdvice |
| 16 | public class GlobalExceptionHandler { | 17 | public class GlobalExceptionHandler { |
| 17 | private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); | 18 | private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); |
| 18 | 19 | ||
| 19 | - //处理程序员主动转换的自定义异常 | ||
| 20 | @ExceptionHandler(CustomException.class) | 20 | @ExceptionHandler(CustomException.class) |
| 21 | @ResponseBody | 21 | @ResponseBody |
| 22 | public ResultJson customerException(CustomException e) | 22 | public ResultJson customerException(CustomException e) |
| 23 | { | 23 | { |
| 24 | if (e.getCode() == CustomExceptionType.SYSTEM_ERROR.getCode()) { | 24 | if (e.getCode() == CustomExceptionType.SYSTEM_ERROR.getCode()) { |
| 25 | - //400异常不需要持久化,将异常信息以友好的方式告知用户就可以 | ||
| 26 | - | ||
| 27 | - //TODO 将500异常信息持久化处理,方便运维人员处理 | 25 | + //TODO 将异常信息持久化,or 打印日志 |
| 28 | logger.error(""); | 26 | logger.error(""); |
| 29 | } | 27 | } |
| 30 | return ResultJson.error(e); | 28 | return ResultJson.error(e); |
| 1 | +package com.sunyo.wlpt.vehicle.manage.mapper; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord; | ||
| 4 | +import org.apache.ibatis.annotations.Mapper; | ||
| 5 | +import org.apache.ibatis.annotations.Param; | ||
| 6 | + | ||
| 7 | +import java.util.Collection; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @author 子诚 | ||
| 12 | + * Description: | ||
| 13 | + * 时间:2020/9/23 15:17 | ||
| 14 | + */ | ||
| 15 | +@Mapper | ||
| 16 | +public interface LandRoadTrailerRecordMapper { | ||
| 17 | + /** | ||
| 18 | + * delete by primary key | ||
| 19 | + * | ||
| 20 | + * @param id primaryKey | ||
| 21 | + * @return deleteCount | ||
| 22 | + */ | ||
| 23 | + int deleteByPrimaryKey(String id); | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 批量删除 | ||
| 27 | + * | ||
| 28 | + * @param idList id数组 | ||
| 29 | + * @return | ||
| 30 | + */ | ||
| 31 | + int batchRemoveByIds(String[] idList); | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * insert record to table | ||
| 35 | + * | ||
| 36 | + * @param record the record | ||
| 37 | + * @return insert count | ||
| 38 | + */ | ||
| 39 | + int insert(LandRoadTrailerRecord record); | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * insert record to table selective | ||
| 43 | + * | ||
| 44 | + * @param record the record | ||
| 45 | + * @return insert count | ||
| 46 | + */ | ||
| 47 | + int insertSelective(LandRoadTrailerRecord record); | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * select by primary key | ||
| 51 | + * | ||
| 52 | + * @param id primary key | ||
| 53 | + * @return object by primary key | ||
| 54 | + */ | ||
| 55 | + LandRoadTrailerRecord selectByPrimaryKey(String id); | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * update record selective | ||
| 59 | + * | ||
| 60 | + * @param record the updated record | ||
| 61 | + * @return update count | ||
| 62 | + */ | ||
| 63 | + int updateByPrimaryKeySelective(LandRoadTrailerRecord record); | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * update record | ||
| 67 | + * | ||
| 68 | + * @param record the updated record | ||
| 69 | + * @return update count | ||
| 70 | + */ | ||
| 71 | + int updateByPrimaryKey(LandRoadTrailerRecord record); | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 查询挂车信息列表(目前应用于分页查询) | ||
| 75 | + * 查询字段:挂车车牌号 | ||
| 76 | + * | ||
| 77 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 78 | + * @return | ||
| 79 | + */ | ||
| 80 | + List<LandRoadTrailerRecord> selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord); | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 查询,根据车牌号 | ||
| 84 | + * <p> | ||
| 85 | + * 用于判断,该挂车车牌号,是否唯一 | ||
| 86 | + * | ||
| 87 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 88 | + * @return | ||
| 89 | + */ | ||
| 90 | + List<LandRoadTrailerRecord> selectByTrailerLicenseNo(@Param("trailerLicenseNo") String trailerLicenseNo); | ||
| 91 | +} |
| @@ -71,7 +71,7 @@ public interface LandRoadVeRecordMapper { | @@ -71,7 +71,7 @@ public interface LandRoadVeRecordMapper { | ||
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | * 分页查询车辆信息列表 | 73 | * 分页查询车辆信息列表 |
| 74 | - * 条件: | 74 | + * 条件:国内车牌号、车辆类型、车辆状态 |
| 75 | * | 75 | * |
| 76 | * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} | 76 | * @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord} |
| 77 | * @return 全部列表 | 77 | * @return 全部列表 |
| @@ -84,5 +84,13 @@ public interface LandRoadVeRecordMapper { | @@ -84,5 +84,13 @@ public interface LandRoadVeRecordMapper { | ||
| 84 | * @param domesticLisenceNo 国内车牌号 | 84 | * @param domesticLisenceNo 国内车牌号 |
| 85 | * @return | 85 | * @return |
| 86 | */ | 86 | */ |
| 87 | - LandRoadVeRecord selectByDomesticLisenceNo(@Param("domesticLisenceNo") String domesticLisenceNo); | 87 | + List<LandRoadVeRecord> selectByDomesticLisenceNo(@Param("domesticLisenceNo") String domesticLisenceNo); |
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * 根据挂车车牌号,查询 | ||
| 91 | + * | ||
| 92 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 93 | + * @return | ||
| 94 | + */ | ||
| 95 | + List<LandRoadVeRecord> selectByTrailerLicenseNo(@Param("trailerLicenseNo") String trailerLicenseNo); | ||
| 88 | } | 96 | } |
| @@ -100,9 +100,9 @@ public class ResultJson<T> implements Serializable { | @@ -100,9 +100,9 @@ public class ResultJson<T> implements Serializable { | ||
| 100 | return new ResultJson<>("200", "success"); | 100 | return new ResultJson<>("200", "success"); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | - public static ResultJson success(String msg) | 103 | + public static ResultJson success(String message) |
| 104 | { | 104 | { |
| 105 | - return new ResultJson<>("200", msg); | 105 | + return new ResultJson<>("200", message); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | 108 | ||
| @@ -126,6 +126,16 @@ public class ResultJson<T> implements Serializable { | @@ -126,6 +126,16 @@ public class ResultJson<T> implements Serializable { | ||
| 126 | return new ResultJson<>("200", message, data); | 126 | return new ResultJson<>("200", message, data); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | + public static ResultJson success(String code, String message) | ||
| 130 | + { | ||
| 131 | + return new ResultJson<>(code, message); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public static ResultJson success(String code, String message, Object data) | ||
| 135 | + { | ||
| 136 | + return new ResultJson<>(code, message, data); | ||
| 137 | + } | ||
| 138 | + | ||
| 129 | public static ResultJson success(CustomExceptionType customExceptionType) | 139 | public static ResultJson success(CustomExceptionType customExceptionType) |
| 130 | { | 140 | { |
| 131 | return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg()); | 141 | return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg()); |
| @@ -167,8 +177,8 @@ public class ResultJson<T> implements Serializable { | @@ -167,8 +177,8 @@ public class ResultJson<T> implements Serializable { | ||
| 167 | return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg()); | 177 | return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg()); |
| 168 | } | 178 | } |
| 169 | 179 | ||
| 170 | - public static ResultJson error(String code, String msg) | 180 | + public static ResultJson error(String code, String message) |
| 171 | { | 181 | { |
| 172 | - return new ResultJson<>(code, msg); | 182 | + return new ResultJson<>(code, message); |
| 173 | } | 183 | } |
| 174 | } | 184 | } |
| 1 | +package com.sunyo.wlpt.vehicle.manage.service; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord; | ||
| 4 | +import com.sunyo.wlpt.vehicle.manage.response.ResultJson; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @author 子诚 | ||
| 8 | + * Description: | ||
| 9 | + * 时间:2020/9/23 15:17 | ||
| 10 | + */ | ||
| 11 | +public interface LandRoadTrailerRecordService { | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * delete by primary key | ||
| 15 | + * | ||
| 16 | + * @param id primaryKey | ||
| 17 | + * @return deleteCount | ||
| 18 | + */ | ||
| 19 | + ResultJson deleteByPrimaryKey(String id); | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * insert record to table | ||
| 23 | + * | ||
| 24 | + * @param record the record | ||
| 25 | + * @return insert count | ||
| 26 | + */ | ||
| 27 | + int insert(LandRoadTrailerRecord record); | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * insert record to table selective | ||
| 31 | + * | ||
| 32 | + * @param record the record | ||
| 33 | + * @return insert count | ||
| 34 | + */ | ||
| 35 | + ResultJson insertSelective(LandRoadTrailerRecord record); | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * select by primary key | ||
| 39 | + * | ||
| 40 | + * @param id primary key | ||
| 41 | + * @return object by primary key | ||
| 42 | + */ | ||
| 43 | + LandRoadTrailerRecord selectByPrimaryKey(String id); | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * update record selective | ||
| 47 | + * | ||
| 48 | + * @param record the updated record | ||
| 49 | + * @return update count | ||
| 50 | + */ | ||
| 51 | + ResultJson updateByPrimaryKeySelective(LandRoadTrailerRecord record); | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * update record | ||
| 55 | + * | ||
| 56 | + * @param record the updated record | ||
| 57 | + * @return update count | ||
| 58 | + */ | ||
| 59 | + int updateByPrimaryKey(LandRoadTrailerRecord record); | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 分页查询,挂车信息列表 | ||
| 63 | + * | ||
| 64 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 65 | + * @param pageNum 当前页数 | ||
| 66 | + * @param pageSize 每页大小 | ||
| 67 | + * @return | ||
| 68 | + */ | ||
| 69 | + ResultJson selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord, Integer pageNum, Integer pageSize); | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 批量删除车辆信息 | ||
| 73 | + * | ||
| 74 | + * @param ids 被删除的id,多个以,相隔的字符串 | ||
| 75 | + * @return | ||
| 76 | + */ | ||
| 77 | + ResultJson batchRemoveByIds(String ids); | ||
| 78 | +} |
src/main/java/com/sunyo/wlpt/vehicle/manage/service/impl/LandRoadTrailerRecordServiceImpl.java
0 → 100644
| 1 | +package com.sunyo.wlpt.vehicle.manage.service.impl; | ||
| 2 | + | ||
| 3 | +import com.github.pagehelper.PageHelper; | ||
| 4 | +import com.github.pagehelper.PageInfo; | ||
| 5 | +import com.sunyo.wlpt.vehicle.manage.common.Common; | ||
| 6 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord; | ||
| 7 | +import com.sunyo.wlpt.vehicle.manage.response.ResultJson; | ||
| 8 | +import com.sunyo.wlpt.vehicle.manage.utils.IdUtils; | ||
| 9 | +import io.netty.util.internal.StringUtil; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | + | ||
| 12 | +import javax.annotation.Resource; | ||
| 13 | + | ||
| 14 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord; | ||
| 15 | +import com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper; | ||
| 16 | +import com.sunyo.wlpt.vehicle.manage.service.LandRoadTrailerRecordService; | ||
| 17 | + | ||
| 18 | +import java.util.List; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * @author 子诚 | ||
| 22 | + * Description: | ||
| 23 | + * 时间:2020/9/23 15:17 | ||
| 24 | + */ | ||
| 25 | +@Service | ||
| 26 | +public class LandRoadTrailerRecordServiceImpl implements LandRoadTrailerRecordService { | ||
| 27 | + | ||
| 28 | + @Resource | ||
| 29 | + private LandRoadTrailerRecordMapper landRoadTrailerRecordMapper; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 删除 | ||
| 33 | + * | ||
| 34 | + * @param id primaryKey | ||
| 35 | + * @return | ||
| 36 | + */ | ||
| 37 | + @Override | ||
| 38 | + public ResultJson deleteByPrimaryKey(String id) | ||
| 39 | + { | ||
| 40 | + return landRoadTrailerRecordMapper.deleteByPrimaryKey(id) > 0 | ||
| 41 | + ? ResultJson.success("200", "删除挂车信息,成功") | ||
| 42 | + : ResultJson.error("500", "删除挂车信息失败"); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 批量删除 | ||
| 47 | + * | ||
| 48 | + * @param ids 被删除的id,多个以,相隔的字符串 | ||
| 49 | + * @return | ||
| 50 | + */ | ||
| 51 | + @Override | ||
| 52 | + public ResultJson batchRemoveByIds(String ids) | ||
| 53 | + { | ||
| 54 | + String[] idList = ids.split(","); | ||
| 55 | + return landRoadTrailerRecordMapper.batchRemoveByIds(idList) > 0 | ||
| 56 | + ? ResultJson.success("200", "批量删除挂车信息,成功") | ||
| 57 | + : ResultJson.error("500", "批量删除挂车信息,失败"); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + public int insert(LandRoadTrailerRecord record) | ||
| 62 | + { | ||
| 63 | + return landRoadTrailerRecordMapper.insert(record); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 选择性新增 | ||
| 68 | + * | ||
| 69 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 70 | + * @return | ||
| 71 | + */ | ||
| 72 | + @Override | ||
| 73 | + public ResultJson insertSelective(LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 74 | + { | ||
| 75 | + ResultJson validate = validate(landRoadTrailerRecord); | ||
| 76 | + if (!Common.RESULT_SUCCESS.equals(validate.getCode())) { | ||
| 77 | + return validate; | ||
| 78 | + } | ||
| 79 | + landRoadTrailerRecord.setId(IdUtils.generateId()); | ||
| 80 | + return landRoadTrailerRecordMapper.insertSelective(landRoadTrailerRecord) > 0 | ||
| 81 | + ? ResultJson.success("200", "新增挂车信息,成功") | ||
| 82 | + : ResultJson.error("500", "新增挂车信息失败"); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * 查询,根据主键 | ||
| 87 | + * | ||
| 88 | + * @param id primary key | ||
| 89 | + * @return | ||
| 90 | + */ | ||
| 91 | + @Override | ||
| 92 | + public LandRoadTrailerRecord selectByPrimaryKey(String id) | ||
| 93 | + { | ||
| 94 | + return landRoadTrailerRecordMapper.selectByPrimaryKey(id); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 选择性编辑 | ||
| 99 | + * | ||
| 100 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 101 | + * @return | ||
| 102 | + */ | ||
| 103 | + @Override | ||
| 104 | + public ResultJson updateByPrimaryKeySelective(LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 105 | + { | ||
| 106 | + ResultJson validate = validate(landRoadTrailerRecord); | ||
| 107 | + if (!Common.RESULT_SUCCESS.equals(validate.getCode())) { | ||
| 108 | + return validate; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + return landRoadTrailerRecordMapper.updateByPrimaryKeySelective(landRoadTrailerRecord) > 0 | ||
| 112 | + ? ResultJson.success("200", "编辑挂车信息,成功") | ||
| 113 | + : ResultJson.error("500", "编辑挂车信息,失败"); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @Override | ||
| 117 | + public int updateByPrimaryKey(LandRoadTrailerRecord record) | ||
| 118 | + { | ||
| 119 | + return landRoadTrailerRecordMapper.updateByPrimaryKey(record); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * 分页查询,挂车信息列表 | ||
| 124 | + * | ||
| 125 | + * @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord} | ||
| 126 | + * @param pageNum 当前页数 | ||
| 127 | + * @param pageSize 每页大小 | ||
| 128 | + * @return | ||
| 129 | + */ | ||
| 130 | + @Override | ||
| 131 | + public ResultJson selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord, Integer pageNum, Integer pageSize) | ||
| 132 | + { | ||
| 133 | + PageHelper.startPage(pageNum, pageSize); | ||
| 134 | + List<LandRoadTrailerRecord> landRoadTrailerRecordList = landRoadTrailerRecordMapper.selectListByPage(landRoadTrailerRecord); | ||
| 135 | + PageInfo<LandRoadTrailerRecord> pageInfo = new PageInfo<>(landRoadTrailerRecordList); | ||
| 136 | + return pageInfo.getTotal() >= 0 | ||
| 137 | + ? ResultJson.success("200", "查询挂车信息列表,成功!", pageInfo) | ||
| 138 | + : ResultJson.error("500", "查询挂车信息列表,失败!"); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + /** | ||
| 143 | + * 新增 or 编辑 | ||
| 144 | + * 校验,挂车车牌号,是否唯一 | ||
| 145 | + * | ||
| 146 | + * @param landRoadTrailerRecord {@link LandRoadTrailerRecord} | ||
| 147 | + * @return | ||
| 148 | + */ | ||
| 149 | + private ResultJson validate(LandRoadTrailerRecord landRoadTrailerRecord) | ||
| 150 | + { | ||
| 151 | + String id = landRoadTrailerRecord.getId(); | ||
| 152 | + String trailerLicenseNo = landRoadTrailerRecord.getTrailerLicenseNo(); | ||
| 153 | + | ||
| 154 | + if (StringUtil.isNullOrEmpty(trailerLicenseNo)) { | ||
| 155 | + return ResultJson.error("400", "挂车车牌号,不能为空!"); | ||
| 156 | + } | ||
| 157 | + return StringUtil.isNullOrEmpty(id) ? validateInsert(trailerLicenseNo) : validateEdit(id, trailerLicenseNo); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + /** | ||
| 161 | + * 校验编辑时,挂车车牌号,是否唯一 | ||
| 162 | + * | ||
| 163 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 164 | + * @return | ||
| 165 | + */ | ||
| 166 | + private ResultJson validateEdit(String id, String trailerLicenseNo) | ||
| 167 | + { | ||
| 168 | + LandRoadTrailerRecord oldInfo = landRoadTrailerRecordMapper.selectByPrimaryKey(id); | ||
| 169 | + if (oldInfo == null) { | ||
| 170 | + return ResultJson.error("400", "该挂车信息不存在,请仔细检查"); | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + if (!trailerLicenseNo.equals(oldInfo.getTrailerLicenseNo())) { | ||
| 174 | + if (landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) { | ||
| 175 | + return ResultJson.error("400", "该挂车信息(车牌号),已存在"); | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + return ResultJson.success("校验通过"); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + /** | ||
| 182 | + * 校验新增时,挂车车牌号,是否唯一 | ||
| 183 | + * | ||
| 184 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 185 | + * @return | ||
| 186 | + */ | ||
| 187 | + private ResultJson validateInsert(String trailerLicenseNo) | ||
| 188 | + { | ||
| 189 | + return landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0 | ||
| 190 | + ? ResultJson.error("400", "该挂车信息(车牌号),已存在") | ||
| 191 | + : ResultJson.success("校验通过"); | ||
| 192 | + } | ||
| 193 | +} |
| @@ -3,6 +3,8 @@ package com.sunyo.wlpt.vehicle.manage.service.impl; | @@ -3,6 +3,8 @@ package com.sunyo.wlpt.vehicle.manage.service.impl; | ||
| 3 | import com.github.pagehelper.PageHelper; | 3 | import com.github.pagehelper.PageHelper; |
| 4 | import com.github.pagehelper.PageInfo; | 4 | import com.github.pagehelper.PageInfo; |
| 5 | import com.sunyo.wlpt.vehicle.manage.common.Common; | 5 | import com.sunyo.wlpt.vehicle.manage.common.Common; |
| 6 | +import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord; | ||
| 7 | +import com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper; | ||
| 6 | import com.sunyo.wlpt.vehicle.manage.response.ResultJson; | 8 | import com.sunyo.wlpt.vehicle.manage.response.ResultJson; |
| 7 | import com.sunyo.wlpt.vehicle.manage.utils.IdUtils; | 9 | import com.sunyo.wlpt.vehicle.manage.utils.IdUtils; |
| 8 | import io.netty.util.internal.StringUtil; | 10 | import io.netty.util.internal.StringUtil; |
| @@ -27,12 +29,15 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -27,12 +29,15 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 27 | @Resource | 29 | @Resource |
| 28 | private LandRoadVeRecordMapper landRoadVeRecordMapper; | 30 | private LandRoadVeRecordMapper landRoadVeRecordMapper; |
| 29 | 31 | ||
| 32 | + @Resource | ||
| 33 | + private LandRoadTrailerRecordMapper landRoadTrailerRecordMapper; | ||
| 34 | + | ||
| 30 | @Override | 35 | @Override |
| 31 | public ResultJson deleteByPrimaryKey(String id) | 36 | public ResultJson deleteByPrimaryKey(String id) |
| 32 | { | 37 | { |
| 33 | return landRoadVeRecordMapper.deleteByPrimaryKey(id) > 0 | 38 | return landRoadVeRecordMapper.deleteByPrimaryKey(id) > 0 |
| 34 | - ? new ResultJson<>("200", "删除车辆信息,成功!") | ||
| 35 | - : new ResultJson<>("500", "删除车辆信息,失败!"); | 39 | + ? ResultJson.success("200", "删除车辆信息,成功!") |
| 40 | + : ResultJson.error("500", "删除车辆信息,失败!"); | ||
| 36 | } | 41 | } |
| 37 | 42 | ||
| 38 | /** | 43 | /** |
| @@ -46,8 +51,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -46,8 +51,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 46 | { | 51 | { |
| 47 | String[] idList = ids.split(","); | 52 | String[] idList = ids.split(","); |
| 48 | return landRoadVeRecordMapper.batchRemoveByIds(idList) > 0 | 53 | return landRoadVeRecordMapper.batchRemoveByIds(idList) > 0 |
| 49 | - ? new ResultJson<>("200", "批量删除车辆信息,成功") | ||
| 50 | - : new ResultJson<>("500", "批量删除车辆信息,失败"); | 54 | + ? ResultJson.success("200", "批量删除车辆信息,成功") |
| 55 | + : ResultJson.error("500", "批量删除车辆信息,失败"); | ||
| 51 | } | 56 | } |
| 52 | 57 | ||
| 53 | @Override | 58 | @Override |
| @@ -65,14 +70,14 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -65,14 +70,14 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 65 | @Override | 70 | @Override |
| 66 | public ResultJson insertSelective(LandRoadVeRecord record) | 71 | public ResultJson insertSelective(LandRoadVeRecord record) |
| 67 | { | 72 | { |
| 68 | - ResultJson validateAdd = validate(record); | ||
| 69 | - if (!Common.RESULT_SUCCESS.equals(validateAdd.getCode())) { | ||
| 70 | - return validateAdd; | 73 | + ResultJson validateInsert = validate(record); |
| 74 | + if (!Common.RESULT_SUCCESS.equals(validateInsert.getCode())) { | ||
| 75 | + return validateInsert; | ||
| 71 | } | 76 | } |
| 72 | record.setId(IdUtils.generateId()); | 77 | record.setId(IdUtils.generateId()); |
| 73 | return landRoadVeRecordMapper.insertSelective(record) > 0 | 78 | return landRoadVeRecordMapper.insertSelective(record) > 0 |
| 74 | - ? new ResultJson<>("200", "添加车辆信息,成功") | ||
| 75 | - : new ResultJson<>("500", "添加车辆信息,失败"); | 79 | + ? ResultJson.success("200", "添加车辆信息,成功") |
| 80 | + : ResultJson.error("500", "添加车辆信息,失败"); | ||
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | @Override | 83 | @Override |
| @@ -95,8 +100,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -95,8 +100,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 95 | return validateEdit; | 100 | return validateEdit; |
| 96 | } | 101 | } |
| 97 | return landRoadVeRecordMapper.updateByPrimaryKeySelective(record) > 0 | 102 | return landRoadVeRecordMapper.updateByPrimaryKeySelective(record) > 0 |
| 98 | - ? new ResultJson<>("200", "编辑车辆信息,成功") | ||
| 99 | - : new ResultJson<>("500", "编辑车辆信息,失败"); | 103 | + ? ResultJson.success("200", "编辑车辆信息,成功") |
| 104 | + : ResultJson.error("500", "编辑车辆信息,失败"); | ||
| 100 | } | 105 | } |
| 101 | 106 | ||
| 102 | @Override | 107 | @Override |
| @@ -120,8 +125,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -120,8 +125,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 120 | List<LandRoadVeRecord> landRoadVeRecordList = landRoadVeRecordMapper.selectListByPage(landRoadVeRecord); | 125 | List<LandRoadVeRecord> landRoadVeRecordList = landRoadVeRecordMapper.selectListByPage(landRoadVeRecord); |
| 121 | PageInfo<LandRoadVeRecord> pageInfo = new PageInfo<>(landRoadVeRecordList); | 126 | PageInfo<LandRoadVeRecord> pageInfo = new PageInfo<>(landRoadVeRecordList); |
| 122 | return pageInfo.getTotal() >= 0 | 127 | return pageInfo.getTotal() >= 0 |
| 123 | - ? new ResultJson<>("200", "查询车辆信息列表,成功!", pageInfo) | ||
| 124 | - : new ResultJson<>("500", "查询车辆信息列表,失败!"); | 128 | + ? ResultJson.success("200", "查询车辆信息列表,成功!", pageInfo) |
| 129 | + : ResultJson.error("500", "查询车辆信息列表,失败!"); | ||
| 125 | } | 130 | } |
| 126 | 131 | ||
| 127 | /** | 132 | /** |
| @@ -135,47 +140,74 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | @@ -135,47 +140,74 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService { | ||
| 135 | { | 140 | { |
| 136 | String id = landRoadVeRecord.getId(); | 141 | String id = landRoadVeRecord.getId(); |
| 137 | String domesticLisenceNo = landRoadVeRecord.getDomesticLisenceNo(); | 142 | String domesticLisenceNo = landRoadVeRecord.getDomesticLisenceNo(); |
| 143 | + String trailerLicenseNo = landRoadVeRecord.getTrailerLicenseNo(); | ||
| 138 | 144 | ||
| 139 | if (StringUtil.isNullOrEmpty(domesticLisenceNo)) { | 145 | if (StringUtil.isNullOrEmpty(domesticLisenceNo)) { |
| 140 | - return new ResultJson<>("400", "国内车牌号,不能为空!"); | 146 | + return ResultJson.error("400", "国内车牌号,不能为空!"); |
| 141 | } | 147 | } |
| 142 | - return StringUtil.isNullOrEmpty(id) ? validateInsert(domesticLisenceNo) : validateEdit(id, domesticLisenceNo); | 148 | + return StringUtil.isNullOrEmpty(id) ? validateInsert(domesticLisenceNo, trailerLicenseNo) : validateEdit(id, domesticLisenceNo, trailerLicenseNo); |
| 143 | } | 149 | } |
| 144 | 150 | ||
| 145 | /** | 151 | /** |
| 146 | * 编辑,检验 | 152 | * 编辑,检验 |
| 153 | + * <p> | ||
| 154 | + * 校验挂车逻辑: | ||
| 155 | + * 1、编辑前,没有挂车,校验编辑后的挂车牌号,是否存在?是否已用? | ||
| 156 | + * 2、编辑前,有挂车,校验编辑前后的挂车牌号,不相同时,编辑后得挂车牌号是否存在?是否已用? | ||
| 157 | + * <p> | ||
| 158 | + * 校验,国内车牌号,是否唯一 | ||
| 147 | * | 159 | * |
| 148 | * @param id 主键 | 160 | * @param id 主键 |
| 149 | * @param domesticLisenceNo 国内车牌号 | 161 | * @param domesticLisenceNo 国内车牌号 |
| 162 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 150 | * @return | 163 | * @return |
| 151 | */ | 164 | */ |
| 152 | - private ResultJson validateEdit(String id, String domesticLisenceNo) | 165 | + private ResultJson validateEdit(String id, String domesticLisenceNo, String trailerLicenseNo) |
| 153 | { | 166 | { |
| 154 | - LandRoadVeRecord oldVe = landRoadVeRecordMapper.selectByDomesticLisenceNo(id); | 167 | + LandRoadVeRecord oldVe = landRoadVeRecordMapper.selectByPrimaryKey(id); |
| 155 | if (oldVe == null) { | 168 | if (oldVe == null) { |
| 156 | - return new ResultJson<>("400", "该车辆信息不存在"); | 169 | + return ResultJson.error("400", "该车辆信息不存在,请仔细检查"); |
| 170 | + } | ||
| 171 | + if (!StringUtil.isNullOrEmpty(trailerLicenseNo) && landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) { | ||
| 172 | + | ||
| 173 | + boolean flag = !StringUtil.isNullOrEmpty(oldVe.getTrailerLicenseNo()) | ||
| 174 | + && !trailerLicenseNo.equals(oldVe.getTrailerLicenseNo()); | ||
| 175 | + | ||
| 176 | + if (StringUtil.isNullOrEmpty(oldVe.getTrailerLicenseNo()) || flag) { | ||
| 177 | + if (landRoadVeRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) { | ||
| 178 | + return ResultJson.error("400", "该挂车已经被使用,请仔细检查"); | ||
| 179 | + } | ||
| 180 | + } | ||
| 157 | } | 181 | } |
| 158 | if (!domesticLisenceNo.equals(oldVe.getDomesticLisenceNo())) { | 182 | if (!domesticLisenceNo.equals(oldVe.getDomesticLisenceNo())) { |
| 159 | - if (landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo) != null) { | ||
| 160 | - return new ResultJson<>("400", "该车辆信息,已存在"); | 183 | + if (landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo).size() > 0) { |
| 184 | + return ResultJson.error("400", "该车辆信息(车牌号),已存在"); | ||
| 161 | } | 185 | } |
| 162 | } | 186 | } |
| 163 | return ResultJson.success("校验通过"); | 187 | return ResultJson.success("校验通过"); |
| 164 | } | 188 | } |
| 165 | 189 | ||
| 166 | /** | 190 | /** |
| 167 | - * 新增,校验 | ||
| 168 | - * 国内车牌号,是否存在 | 191 | + * 新增校验 |
| 192 | + * <p> | ||
| 193 | + * 校验是否挂车,挂车是否存在,挂车是否可用 | ||
| 194 | + * <p> | ||
| 195 | + * 校验国内车牌号,是否唯一 | ||
| 169 | * | 196 | * |
| 170 | * @param domesticLisenceNo 国内车牌号 | 197 | * @param domesticLisenceNo 国内车牌号 |
| 198 | + * @param trailerLicenseNo 挂车车牌号 | ||
| 171 | * @return | 199 | * @return |
| 172 | */ | 200 | */ |
| 173 | - private ResultJson validateInsert(String domesticLisenceNo) | 201 | + private ResultJson validateInsert(String domesticLisenceNo, String trailerLicenseNo) |
| 174 | { | 202 | { |
| 175 | - LandRoadVeRecord landRoadVeRecord = landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo); | ||
| 176 | - if (landRoadVeRecord == null) { | ||
| 177 | - ResultJson.error("400", "校验失败"); | 203 | + if (!StringUtil.isNullOrEmpty(trailerLicenseNo) |
| 204 | + && landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) { | ||
| 205 | + if (landRoadVeRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) { | ||
| 206 | + return ResultJson.error("400", "该挂车已经被使用,请仔细检查"); | ||
| 207 | + } | ||
| 178 | } | 208 | } |
| 179 | - return ResultJson.success("校验通过"); | 209 | + return landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo).size() > 0 |
| 210 | + ? ResultJson.error("400", "校验失败,该国内车牌号已存在") | ||
| 211 | + : ResultJson.success("校验通过"); | ||
| 180 | } | 212 | } |
| 181 | } | 213 | } |
| 1 | - |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper"> | ||
| 4 | + <cache type="com.sunyo.wlpt.vehicle.manage.cache.RedisCache"/> | ||
| 5 | +<!-- <cache-ref namespace="com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper"/>--> | ||
| 6 | + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord"> | ||
| 7 | + <!--@mbg.generated--> | ||
| 8 | + <!--@Table land_road_trailer_record--> | ||
| 9 | + <id column="ID" jdbcType="VARCHAR" property="id"/> | ||
| 10 | + <result column="EPORT_ID" jdbcType="VARCHAR" property="eportId"/> | ||
| 11 | + <result column="MAIN_PORT" jdbcType="VARCHAR" property="mainPort"/> | ||
| 12 | + <result column="TRAILER_LICENSE_NO" jdbcType="VARCHAR" property="trailerLicenseNo"/> | ||
| 13 | + <result column="TRAILER_REG_PLACE" jdbcType="VARCHAR" property="trailerRegPlace"/> | ||
| 14 | + <result column="FRAME_NO" jdbcType="VARCHAR" property="frameNo"/> | ||
| 15 | + <result column="TRAILER_WT" jdbcType="VARCHAR" property="trailerWt"/> | ||
| 16 | + <result column="TRAILER_COLOR" jdbcType="VARCHAR" property="trailerColor"/> | ||
| 17 | + <result column="VE_CON_PIC" jdbcType="VARCHAR" property="veConPic"/> | ||
| 18 | + <result column="PROPOSER" jdbcType="VARCHAR" property="proposer"/> | ||
| 19 | + <result column="PROPOSE_TIME" jdbcType="TIMESTAMP" property="proposeTime"/> | ||
| 20 | + <result column="TRAILER_CLASS_FLAG" jdbcType="VARCHAR" property="trailerClassFlag"/> | ||
| 21 | + <result column="OPERATION_TYPE" jdbcType="VARCHAR" property="operationType"/> | ||
| 22 | + <result column="TRAILER_LICENSE_NO_PIC" jdbcType="VARCHAR" property="trailerLicenseNoPic"/> | ||
| 23 | + <result column="RETURNMESSAGE" jdbcType="VARCHAR" property="returnmessage"/> | ||
| 24 | + <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy"/> | ||
| 25 | + <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate"/> | ||
| 26 | + <result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy"/> | ||
| 27 | + <result column="UPDATE_DATE" jdbcType="TIMESTAMP" property="updateDate"/> | ||
| 28 | + </resultMap> | ||
| 29 | + <sql id="Base_Column_List"> | ||
| 30 | + <!--@mbg.generated--> | ||
| 31 | + ID, EPORT_ID, MAIN_PORT, TRAILER_LICENSE_NO, TRAILER_REG_PLACE, FRAME_NO, TRAILER_WT, | ||
| 32 | + TRAILER_COLOR, VE_CON_PIC, PROPOSER, PROPOSE_TIME, TRAILER_CLASS_FLAG, OPERATION_TYPE, | ||
| 33 | + TRAILER_LICENSE_NO_PIC, RETURNMESSAGE, CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE | ||
| 34 | + </sql> | ||
| 35 | + | ||
| 36 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 37 | + <!--@mbg.generated--> | ||
| 38 | + select | ||
| 39 | + <include refid="Base_Column_List"/> | ||
| 40 | + from land_road_trailer_record | ||
| 41 | + where ID = #{id,jdbcType=VARCHAR} | ||
| 42 | + </select> | ||
| 43 | + | ||
| 44 | + <!-- 用于分页查询 --> | ||
| 45 | + <select id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord" resultMap="BaseResultMap"> | ||
| 46 | + select | ||
| 47 | + <include refid="Base_Column_List"/> | ||
| 48 | + from land_road_trailer_record | ||
| 49 | + <where> | ||
| 50 | + <!-- 挂车车牌号 --> | ||
| 51 | + <if test="trailerLicenseNo != null and trailerLicenseNo != ''"> | ||
| 52 | + TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR} | ||
| 53 | + </if> | ||
| 54 | + </where> | ||
| 55 | + </select> | ||
| 56 | + | ||
| 57 | + <!-- 用于查询车牌号,是否唯一? --> | ||
| 58 | + <select id="selectByTrailerLicenseNo" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 59 | + select | ||
| 60 | + <include refid="Base_Column_List"/> | ||
| 61 | + from land_road_trailer_record | ||
| 62 | + where TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR} | ||
| 63 | + </select> | ||
| 64 | + | ||
| 65 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
| 66 | + <!--@mbg.generated--> | ||
| 67 | + delete | ||
| 68 | + from land_road_trailer_record | ||
| 69 | + where ID = #{id,jdbcType=VARCHAR} | ||
| 70 | + </delete> | ||
| 71 | + | ||
| 72 | + <delete id="batchRemoveByIds" parameterType="java.lang.String"> | ||
| 73 | + <!--@mbg.generated--> | ||
| 74 | + delete | ||
| 75 | + from land_road_trailer_record | ||
| 76 | + where ID in | ||
| 77 | + <foreach collection="array" open="(" close=")" separator="," item="id"> | ||
| 78 | + #{id,jdbcType=VARCHAR} | ||
| 79 | + </foreach> | ||
| 80 | + </delete> | ||
| 81 | + | ||
| 82 | + <insert id="insert" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord"> | ||
| 83 | + <!--@mbg.generated--> | ||
| 84 | + insert into land_road_trailer_record (ID, EPORT_ID, MAIN_PORT, | ||
| 85 | + TRAILER_LICENSE_NO, TRAILER_REG_PLACE, FRAME_NO, | ||
| 86 | + TRAILER_WT, TRAILER_COLOR, VE_CON_PIC, | ||
| 87 | + PROPOSER, PROPOSE_TIME, TRAILER_CLASS_FLAG, | ||
| 88 | + OPERATION_TYPE, TRAILER_LICENSE_NO_PIC, RETURNMESSAGE, | ||
| 89 | + CREATE_BY, CREATE_DATE, UPDATE_BY, | ||
| 90 | + UPDATE_DATE) | ||
| 91 | + values (#{id,jdbcType=VARCHAR}, #{eportId,jdbcType=VARCHAR}, #{mainPort,jdbcType=VARCHAR}, | ||
| 92 | + #{trailerLicenseNo,jdbcType=VARCHAR}, #{trailerRegPlace,jdbcType=VARCHAR}, #{frameNo,jdbcType=VARCHAR}, | ||
| 93 | + #{trailerWt,jdbcType=VARCHAR}, #{trailerColor,jdbcType=VARCHAR}, #{veConPic,jdbcType=VARCHAR}, | ||
| 94 | + #{proposer,jdbcType=VARCHAR}, #{proposeTime,jdbcType=TIMESTAMP}, #{trailerClassFlag,jdbcType=VARCHAR}, | ||
| 95 | + #{operationType,jdbcType=VARCHAR}, #{trailerLicenseNoPic,jdbcType=VARCHAR}, #{returnmessage,jdbcType=VARCHAR}, | ||
| 96 | + #{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, | ||
| 97 | + #{updateDate,jdbcType=TIMESTAMP}) | ||
| 98 | + </insert> | ||
| 99 | + | ||
| 100 | + <insert id="insertSelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord"> | ||
| 101 | + <!--@mbg.generated--> | ||
| 102 | + insert into land_road_trailer_record | ||
| 103 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 104 | + <if test="id != null"> | ||
| 105 | + ID, | ||
| 106 | + </if> | ||
| 107 | + <if test="eportId != null"> | ||
| 108 | + EPORT_ID, | ||
| 109 | + </if> | ||
| 110 | + <if test="mainPort != null"> | ||
| 111 | + MAIN_PORT, | ||
| 112 | + </if> | ||
| 113 | + <if test="trailerLicenseNo != null"> | ||
| 114 | + TRAILER_LICENSE_NO, | ||
| 115 | + </if> | ||
| 116 | + <if test="trailerRegPlace != null"> | ||
| 117 | + TRAILER_REG_PLACE, | ||
| 118 | + </if> | ||
| 119 | + <if test="frameNo != null"> | ||
| 120 | + FRAME_NO, | ||
| 121 | + </if> | ||
| 122 | + <if test="trailerWt != null"> | ||
| 123 | + TRAILER_WT, | ||
| 124 | + </if> | ||
| 125 | + <if test="trailerColor != null"> | ||
| 126 | + TRAILER_COLOR, | ||
| 127 | + </if> | ||
| 128 | + <if test="veConPic != null"> | ||
| 129 | + VE_CON_PIC, | ||
| 130 | + </if> | ||
| 131 | + <if test="proposer != null"> | ||
| 132 | + PROPOSER, | ||
| 133 | + </if> | ||
| 134 | + <if test="proposeTime != null"> | ||
| 135 | + PROPOSE_TIME, | ||
| 136 | + </if> | ||
| 137 | + <if test="trailerClassFlag != null"> | ||
| 138 | + TRAILER_CLASS_FLAG, | ||
| 139 | + </if> | ||
| 140 | + <if test="operationType != null"> | ||
| 141 | + OPERATION_TYPE, | ||
| 142 | + </if> | ||
| 143 | + <if test="trailerLicenseNoPic != null"> | ||
| 144 | + TRAILER_LICENSE_NO_PIC, | ||
| 145 | + </if> | ||
| 146 | + <if test="returnmessage != null"> | ||
| 147 | + RETURNMESSAGE, | ||
| 148 | + </if> | ||
| 149 | + <if test="createBy != null"> | ||
| 150 | + CREATE_BY, | ||
| 151 | + </if> | ||
| 152 | + <if test="createDate != null"> | ||
| 153 | + CREATE_DATE, | ||
| 154 | + </if> | ||
| 155 | + <if test="updateBy != null"> | ||
| 156 | + UPDATE_BY, | ||
| 157 | + </if> | ||
| 158 | + <if test="updateDate != null"> | ||
| 159 | + UPDATE_DATE, | ||
| 160 | + </if> | ||
| 161 | + </trim> | ||
| 162 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 163 | + <if test="id != null"> | ||
| 164 | + #{id,jdbcType=VARCHAR}, | ||
| 165 | + </if> | ||
| 166 | + <if test="eportId != null"> | ||
| 167 | + #{eportId,jdbcType=VARCHAR}, | ||
| 168 | + </if> | ||
| 169 | + <if test="mainPort != null"> | ||
| 170 | + #{mainPort,jdbcType=VARCHAR}, | ||
| 171 | + </if> | ||
| 172 | + <if test="trailerLicenseNo != null"> | ||
| 173 | + #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 174 | + </if> | ||
| 175 | + <if test="trailerRegPlace != null"> | ||
| 176 | + #{trailerRegPlace,jdbcType=VARCHAR}, | ||
| 177 | + </if> | ||
| 178 | + <if test="frameNo != null"> | ||
| 179 | + #{frameNo,jdbcType=VARCHAR}, | ||
| 180 | + </if> | ||
| 181 | + <if test="trailerWt != null"> | ||
| 182 | + #{trailerWt,jdbcType=VARCHAR}, | ||
| 183 | + </if> | ||
| 184 | + <if test="trailerColor != null"> | ||
| 185 | + #{trailerColor,jdbcType=VARCHAR}, | ||
| 186 | + </if> | ||
| 187 | + <if test="veConPic != null"> | ||
| 188 | + #{veConPic,jdbcType=VARCHAR}, | ||
| 189 | + </if> | ||
| 190 | + <if test="proposer != null"> | ||
| 191 | + #{proposer,jdbcType=VARCHAR}, | ||
| 192 | + </if> | ||
| 193 | + <if test="proposeTime != null"> | ||
| 194 | + #{proposeTime,jdbcType=TIMESTAMP}, | ||
| 195 | + </if> | ||
| 196 | + <if test="trailerClassFlag != null"> | ||
| 197 | + #{trailerClassFlag,jdbcType=VARCHAR}, | ||
| 198 | + </if> | ||
| 199 | + <if test="operationType != null"> | ||
| 200 | + #{operationType,jdbcType=VARCHAR}, | ||
| 201 | + </if> | ||
| 202 | + <if test="trailerLicenseNoPic != null"> | ||
| 203 | + #{trailerLicenseNoPic,jdbcType=VARCHAR}, | ||
| 204 | + </if> | ||
| 205 | + <if test="returnmessage != null"> | ||
| 206 | + #{returnmessage,jdbcType=VARCHAR}, | ||
| 207 | + </if> | ||
| 208 | + <if test="createBy != null"> | ||
| 209 | + #{createBy,jdbcType=VARCHAR}, | ||
| 210 | + </if> | ||
| 211 | + <if test="createDate != null"> | ||
| 212 | + #{createDate,jdbcType=TIMESTAMP}, | ||
| 213 | + </if> | ||
| 214 | + <if test="updateBy != null"> | ||
| 215 | + #{updateBy,jdbcType=VARCHAR}, | ||
| 216 | + </if> | ||
| 217 | + <if test="updateDate != null"> | ||
| 218 | + #{updateDate,jdbcType=TIMESTAMP}, | ||
| 219 | + </if> | ||
| 220 | + </trim> | ||
| 221 | + </insert> | ||
| 222 | + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord"> | ||
| 223 | + <!--@mbg.generated--> | ||
| 224 | + update land_road_trailer_record | ||
| 225 | + <set> | ||
| 226 | + <if test="eportId != null"> | ||
| 227 | + EPORT_ID = #{eportId,jdbcType=VARCHAR}, | ||
| 228 | + </if> | ||
| 229 | + <if test="mainPort != null"> | ||
| 230 | + MAIN_PORT = #{mainPort,jdbcType=VARCHAR}, | ||
| 231 | + </if> | ||
| 232 | + <if test="trailerLicenseNo != null"> | ||
| 233 | + TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 234 | + </if> | ||
| 235 | + <if test="trailerRegPlace != null"> | ||
| 236 | + TRAILER_REG_PLACE = #{trailerRegPlace,jdbcType=VARCHAR}, | ||
| 237 | + </if> | ||
| 238 | + <if test="frameNo != null"> | ||
| 239 | + FRAME_NO = #{frameNo,jdbcType=VARCHAR}, | ||
| 240 | + </if> | ||
| 241 | + <if test="trailerWt != null"> | ||
| 242 | + TRAILER_WT = #{trailerWt,jdbcType=VARCHAR}, | ||
| 243 | + </if> | ||
| 244 | + <if test="trailerColor != null"> | ||
| 245 | + TRAILER_COLOR = #{trailerColor,jdbcType=VARCHAR}, | ||
| 246 | + </if> | ||
| 247 | + <if test="veConPic != null"> | ||
| 248 | + VE_CON_PIC = #{veConPic,jdbcType=VARCHAR}, | ||
| 249 | + </if> | ||
| 250 | + <if test="proposer != null"> | ||
| 251 | + PROPOSER = #{proposer,jdbcType=VARCHAR}, | ||
| 252 | + </if> | ||
| 253 | + <if test="proposeTime != null"> | ||
| 254 | + PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP}, | ||
| 255 | + </if> | ||
| 256 | + <if test="trailerClassFlag != null"> | ||
| 257 | + TRAILER_CLASS_FLAG = #{trailerClassFlag,jdbcType=VARCHAR}, | ||
| 258 | + </if> | ||
| 259 | + <if test="operationType != null"> | ||
| 260 | + OPERATION_TYPE = #{operationType,jdbcType=VARCHAR}, | ||
| 261 | + </if> | ||
| 262 | + <if test="trailerLicenseNoPic != null"> | ||
| 263 | + TRAILER_LICENSE_NO_PIC = #{trailerLicenseNoPic,jdbcType=VARCHAR}, | ||
| 264 | + </if> | ||
| 265 | + <if test="returnmessage != null"> | ||
| 266 | + RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR}, | ||
| 267 | + </if> | ||
| 268 | + <if test="createBy != null"> | ||
| 269 | + CREATE_BY = #{createBy,jdbcType=VARCHAR}, | ||
| 270 | + </if> | ||
| 271 | + <if test="createDate != null"> | ||
| 272 | + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, | ||
| 273 | + </if> | ||
| 274 | + <if test="updateBy != null"> | ||
| 275 | + UPDATE_BY = #{updateBy,jdbcType=VARCHAR}, | ||
| 276 | + </if> | ||
| 277 | + <if test="updateDate != null"> | ||
| 278 | + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, | ||
| 279 | + </if> | ||
| 280 | + </set> | ||
| 281 | + where ID = #{id,jdbcType=VARCHAR} | ||
| 282 | + </update> | ||
| 283 | + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord"> | ||
| 284 | + <!--@mbg.generated--> | ||
| 285 | + update land_road_trailer_record | ||
| 286 | + set EPORT_ID = #{eportId,jdbcType=VARCHAR}, | ||
| 287 | + MAIN_PORT = #{mainPort,jdbcType=VARCHAR}, | ||
| 288 | + TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 289 | + TRAILER_REG_PLACE = #{trailerRegPlace,jdbcType=VARCHAR}, | ||
| 290 | + FRAME_NO = #{frameNo,jdbcType=VARCHAR}, | ||
| 291 | + TRAILER_WT = #{trailerWt,jdbcType=VARCHAR}, | ||
| 292 | + TRAILER_COLOR = #{trailerColor,jdbcType=VARCHAR}, | ||
| 293 | + VE_CON_PIC = #{veConPic,jdbcType=VARCHAR}, | ||
| 294 | + PROPOSER = #{proposer,jdbcType=VARCHAR}, | ||
| 295 | + PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP}, | ||
| 296 | + TRAILER_CLASS_FLAG = #{trailerClassFlag,jdbcType=VARCHAR}, | ||
| 297 | + OPERATION_TYPE = #{operationType,jdbcType=VARCHAR}, | ||
| 298 | + TRAILER_LICENSE_NO_PIC = #{trailerLicenseNoPic,jdbcType=VARCHAR}, | ||
| 299 | + RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR}, | ||
| 300 | + CREATE_BY = #{createBy,jdbcType=VARCHAR}, | ||
| 301 | + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, | ||
| 302 | + UPDATE_BY = #{updateBy,jdbcType=VARCHAR}, | ||
| 303 | + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP} | ||
| 304 | + where ID = #{id,jdbcType=VARCHAR} | ||
| 305 | + </update> | ||
| 306 | +</mapper> |
| @@ -89,12 +89,12 @@ | @@ -89,12 +89,12 @@ | ||
| 89 | from land_road_ve_record | 89 | from land_road_ve_record |
| 90 | where ID = #{id,jdbcType=VARCHAR} | 90 | where ID = #{id,jdbcType=VARCHAR} |
| 91 | </select> | 91 | </select> |
| 92 | - <select id="selectByDomesticLisenceNo" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 93 | - select | 92 | + <select id="selectByDomesticLisenceNo" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| 93 | + select | ||
| 94 | <include refid="Base_Column_List"/> | 94 | <include refid="Base_Column_List"/> |
| 95 | from land_road_ve_record | 95 | from land_road_ve_record |
| 96 | where DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR} | 96 | where DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR} |
| 97 | -</select> | 97 | + </select> |
| 98 | <!-- 用于,分页查询 --> | 98 | <!-- 用于,分页查询 --> |
| 99 | <select id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord" resultMap="BaseResultMap"> | 99 | <select id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord" resultMap="BaseResultMap"> |
| 100 | select | 100 | select |
| @@ -115,6 +115,14 @@ | @@ -115,6 +115,14 @@ | ||
| 115 | </if> | 115 | </if> |
| 116 | </where> | 116 | </where> |
| 117 | </select> | 117 | </select> |
| 118 | + | ||
| 119 | + <select id="selectByTrailerLicenseNo" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 120 | + select | ||
| 121 | + <include refid="Base_Column_List"/> | ||
| 122 | + from land_road_ve_record | ||
| 123 | + where TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR} | ||
| 124 | + </select> | ||
| 125 | + | ||
| 118 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | 126 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
| 119 | <!--@mbg.generated--> | 127 | <!--@mbg.generated--> |
| 120 | delete | 128 | delete |
-
请 注册 或 登录 后发表评论