作者 王勇

车辆管理,挂车管理,初次提交

package com.sunyo.wlpt.vehicle.manage;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @author 子诚
*/
@EnableCaching
@SpringBootApplication
@MapperScan("com.sunyo.wlpt.vehicle.manage.mapper")
@EnableFeignClients
@EnableEurekaClient
@EnableTransactionManagement
public class VehicleManageApplication {
public static void main(String[] args)
{
... ...
package com.sunyo.wlpt.vehicle.manage.cache;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.cache.Cache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.util.DigestUtils;
... ... @@ -27,14 +26,10 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
* <p>
* 时间:2020/8/6 9:37
*/
@Slf4j
public class RedisCache implements Cache {
/**
* slf4j的日志记录器
*/
private static final Logger logger = LoggerFactory.getLogger(com.sunyo.wlpt.vehicle.manage.cache.RedisCache.class);
/**
* 用于事务性缓存操作的读写锁
*/
private static final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
... ... @@ -71,14 +66,20 @@ public class RedisCache implements Cache {
public void putObject(Object key, Object value)
{
RedisTemplate redisTemplate = getRedisTemplate();
// 使用redis的hash类型作为缓存存储模型
/**
* 使用redis的hash类型作为缓存存储模型
*/
redisTemplate.opsForHash().put(id.toString(), encryptionKey(key.toString()), value);
/**
* 根据业务的不同,设置不同的缓存时间,解决掉缓存雪崩
*/
if (id.equals("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper")) {
// 车辆查询
if ("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper".equals(id)) {
// 车辆信息
redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES);
}
if ("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper".equals(id)) {
// 挂车信息
redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES);
} else {
// 其他,作为补充
... ... @@ -123,7 +124,7 @@ public class RedisCache implements Cache {
@Override
public void clear()
{
logger.info("清空->{}<-缓存", id);
log.info("清空->{}<-缓存", id);
RedisTemplate redisTemplate = getRedisTemplate();
// 清空 namespace
redisTemplate.delete(id.toString());
... ...
package com.sunyo.wlpt.vehicle.manage.controller;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
import com.sunyo.wlpt.vehicle.manage.service.LandRoadTrailerRecordService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author 子诚
* Description:挂车管理,控制器
* 时间:2020/9/23 15:25
*/
@CrossOrigin
@RequestMapping("trailer")
@RestController
public class LandRoadTrailerRecordController {
@Resource
private LandRoadTrailerRecordService landRoadTrailerRecordService;
/**
* 分页查询,挂车信息
*
* @param trailerLicenseNo 挂车车牌号
* @param pageNum 当前页
* @param pageSize 每页大小
* @return
*/
@GetMapping("/page")
public ResultJson selectListByPage(
@RequestParam(value = "trailerLicenseNo", required = false) String trailerLicenseNo,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize)
{
LandRoadTrailerRecord landRoadTrailerRecord = LandRoadTrailerRecord.builder().trailerLicenseNo(trailerLicenseNo).build();
return landRoadTrailerRecordService.selectListByPage(landRoadTrailerRecord, pageNum, pageSize);
}
/**
* 修改 or 编辑
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return 成功 or 失败
*/
@PutMapping("/update")
public ResultJson updateTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord)
{
return landRoadTrailerRecordService.updateByPrimaryKeySelective(landRoadTrailerRecord);
}
/**
* 新增
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return 成功 or 失败
*/
@PostMapping("/insert")
public ResultJson insertTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord)
{
return landRoadTrailerRecordService.insertSelective(landRoadTrailerRecord);
}
/**
* 删除
* 条件:id
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return
*/
@DeleteMapping("/delete")
public ResultJson deleteTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord)
{
return landRoadTrailerRecordService.deleteByPrimaryKey(landRoadTrailerRecord.getId());
}
/**
* 批量删除
* 条件:{id: id1,id2...}
*
* @param landRoadTrailerRecord 车辆信息 {@link LandRoadTrailerRecord}
* @return
*/
@DeleteMapping("/batchRemove")
public ResultJson batchRemoveTrailer(@RequestBody LandRoadTrailerRecord landRoadTrailerRecord)
{
String id = landRoadTrailerRecord.getId();
return id.contains(",") ? landRoadTrailerRecordService.batchRemoveByIds(id)
: landRoadTrailerRecordService.deleteByPrimaryKey(id);
}
}
... ...
... ... @@ -10,7 +10,7 @@ import javax.annotation.Resource;
/**
* @author 子诚
* Description:
* Description:车辆管理,控制器
* 时间:2020/9/22 17:58
*/
@CrossOrigin
... ... @@ -32,7 +32,7 @@ public class LandRoadVeRecordController {
* @return
*/
@GetMapping("/page")
public ResultJson selectBusExchangeList(
public ResultJson selectListByPage(
@RequestParam(value = "domesticLisenceNo", required = false) String domesticLisenceNo,
@RequestParam(value = "veType", required = false) String veType,
@RequestParam(value = "veState", required = false) String veState,
... ... @@ -47,13 +47,26 @@ public class LandRoadVeRecordController {
return landRoadVeRecordService.selectListByPage(landRoadVeRecord, pageNum, pageSize);
}
/**
* 删除
* 条件:id
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return
*/
@DeleteMapping("/delete")
public ResultJson deleteLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
return landRoadVeRecordService.deleteByPrimaryKey(landRoadVeRecord.getId());
}
/**
* 批量删除
* 条件:{id: id1,id2...}
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return
*/
@DeleteMapping("/batchRemove")
public ResultJson batchRemoveLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
... ... @@ -63,11 +76,24 @@ public class LandRoadVeRecordController {
: landRoadVeRecordService.deleteByPrimaryKey(id);
}
/**
* 新增
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return
*/
@PostMapping("/insert")
public ResultJson insertLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
return landRoadVeRecordService.insertSelective(landRoadVeRecord);
}
/**
* 修改 or 编辑
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return
*/
@PutMapping("/update")
public ResultJson updateLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
... ...
package com.sunyo.wlpt.vehicle.manage.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 子诚
* Description:挂车信息
* 时间:2020/9/23 15:17
*/
@ApiModel("挂车信息")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LandRoadTrailerRecord implements Serializable {
private static final long serialVersionUID = -7494420606904422510L;
@ApiModelProperty(value = "主键id")
private String id;
/**
* 电子口岸报文ID(电子口岸与海关数据传输使用,企业无需填写)
*/
@ApiModelProperty(value = "电子口岸报文ID(电子口岸与海关数据传输使用,企业无需填写)")
private String eportId;
/**
* 主管海关代码
*/
@ApiModelProperty(value = "主管海关代码")
private String mainPort;
/**
* 挂车牌号
*/
@ApiModelProperty(value = "挂车牌号")
private String trailerLicenseNo;
/**
* 挂车注册地
*/
@ApiModelProperty(value = "挂车注册地")
private String trailerRegPlace;
/**
* 车架号码
*/
@ApiModelProperty(value = "车架号码")
private String frameNo;
/**
* 挂车重量
*/
@ApiModelProperty(value = "挂车重量")
private String trailerWt;
/**
* 挂车颜色
*/
@ApiModelProperty(value = "挂车颜色")
private String trailerColor;
/**
* 车厢照片
*/
@ApiModelProperty(value = "车厢照片")
private String veConPic;
/**
* 申请人
*/
@ApiModelProperty(value = "申请人")
private String proposer;
/**
* 申请时间
*/
@ApiModelProperty(value = "申请时间")
private Date proposeTime;
/**
* 挂车备案类别:1是进出境挂车;2是来往港澳挂车
*/
@ApiModelProperty(value = "挂车备案类别:1是进出境挂车;2是来往港澳挂车")
private String trailerClassFlag;
/**
* 数据操作类型
*/
@ApiModelProperty(value = "数据操作类型")
private String operationType;
/**
* 挂车牌号图片
*/
@ApiModelProperty(value = "挂车牌号图片")
private String trailerLicenseNoPic;
/**
* 回执内容
*/
@ApiModelProperty(value = "回执内容")
private String returnmessage;
@ApiModelProperty(value = "被谁创建")
private String createBy;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "被谁修改")
private String updateBy;
@ApiModelProperty(value = "修改时间")
private Date updateDate;
}
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@ package com.sunyo.wlpt.vehicle.manage.exception;
* 时间:2020/7/17 16:43
*/
public class CustomException extends RuntimeException {
private static final long serialVersionUID = 6098063244016154220L;
/**
... ... @@ -18,22 +19,32 @@ public class CustomException extends RuntimeException {
*/
private String message;
public CustomException(CustomExceptionType exceptionTypeEnum, String message) {
public CustomException(CustomExceptionType exceptionTypeEnum, String message)
{
this.code = exceptionTypeEnum.getCode();
this.message = message;
}
public CustomException(CustomExceptionType exceptionTypeEnum) {
public CustomException(String code, String message)
{
this.code = code;
this.message = message;
}
public CustomException(CustomExceptionType exceptionTypeEnum)
{
this.code = exceptionTypeEnum.getCode();
this.message = exceptionTypeEnum.getMsg();
}
public String getCode() {
public String getCode()
{
return code;
}
@Override
public String getMessage() {
public String getMessage()
{
return message;
}
... ...
... ... @@ -4,6 +4,7 @@ package com.sunyo.wlpt.vehicle.manage.exception;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
... ... @@ -12,19 +13,16 @@ import org.springframework.web.bind.annotation.ResponseBody;
* Description:自定义全局异常处理类
* 时间:2020/7/17 17:44
*/
//@ControllerAdvice
@ControllerAdvice
public class GlobalExceptionHandler {
private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
//处理程序员主动转换的自定义异常
@ExceptionHandler(CustomException.class)
@ResponseBody
public ResultJson customerException(CustomException e)
{
if (e.getCode() == CustomExceptionType.SYSTEM_ERROR.getCode()) {
//400异常不需要持久化,将异常信息以友好的方式告知用户就可以
//TODO 将500异常信息持久化处理,方便运维人员处理
//TODO 将异常信息持久化,or 打印日志
logger.error("");
}
return ResultJson.error(e);
... ...
package com.sunyo.wlpt.vehicle.manage.mapper;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/9/23 15:17
*/
@Mapper
public interface LandRoadTrailerRecordMapper {
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(String id);
/**
* 批量删除
*
* @param idList id数组
* @return
*/
int batchRemoveByIds(String[] idList);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(LandRoadTrailerRecord record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(LandRoadTrailerRecord record);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
LandRoadTrailerRecord selectByPrimaryKey(String id);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(LandRoadTrailerRecord record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(LandRoadTrailerRecord record);
/**
* 查询挂车信息列表(目前应用于分页查询)
* 查询字段:挂车车牌号
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return
*/
List<LandRoadTrailerRecord> selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord);
/**
* 查询,根据车牌号
* <p>
* 用于判断,该挂车车牌号,是否唯一
*
* @param trailerLicenseNo 挂车车牌号
* @return
*/
List<LandRoadTrailerRecord> selectByTrailerLicenseNo(@Param("trailerLicenseNo") String trailerLicenseNo);
}
\ No newline at end of file
... ...
... ... @@ -71,7 +71,7 @@ public interface LandRoadVeRecordMapper {
/**
* 分页查询车辆信息列表
* 条件:
* 条件:国内车牌号、车辆类型、车辆状态
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return 全部列表
... ... @@ -84,5 +84,13 @@ public interface LandRoadVeRecordMapper {
* @param domesticLisenceNo 国内车牌号
* @return
*/
LandRoadVeRecord selectByDomesticLisenceNo(@Param("domesticLisenceNo") String domesticLisenceNo);
List<LandRoadVeRecord> selectByDomesticLisenceNo(@Param("domesticLisenceNo") String domesticLisenceNo);
/**
* 根据挂车车牌号,查询
*
* @param trailerLicenseNo 挂车车牌号
* @return
*/
List<LandRoadVeRecord> selectByTrailerLicenseNo(@Param("trailerLicenseNo") String trailerLicenseNo);
}
\ No newline at end of file
... ...
... ... @@ -100,9 +100,9 @@ public class ResultJson<T> implements Serializable {
return new ResultJson<>("200", "success");
}
public static ResultJson success(String msg)
public static ResultJson success(String message)
{
return new ResultJson<>("200", msg);
return new ResultJson<>("200", message);
}
... ... @@ -126,6 +126,16 @@ public class ResultJson<T> implements Serializable {
return new ResultJson<>("200", message, data);
}
public static ResultJson success(String code, String message)
{
return new ResultJson<>(code, message);
}
public static ResultJson success(String code, String message, Object data)
{
return new ResultJson<>(code, message, data);
}
public static ResultJson success(CustomExceptionType customExceptionType)
{
return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg());
... ... @@ -167,8 +177,8 @@ public class ResultJson<T> implements Serializable {
return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg());
}
public static ResultJson error(String code, String msg)
public static ResultJson error(String code, String message)
{
return new ResultJson<>(code, msg);
return new ResultJson<>(code, message);
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.service;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
/**
* @author 子诚
* Description:
* 时间:2020/9/23 15:17
*/
public interface LandRoadTrailerRecordService {
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
ResultJson deleteByPrimaryKey(String id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(LandRoadTrailerRecord record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
ResultJson insertSelective(LandRoadTrailerRecord record);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
LandRoadTrailerRecord selectByPrimaryKey(String id);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
ResultJson updateByPrimaryKeySelective(LandRoadTrailerRecord record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(LandRoadTrailerRecord record);
/**
* 分页查询,挂车信息列表
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @param pageNum 当前页数
* @param pageSize 每页大小
* @return
*/
ResultJson selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord, Integer pageNum, Integer pageSize);
/**
* 批量删除车辆信息
*
* @param ids 被删除的id,多个以,相隔的字符串
* @return
*/
ResultJson batchRemoveByIds(String ids);
}
... ...
package com.sunyo.wlpt.vehicle.manage.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.vehicle.manage.common.Common;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
import com.sunyo.wlpt.vehicle.manage.utils.IdUtils;
import io.netty.util.internal.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord;
import com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper;
import com.sunyo.wlpt.vehicle.manage.service.LandRoadTrailerRecordService;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/9/23 15:17
*/
@Service
public class LandRoadTrailerRecordServiceImpl implements LandRoadTrailerRecordService {
@Resource
private LandRoadTrailerRecordMapper landRoadTrailerRecordMapper;
/**
* 删除
*
* @param id primaryKey
* @return
*/
@Override
public ResultJson deleteByPrimaryKey(String id)
{
return landRoadTrailerRecordMapper.deleteByPrimaryKey(id) > 0
? ResultJson.success("200", "删除挂车信息,成功")
: ResultJson.error("500", "删除挂车信息失败");
}
/**
* 批量删除
*
* @param ids 被删除的id,多个以,相隔的字符串
* @return
*/
@Override
public ResultJson batchRemoveByIds(String ids)
{
String[] idList = ids.split(",");
return landRoadTrailerRecordMapper.batchRemoveByIds(idList) > 0
? ResultJson.success("200", "批量删除挂车信息,成功")
: ResultJson.error("500", "批量删除挂车信息,失败");
}
@Override
public int insert(LandRoadTrailerRecord record)
{
return landRoadTrailerRecordMapper.insert(record);
}
/**
* 选择性新增
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return
*/
@Override
public ResultJson insertSelective(LandRoadTrailerRecord landRoadTrailerRecord)
{
ResultJson validate = validate(landRoadTrailerRecord);
if (!Common.RESULT_SUCCESS.equals(validate.getCode())) {
return validate;
}
landRoadTrailerRecord.setId(IdUtils.generateId());
return landRoadTrailerRecordMapper.insertSelective(landRoadTrailerRecord) > 0
? ResultJson.success("200", "新增挂车信息,成功")
: ResultJson.error("500", "新增挂车信息失败");
}
/**
* 查询,根据主键
*
* @param id primary key
* @return
*/
@Override
public LandRoadTrailerRecord selectByPrimaryKey(String id)
{
return landRoadTrailerRecordMapper.selectByPrimaryKey(id);
}
/**
* 选择性编辑
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @return
*/
@Override
public ResultJson updateByPrimaryKeySelective(LandRoadTrailerRecord landRoadTrailerRecord)
{
ResultJson validate = validate(landRoadTrailerRecord);
if (!Common.RESULT_SUCCESS.equals(validate.getCode())) {
return validate;
}
return landRoadTrailerRecordMapper.updateByPrimaryKeySelective(landRoadTrailerRecord) > 0
? ResultJson.success("200", "编辑挂车信息,成功")
: ResultJson.error("500", "编辑挂车信息,失败");
}
@Override
public int updateByPrimaryKey(LandRoadTrailerRecord record)
{
return landRoadTrailerRecordMapper.updateByPrimaryKey(record);
}
/**
* 分页查询,挂车信息列表
*
* @param landRoadTrailerRecord 挂车信息 {@link LandRoadTrailerRecord}
* @param pageNum 当前页数
* @param pageSize 每页大小
* @return
*/
@Override
public ResultJson selectListByPage(LandRoadTrailerRecord landRoadTrailerRecord, Integer pageNum, Integer pageSize)
{
PageHelper.startPage(pageNum, pageSize);
List<LandRoadTrailerRecord> landRoadTrailerRecordList = landRoadTrailerRecordMapper.selectListByPage(landRoadTrailerRecord);
PageInfo<LandRoadTrailerRecord> pageInfo = new PageInfo<>(landRoadTrailerRecordList);
return pageInfo.getTotal() >= 0
? ResultJson.success("200", "查询挂车信息列表,成功!", pageInfo)
: ResultJson.error("500", "查询挂车信息列表,失败!");
}
/**
* 新增 or 编辑
* 校验,挂车车牌号,是否唯一
*
* @param landRoadTrailerRecord {@link LandRoadTrailerRecord}
* @return
*/
private ResultJson validate(LandRoadTrailerRecord landRoadTrailerRecord)
{
String id = landRoadTrailerRecord.getId();
String trailerLicenseNo = landRoadTrailerRecord.getTrailerLicenseNo();
if (StringUtil.isNullOrEmpty(trailerLicenseNo)) {
return ResultJson.error("400", "挂车车牌号,不能为空!");
}
return StringUtil.isNullOrEmpty(id) ? validateInsert(trailerLicenseNo) : validateEdit(id, trailerLicenseNo);
}
/**
* 校验编辑时,挂车车牌号,是否唯一
*
* @param trailerLicenseNo 挂车车牌号
* @return
*/
private ResultJson validateEdit(String id, String trailerLicenseNo)
{
LandRoadTrailerRecord oldInfo = landRoadTrailerRecordMapper.selectByPrimaryKey(id);
if (oldInfo == null) {
return ResultJson.error("400", "该挂车信息不存在,请仔细检查");
}
if (!trailerLicenseNo.equals(oldInfo.getTrailerLicenseNo())) {
if (landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) {
return ResultJson.error("400", "该挂车信息(车牌号),已存在");
}
}
return ResultJson.success("校验通过");
}
/**
* 校验新增时,挂车车牌号,是否唯一
*
* @param trailerLicenseNo 挂车车牌号
* @return
*/
private ResultJson validateInsert(String trailerLicenseNo)
{
return landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0
? ResultJson.error("400", "该挂车信息(车牌号),已存在")
: ResultJson.success("校验通过");
}
}
... ...
... ... @@ -3,6 +3,8 @@ package com.sunyo.wlpt.vehicle.manage.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.vehicle.manage.common.Common;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord;
import com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
import com.sunyo.wlpt.vehicle.manage.utils.IdUtils;
import io.netty.util.internal.StringUtil;
... ... @@ -27,12 +29,15 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
@Resource
private LandRoadVeRecordMapper landRoadVeRecordMapper;
@Resource
private LandRoadTrailerRecordMapper landRoadTrailerRecordMapper;
@Override
public ResultJson deleteByPrimaryKey(String id)
{
return landRoadVeRecordMapper.deleteByPrimaryKey(id) > 0
? new ResultJson<>("200", "删除车辆信息,成功!")
: new ResultJson<>("500", "删除车辆信息,失败!");
? ResultJson.success("200", "删除车辆信息,成功!")
: ResultJson.error("500", "删除车辆信息,失败!");
}
/**
... ... @@ -46,8 +51,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
{
String[] idList = ids.split(",");
return landRoadVeRecordMapper.batchRemoveByIds(idList) > 0
? new ResultJson<>("200", "批量删除车辆信息,成功")
: new ResultJson<>("500", "批量删除车辆信息,失败");
? ResultJson.success("200", "批量删除车辆信息,成功")
: ResultJson.error("500", "批量删除车辆信息,失败");
}
@Override
... ... @@ -65,14 +70,14 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
@Override
public ResultJson insertSelective(LandRoadVeRecord record)
{
ResultJson validateAdd = validate(record);
if (!Common.RESULT_SUCCESS.equals(validateAdd.getCode())) {
return validateAdd;
ResultJson validateInsert = validate(record);
if (!Common.RESULT_SUCCESS.equals(validateInsert.getCode())) {
return validateInsert;
}
record.setId(IdUtils.generateId());
return landRoadVeRecordMapper.insertSelective(record) > 0
? new ResultJson<>("200", "添加车辆信息,成功")
: new ResultJson<>("500", "添加车辆信息,失败");
? ResultJson.success("200", "添加车辆信息,成功")
: ResultJson.error("500", "添加车辆信息,失败");
}
@Override
... ... @@ -95,8 +100,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
return validateEdit;
}
return landRoadVeRecordMapper.updateByPrimaryKeySelective(record) > 0
? new ResultJson<>("200", "编辑车辆信息,成功")
: new ResultJson<>("500", "编辑车辆信息,失败");
? ResultJson.success("200", "编辑车辆信息,成功")
: ResultJson.error("500", "编辑车辆信息,失败");
}
@Override
... ... @@ -120,8 +125,8 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
List<LandRoadVeRecord> landRoadVeRecordList = landRoadVeRecordMapper.selectListByPage(landRoadVeRecord);
PageInfo<LandRoadVeRecord> pageInfo = new PageInfo<>(landRoadVeRecordList);
return pageInfo.getTotal() >= 0
? new ResultJson<>("200", "查询车辆信息列表,成功!", pageInfo)
: new ResultJson<>("500", "查询车辆信息列表,失败!");
? ResultJson.success("200", "查询车辆信息列表,成功!", pageInfo)
: ResultJson.error("500", "查询车辆信息列表,失败!");
}
/**
... ... @@ -135,47 +140,74 @@ public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
{
String id = landRoadVeRecord.getId();
String domesticLisenceNo = landRoadVeRecord.getDomesticLisenceNo();
String trailerLicenseNo = landRoadVeRecord.getTrailerLicenseNo();
if (StringUtil.isNullOrEmpty(domesticLisenceNo)) {
return new ResultJson<>("400", "国内车牌号,不能为空!");
return ResultJson.error("400", "国内车牌号,不能为空!");
}
return StringUtil.isNullOrEmpty(id) ? validateInsert(domesticLisenceNo) : validateEdit(id, domesticLisenceNo);
return StringUtil.isNullOrEmpty(id) ? validateInsert(domesticLisenceNo, trailerLicenseNo) : validateEdit(id, domesticLisenceNo, trailerLicenseNo);
}
/**
* 编辑,检验
* <p>
* 校验挂车逻辑:
* 1、编辑前,没有挂车,校验编辑后的挂车牌号,是否存在?是否已用?
* 2、编辑前,有挂车,校验编辑前后的挂车牌号,不相同时,编辑后得挂车牌号是否存在?是否已用?
* <p>
* 校验,国内车牌号,是否唯一
*
* @param id 主键
* @param domesticLisenceNo 国内车牌号
* @param trailerLicenseNo 挂车车牌号
* @return
*/
private ResultJson validateEdit(String id, String domesticLisenceNo)
private ResultJson validateEdit(String id, String domesticLisenceNo, String trailerLicenseNo)
{
LandRoadVeRecord oldVe = landRoadVeRecordMapper.selectByDomesticLisenceNo(id);
LandRoadVeRecord oldVe = landRoadVeRecordMapper.selectByPrimaryKey(id);
if (oldVe == null) {
return new ResultJson<>("400", "该车辆信息不存在");
return ResultJson.error("400", "该车辆信息不存在,请仔细检查");
}
if (!StringUtil.isNullOrEmpty(trailerLicenseNo) && landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) {
boolean flag = !StringUtil.isNullOrEmpty(oldVe.getTrailerLicenseNo())
&& !trailerLicenseNo.equals(oldVe.getTrailerLicenseNo());
if (StringUtil.isNullOrEmpty(oldVe.getTrailerLicenseNo()) || flag) {
if (landRoadVeRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) {
return ResultJson.error("400", "该挂车已经被使用,请仔细检查");
}
}
}
if (!domesticLisenceNo.equals(oldVe.getDomesticLisenceNo())) {
if (landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo) != null) {
return new ResultJson<>("400", "该车辆信息,已存在");
if (landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo).size() > 0) {
return ResultJson.error("400", "该车辆信息(车牌号),已存在");
}
}
return ResultJson.success("校验通过");
}
/**
* 新增,校验
* 国内车牌号,是否存在
* 新增校验
* <p>
* 校验是否挂车,挂车是否存在,挂车是否可用
* <p>
* 校验国内车牌号,是否唯一
*
* @param domesticLisenceNo 国内车牌号
* @param trailerLicenseNo 挂车车牌号
* @return
*/
private ResultJson validateInsert(String domesticLisenceNo)
private ResultJson validateInsert(String domesticLisenceNo, String trailerLicenseNo)
{
LandRoadVeRecord landRoadVeRecord = landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo);
if (landRoadVeRecord == null) {
ResultJson.error("400", "校验失败");
if (!StringUtil.isNullOrEmpty(trailerLicenseNo)
&& landRoadTrailerRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) {
if (landRoadVeRecordMapper.selectByTrailerLicenseNo(trailerLicenseNo).size() > 0) {
return ResultJson.error("400", "该挂车已经被使用,请仔细检查");
}
}
return ResultJson.success("校验通过");
return landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo).size() > 0
? ResultJson.error("400", "校验失败,该国内车牌号已存在")
: ResultJson.success("校验通过");
}
}
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sunyo.wlpt.vehicle.manage.mapper.LandRoadTrailerRecordMapper">
<cache type="com.sunyo.wlpt.vehicle.manage.cache.RedisCache"/>
<!-- <cache-ref namespace="com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper"/>-->
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord">
<!--@mbg.generated-->
<!--@Table land_road_trailer_record-->
<id column="ID" jdbcType="VARCHAR" property="id"/>
<result column="EPORT_ID" jdbcType="VARCHAR" property="eportId"/>
<result column="MAIN_PORT" jdbcType="VARCHAR" property="mainPort"/>
<result column="TRAILER_LICENSE_NO" jdbcType="VARCHAR" property="trailerLicenseNo"/>
<result column="TRAILER_REG_PLACE" jdbcType="VARCHAR" property="trailerRegPlace"/>
<result column="FRAME_NO" jdbcType="VARCHAR" property="frameNo"/>
<result column="TRAILER_WT" jdbcType="VARCHAR" property="trailerWt"/>
<result column="TRAILER_COLOR" jdbcType="VARCHAR" property="trailerColor"/>
<result column="VE_CON_PIC" jdbcType="VARCHAR" property="veConPic"/>
<result column="PROPOSER" jdbcType="VARCHAR" property="proposer"/>
<result column="PROPOSE_TIME" jdbcType="TIMESTAMP" property="proposeTime"/>
<result column="TRAILER_CLASS_FLAG" jdbcType="VARCHAR" property="trailerClassFlag"/>
<result column="OPERATION_TYPE" jdbcType="VARCHAR" property="operationType"/>
<result column="TRAILER_LICENSE_NO_PIC" jdbcType="VARCHAR" property="trailerLicenseNoPic"/>
<result column="RETURNMESSAGE" jdbcType="VARCHAR" property="returnmessage"/>
<result column="CREATE_BY" jdbcType="VARCHAR" property="createBy"/>
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate"/>
<result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy"/>
<result column="UPDATE_DATE" jdbcType="TIMESTAMP" property="updateDate"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
ID, EPORT_ID, MAIN_PORT, TRAILER_LICENSE_NO, TRAILER_REG_PLACE, FRAME_NO, TRAILER_WT,
TRAILER_COLOR, VE_CON_PIC, PROPOSER, PROPOSE_TIME, TRAILER_CLASS_FLAG, OPERATION_TYPE,
TRAILER_LICENSE_NO_PIC, RETURNMESSAGE, CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from land_road_trailer_record
where ID = #{id,jdbcType=VARCHAR}
</select>
<!-- 用于分页查询 -->
<select id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from land_road_trailer_record
<where>
<!-- 挂车车牌号 -->
<if test="trailerLicenseNo != null and trailerLicenseNo != ''">
TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}
</if>
</where>
</select>
<!-- 用于查询车牌号,是否唯一? -->
<select id="selectByTrailerLicenseNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from land_road_trailer_record
where TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete
from land_road_trailer_record
where ID = #{id,jdbcType=VARCHAR}
</delete>
<delete id="batchRemoveByIds" parameterType="java.lang.String">
<!--@mbg.generated-->
delete
from land_road_trailer_record
where ID in
<foreach collection="array" open="(" close=")" separator="," item="id">
#{id,jdbcType=VARCHAR}
</foreach>
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord">
<!--@mbg.generated-->
insert into land_road_trailer_record (ID, EPORT_ID, MAIN_PORT,
TRAILER_LICENSE_NO, TRAILER_REG_PLACE, FRAME_NO,
TRAILER_WT, TRAILER_COLOR, VE_CON_PIC,
PROPOSER, PROPOSE_TIME, TRAILER_CLASS_FLAG,
OPERATION_TYPE, TRAILER_LICENSE_NO_PIC, RETURNMESSAGE,
CREATE_BY, CREATE_DATE, UPDATE_BY,
UPDATE_DATE)
values (#{id,jdbcType=VARCHAR}, #{eportId,jdbcType=VARCHAR}, #{mainPort,jdbcType=VARCHAR},
#{trailerLicenseNo,jdbcType=VARCHAR}, #{trailerRegPlace,jdbcType=VARCHAR}, #{frameNo,jdbcType=VARCHAR},
#{trailerWt,jdbcType=VARCHAR}, #{trailerColor,jdbcType=VARCHAR}, #{veConPic,jdbcType=VARCHAR},
#{proposer,jdbcType=VARCHAR}, #{proposeTime,jdbcType=TIMESTAMP}, #{trailerClassFlag,jdbcType=VARCHAR},
#{operationType,jdbcType=VARCHAR}, #{trailerLicenseNoPic,jdbcType=VARCHAR}, #{returnmessage,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateDate,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord">
<!--@mbg.generated-->
insert into land_road_trailer_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="eportId != null">
EPORT_ID,
</if>
<if test="mainPort != null">
MAIN_PORT,
</if>
<if test="trailerLicenseNo != null">
TRAILER_LICENSE_NO,
</if>
<if test="trailerRegPlace != null">
TRAILER_REG_PLACE,
</if>
<if test="frameNo != null">
FRAME_NO,
</if>
<if test="trailerWt != null">
TRAILER_WT,
</if>
<if test="trailerColor != null">
TRAILER_COLOR,
</if>
<if test="veConPic != null">
VE_CON_PIC,
</if>
<if test="proposer != null">
PROPOSER,
</if>
<if test="proposeTime != null">
PROPOSE_TIME,
</if>
<if test="trailerClassFlag != null">
TRAILER_CLASS_FLAG,
</if>
<if test="operationType != null">
OPERATION_TYPE,
</if>
<if test="trailerLicenseNoPic != null">
TRAILER_LICENSE_NO_PIC,
</if>
<if test="returnmessage != null">
RETURNMESSAGE,
</if>
<if test="createBy != null">
CREATE_BY,
</if>
<if test="createDate != null">
CREATE_DATE,
</if>
<if test="updateBy != null">
UPDATE_BY,
</if>
<if test="updateDate != null">
UPDATE_DATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="eportId != null">
#{eportId,jdbcType=VARCHAR},
</if>
<if test="mainPort != null">
#{mainPort,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNo != null">
#{trailerLicenseNo,jdbcType=VARCHAR},
</if>
<if test="trailerRegPlace != null">
#{trailerRegPlace,jdbcType=VARCHAR},
</if>
<if test="frameNo != null">
#{frameNo,jdbcType=VARCHAR},
</if>
<if test="trailerWt != null">
#{trailerWt,jdbcType=VARCHAR},
</if>
<if test="trailerColor != null">
#{trailerColor,jdbcType=VARCHAR},
</if>
<if test="veConPic != null">
#{veConPic,jdbcType=VARCHAR},
</if>
<if test="proposer != null">
#{proposer,jdbcType=VARCHAR},
</if>
<if test="proposeTime != null">
#{proposeTime,jdbcType=TIMESTAMP},
</if>
<if test="trailerClassFlag != null">
#{trailerClassFlag,jdbcType=VARCHAR},
</if>
<if test="operationType != null">
#{operationType,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNoPic != null">
#{trailerLicenseNoPic,jdbcType=VARCHAR},
</if>
<if test="returnmessage != null">
#{returnmessage,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
#{updateDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord">
<!--@mbg.generated-->
update land_road_trailer_record
<set>
<if test="eportId != null">
EPORT_ID = #{eportId,jdbcType=VARCHAR},
</if>
<if test="mainPort != null">
MAIN_PORT = #{mainPort,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNo != null">
TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR},
</if>
<if test="trailerRegPlace != null">
TRAILER_REG_PLACE = #{trailerRegPlace,jdbcType=VARCHAR},
</if>
<if test="frameNo != null">
FRAME_NO = #{frameNo,jdbcType=VARCHAR},
</if>
<if test="trailerWt != null">
TRAILER_WT = #{trailerWt,jdbcType=VARCHAR},
</if>
<if test="trailerColor != null">
TRAILER_COLOR = #{trailerColor,jdbcType=VARCHAR},
</if>
<if test="veConPic != null">
VE_CON_PIC = #{veConPic,jdbcType=VARCHAR},
</if>
<if test="proposer != null">
PROPOSER = #{proposer,jdbcType=VARCHAR},
</if>
<if test="proposeTime != null">
PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP},
</if>
<if test="trailerClassFlag != null">
TRAILER_CLASS_FLAG = #{trailerClassFlag,jdbcType=VARCHAR},
</if>
<if test="operationType != null">
OPERATION_TYPE = #{operationType,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNoPic != null">
TRAILER_LICENSE_NO_PIC = #{trailerLicenseNoPic,jdbcType=VARCHAR},
</if>
<if test="returnmessage != null">
RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
CREATE_BY = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadTrailerRecord">
<!--@mbg.generated-->
update land_road_trailer_record
set EPORT_ID = #{eportId,jdbcType=VARCHAR},
MAIN_PORT = #{mainPort,jdbcType=VARCHAR},
TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR},
TRAILER_REG_PLACE = #{trailerRegPlace,jdbcType=VARCHAR},
FRAME_NO = #{frameNo,jdbcType=VARCHAR},
TRAILER_WT = #{trailerWt,jdbcType=VARCHAR},
TRAILER_COLOR = #{trailerColor,jdbcType=VARCHAR},
VE_CON_PIC = #{veConPic,jdbcType=VARCHAR},
PROPOSER = #{proposer,jdbcType=VARCHAR},
PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP},
TRAILER_CLASS_FLAG = #{trailerClassFlag,jdbcType=VARCHAR},
OPERATION_TYPE = #{operationType,jdbcType=VARCHAR},
TRAILER_LICENSE_NO_PIC = #{trailerLicenseNoPic,jdbcType=VARCHAR},
RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR},
CREATE_BY = #{createBy,jdbcType=VARCHAR},
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -89,12 +89,12 @@
from land_road_ve_record
where ID = #{id,jdbcType=VARCHAR}
</select>
<select id="selectByDomesticLisenceNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<select id="selectByDomesticLisenceNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from land_road_ve_record
where DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR}
</select>
</select>
<!-- 用于,分页查询 -->
<select id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord" resultMap="BaseResultMap">
select
... ... @@ -115,6 +115,14 @@
</if>
</where>
</select>
<select id="selectByTrailerLicenseNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from land_road_ve_record
where TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete
... ...