作者 王勇

车辆管理,CRUD

package com.sunyo.wlpt.vehicle.manage.cache;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @author 子诚
* Description:用来获取springboot创建好的工厂
* 时间:2020/8/6 9:31
*/
@Component
public class ApplicationContextUtils implements ApplicationContextAware {
/**
* 保留下来工厂
*/
private static ApplicationContext context;
/**
* 将创建好工厂以参数形式传递给这个类
*
* @param applicationContext 上下文
* @throws BeansException
*/
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
context = applicationContext;
}
/**
* 提供在工厂中获取对象的方法 例如:RedisTemplate redisTemplate
*
* @param beanName bean的名称
* @return
*/
public static Object getBean(String beanName)
{
return context.getBean(beanName);
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.cache;
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;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* @author 子诚
* Description:自定义Redis作为mybatis二级缓存实现
* 问题描述:缓存穿透、缓存雪崩
* <p>
* 缓存穿透:就是说利用一些列措施,使得访问避开了缓存,直接访问数据库,使得数据库不堪重负引起的问题。比如(压测)访问数据库中不存在的数据
* 解决方案:读取数据库,不存在;依旧生成对应的key,放到缓存中,但是对应的value是null(mybatis的二级缓存是这样解决的)。
* 下次再次访问的话,就是读取缓存。
* <p>
* 缓存雪崩:是指在某一特殊时刻,缓存中的缓存全部失效,然后这一时刻又有大量的数据库访问,导致数据库不堪重负。
* 解决方案:根据业务的不同设置不同的缓存失效时间。
* 比如:这个项目,做了3个namespace的缓存,其中一个namespace,共有5个Mapper指向它。所以选择使用范围内的随机值,来做缓存失效时间
* <p>
* 时间:2020/8/6 9:37
*/
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();
/**
* 当前放入缓存的mapper的namespace
*/
private final String id;
/**
* 必须存在构造方法
*/
public RedisCache(String id)
{
this.id = id;
}
/**
* 返回cache唯一标识
*/
@Override
public String getId()
{
return this.id;
}
/**
* 缓存放入值 redis RedisTemplate StringRedisTemplate
*
* @param key hash_key
* @param value hash_value
*/
@Override
public void putObject(Object key, Object value)
{
RedisTemplate redisTemplate = getRedisTemplate();
// 使用redis的hash类型作为缓存存储模型
redisTemplate.opsForHash().put(id.toString(), encryptionKey(key.toString()), value);
/**
* 根据业务的不同,设置不同的缓存时间,解决掉缓存雪崩
*/
if (id.equals("com.sunyo.wlpt.vehicle.manage.mapper.LandRoadVeRecordMapper")) {
// 车辆查询
redisTemplate.expire(id.toString(), random(60, 120), TimeUnit.MINUTES);
} else {
// 其他,作为补充
redisTemplate.expire(id.toString(), random(30, 50), TimeUnit.MINUTES);
}
}
/**
*
*/
public int random(int low, int high)
{
int num = ((int) (Math.random() * (high - low))) + low;
return num;
}
/**
* 缓存中中获取数据
*/
@Override
public Object getObject(Object key)
{
RedisTemplate redisTemplate = getRedisTemplate();
//根据key 从redis的hash类型中获取数据
return redisTemplate.opsForHash().get(id.toString(), encryptionKey(key.toString()));
}
/**
* 注意:这个方法为mybatis保留方法 默认没有实现 后续版本可能会实现
*
* @param key hash_key
* @return
*/
@Override
public Object removeObject(Object key)
{
RedisTemplate redisTemplate = getRedisTemplate();
redisTemplate.delete(key);
return null;
}
@Override
public void clear()
{
logger.info("清空->{}<-缓存", id);
RedisTemplate redisTemplate = getRedisTemplate();
// 清空 namespace
redisTemplate.delete(id.toString());
}
/**
* 用来计算缓存数量
*/
@Override
public int getSize()
{
RedisTemplate redisTemplate = getRedisTemplate();
// 获取hash中key value数量
return redisTemplate.opsForHash().size(id.toString()).intValue();
}
/**
* 封装redisTemplate
*
* @return RedisTemplate
*/
private RedisTemplate getRedisTemplate()
{
//通过application工具类获取redisTemplate
RedisTemplate redisTemplate = (RedisTemplate) com.sunyo.wlpt.vehicle.manage.cache.ApplicationContextUtils.getBean("redisTemplate");
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
return redisTemplate;
}
/**
* 封装一个对key进行md5处理方法
*/
private String encryptionKey(String key)
{
return DigestUtils.md5DigestAsHex(key.getBytes());
}
@Override
public ReadWriteLock getReadWriteLock()
{
return readWriteLock;
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.common;
/**
* @author 子诚
* Description:常量公共类
* 时间:2020/7/17 9:49
*/
public class Common {
public static final String RESULT_SUCCESS = "200";
}
... ...
package com.sunyo.wlpt.vehicle.manage.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
/**
* @author 子诚
* Description:SpringSecurity 权限配置框架
* 时间:2020/7/5 13:38
*/
@EnableWebSecurity
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author 子诚
* Description:swagger-knife4j 的配置文件
* 时间:2020/7/10 11:48
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.sunyo.wlpt.vehicle.manage.controller"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo()
{
return new ApiInfoBuilder()
.title("车辆管理服务")
.description("车辆管理服务")
.termsOfServiceUrl("http://localhost:10001/")
.contact("子诚")
.version("1.0.0")
.build();
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
import com.sunyo.wlpt.vehicle.manage.service.LandRoadVeRecordService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author 子诚
* Description:
* 时间:2020/9/22 17:58
*/
@CrossOrigin
@RequestMapping("vehicle")
@RestController
public class LandRoadVeRecordController {
@Resource
LandRoadVeRecordService landRoadVeRecordService;
/**
* 分页查询,车辆信息列表
*
* @param domesticLisenceNo 国内车牌号
* @param veType 车辆类型
* @param veState 车辆状态
* @param pageNum 当前页数
* @param pageSize 每页大小
* @return
*/
@GetMapping("/page")
public ResultJson selectBusExchangeList(
@RequestParam(value = "domesticLisenceNo", required = false) String domesticLisenceNo,
@RequestParam(value = "veType", required = false) String veType,
@RequestParam(value = "veState", required = false) String veState,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize)
{
LandRoadVeRecord landRoadVeRecord = LandRoadVeRecord.builder()
.domesticLisenceNo(domesticLisenceNo)
.veType(veType)
.veState(veState)
.build();
return landRoadVeRecordService.selectListByPage(landRoadVeRecord, pageNum, pageSize);
}
@DeleteMapping("/delete")
public ResultJson deleteLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
return landRoadVeRecordService.deleteByPrimaryKey(landRoadVeRecord.getId());
}
@DeleteMapping("/batchRemove")
public ResultJson batchRemoveLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
String id = landRoadVeRecord.getId();
return id.contains(",")
? landRoadVeRecordService.batchRemoveByIds(id)
: landRoadVeRecordService.deleteByPrimaryKey(id);
}
@PostMapping("/insert")
public ResultJson insertLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
return landRoadVeRecordService.insertSelective(landRoadVeRecord);
}
@PutMapping("/update")
public ResultJson updateLandRoadVeRecord(@RequestBody LandRoadVeRecord landRoadVeRecord)
{
return landRoadVeRecordService.updateByPrimaryKeySelective(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/22 17:45
*/
@ApiModel("LandRoadVeRecord:车辆详细信息")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LandRoadVeRecord implements Serializable {
private static final long serialVersionUID = -953128661933605427L;
@ApiModelProperty(value = "")
private String id;
/**
* 电子口岸录入号ID(电子口岸与海关数据传输使用,企业无需填写)
*/
@ApiModelProperty(value = "电子口岸录入号ID(电子口岸与海关数据传输使用,企业无需填写)")
private String eportId;
/**
* 主管海关代码
*/
@ApiModelProperty(value = "主管海关代码")
private String mainPort;
/**
* 运输公司代码
*/
@ApiModelProperty(value = "运输公司代码")
private String coCode;
/**
* 车牌指标编码
*/
@ApiModelProperty(value = "车牌指标编码")
private String veTargetNo;
/**
* 国内车牌
*/
@ApiModelProperty(value = "国内车牌")
private String domesticLisenceNo;
/**
* 车牌颜色
*/
@ApiModelProperty(value = "车牌颜色")
private String domesticLicenseColor;
/**
* 外籍车牌
*/
@ApiModelProperty(value = "外籍车牌")
private String foreignLicense;
@ApiModelProperty(value = "")
private String veRegPlace;
/**
* 使用性质
*/
@ApiModelProperty(value = "使用性质")
private String veProperty;
/**
* 车辆运输资格
*/
@ApiModelProperty(value = "车辆运输资格")
private String veConveyQua;
/**
* 车辆行驶证编号
*/
@ApiModelProperty(value = "车辆行驶证编号")
private String veCardNo;
/**
* 车辆登记车主名称
*/
@ApiModelProperty(value = "车辆登记车主名称")
private String veOwnerName;
/**
* 车辆登记车主证件号码
*/
@ApiModelProperty(value = "车辆登记车主证件号码")
private String veOwnerNo;
/**
* 车主境内联系地址
*/
@ApiModelProperty(value = "车主境内联系地址")
private String ownerInsideAddr;
/**
* 车主境内联系电话
*/
@ApiModelProperty(value = "车主境内联系电话")
private String ownerInsideTel;
/**
* 车辆类型(型样)
*/
@ApiModelProperty(value = "车辆类型(型样)")
private String veType;
/**
* 厂牌
*/
@ApiModelProperty(value = "厂牌")
private String brand;
@ApiModelProperty(value = "")
private String model;
/**
* 排气量
*/
@ApiModelProperty(value = "排气量")
private String exhaustCapacity;
/**
* 行驶证有效期日期(yyyyMMdd-0)
*/
@ApiModelProperty(value = "行驶证有效期日期(yyyyMMdd-0)")
private Date veFactoryDate;
/**
* 发动机号
*/
@ApiModelProperty(value = "发动机号")
private String veMotorNo;
/**
* 车架号(车辆识别代号)
*/
@ApiModelProperty(value = "车架号(车辆识别代号)")
private String veFrameNo;
/**
* 核定载客/核定载质量:客车的核定载客单位仍为:人;货车的核定载客单位改为:千克。
*/
@ApiModelProperty(value = "核定载客/核定载质量:客车的核定载客单位仍为:人;货车的核定载客单位改为:千克。")
private String veTon;
/**
* 自重(整备质量)
*/
@ApiModelProperty(value = "自重(整备质量)")
private String selfWt;
/**
* 准牵引总质量
*/
@ApiModelProperty(value = "准牵引总质量")
private String allowTowTotalWt;
/**
* 内部长度
*/
@ApiModelProperty(value = "内部长度")
private String containerInnerLength;
/**
* 货箱内部宽度(M)
*/
@ApiModelProperty(value = "货箱内部宽度(M)")
private String containerInnerWidth;
/**
* 货箱内部高度(M)
*/
@ApiModelProperty(value = "货箱内部高度(M)")
private String containerInnerHeight;
/**
* 外廓长度(M)
*/
@ApiModelProperty(value = "外廓长度(M)")
private String outerLength;
/**
* 外廓宽度(M)
*/
@ApiModelProperty(value = "外廓宽度(M)")
private String outerWidth;
/**
* 外廓高度(M)
*/
@ApiModelProperty(value = "外廓高度(M)")
private String outerHeight;
/**
* 车身颜色
*/
@ApiModelProperty(value = "车身颜色")
private String veBodyColor;
/**
* 油箱容量(升)
*/
@ApiModelProperty(value = "油箱容量(升)")
private String oilBoxCapcity;
/**
* 批准车辆进出口岸
*/
@ApiModelProperty(value = "批准车辆进出口岸")
private String allowVeIePort;
/**
* 批文/许可证编号
*/
@ApiModelProperty(value = "批文/许可证编号")
private String apprNo;
/**
* 批文/许可证有效期(yyyyMMdd-0)
*/
@ApiModelProperty(value = "批文/许可证有效期(yyyyMMdd-0)")
private Date apprPeriod;
/**
* 最新更新申请业务类型
*/
@ApiModelProperty(value = "最新更新申请业务类型")
private String currApplyBussiness;
/**
* 车前45度照片
*/
@ApiModelProperty(value = "车前45度照片")
private String front45cPic;
/**
* 车后45度照片
*/
@ApiModelProperty(value = "车后45度照片")
private String back45cPic;
/**
* 油箱照片
*/
@ApiModelProperty(value = "油箱照片")
private String oilBoxPic;
/**
* 车底照片
*/
@ApiModelProperty(value = "车底照片")
private String veBottomPic;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String memo;
/**
* 挂靠单位
*/
@ApiModelProperty(value = "挂靠单位")
private String proposer;
/**
* 申请时间 yyyyMMddHHmmss
*/
@ApiModelProperty(value = "申请时间 yyyyMMddHHmmss")
private Date proposeTime;
/**
* 车辆分类。1是进出境公路运输工具;2是来往港澳公路运输工具;3是进出境公/私用公路交通工具;4是来往港澳公/私用公路交通工具
*/
@ApiModelProperty(value = "车辆分类。1是进出境公路运输工具;2是来往港澳公路运输工具;3是进出境公/私用公路交通工具;4是来往港澳公/私用公路交通工具")
private String veClassFlag;
/**
* 数据操作类型
*/
@ApiModelProperty(value = "数据操作类型")
private String operationType;
/**
* 挂车牌号
*/
@ApiModelProperty(value = "挂车牌号")
private String trailerLicenseNo;
/**
* 挂车车架号
*/
@ApiModelProperty(value = "挂车车架号")
private String trailerFrameNo;
/**
* 批文扫描图
*/
@ApiModelProperty(value = "批文扫描图")
private String approNoPic;
/**
* 车架号扫描图
*/
@ApiModelProperty(value = "车架号扫描图")
private String veFrameNoPic;
/**
* 发动机拓印件
*/
@ApiModelProperty(value = "发动机拓印件")
private String motorNoPic;
/**
* 外籍车牌照片
*/
@ApiModelProperty(value = "外籍车牌照片")
private String foreignLicensePic;
/**
* 国籍
*/
@ApiModelProperty(value = "国籍")
private String nationality;
/**
* 回执内容
*/
@ApiModelProperty(value = "回执内容")
private String returnmessage;
/**
* 二维码
*/
@ApiModelProperty(value = "二维码")
private String barcode;
@ApiModelProperty(value = "")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "")
private String updateBy;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date updateDate;
/**
* 开始空闲时间
*/
@ApiModelProperty(value = "开始空闲时间")
private Date veFreeTime;
/**
* 优先级(备用字段)
*/
@ApiModelProperty(value = "优先级(备用字段)")
private Integer vePriority;
/**
* 车辆状态
*/
@ApiModelProperty(value = "车辆状态")
private String veState;
}
\ No newline at end of file
... ...
package com.sunyo.wlpt.vehicle.manage.exception;
/**
* @author 子诚
* Description:
* 时间:2020/7/17 16:43
*/
public class CustomException extends RuntimeException {
private static final long serialVersionUID = 6098063244016154220L;
/**
* 异常错误编码
*/
private String code;
/**
* 异常信息
*/
private String message;
public CustomException(CustomExceptionType exceptionTypeEnum, String message) {
this.code = exceptionTypeEnum.getCode();
this.message = message;
}
public CustomException(CustomExceptionType exceptionTypeEnum) {
this.code = exceptionTypeEnum.getCode();
this.message = exceptionTypeEnum.getMsg();
}
public String getCode() {
return code;
}
@Override
public String getMessage() {
return message;
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.exception;
/**
* @author 子诚
* Description:枚举,定制异常类型
* 时间:2020/7/17 16:27
*/
public enum CustomExceptionType {
CLIENT_ERROR("400", "客户端异常"),
SYSTEM_ERROR("500", "系统服务异常"),
OTHER_ERROR("999", "其他未知异常");
/**
* 响应业务状态
*/
private String code;
/**
* 响应消息
*/
private String msg;
CustomExceptionType(String code, String msg)
{
this.code = code;
this.msg = msg;
}
public String getCode()
{
return code;
}
public String getMsg()
{
return msg;
}
}
... ...
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.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author 子诚
* Description:自定义全局异常处理类
* 时间:2020/7/17 17:44
*/
//@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异常信息持久化处理,方便运维人员处理
logger.error("");
}
return ResultJson.error(e);
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.mapper;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/9/22 17:45
*/
@Mapper
public interface LandRoadVeRecordMapper {
/**
* 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(LandRoadVeRecord record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(LandRoadVeRecord record);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
LandRoadVeRecord selectByPrimaryKey(String id);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(LandRoadVeRecord record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(LandRoadVeRecord record);
/**
* 分页查询车辆信息列表
* 条件:
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @return 全部列表
*/
List<LandRoadVeRecord> selectListByPage(LandRoadVeRecord landRoadVeRecord);
/**
* 根据国内车牌号查询
*
* @param domesticLisenceNo 国内车牌号
* @return
*/
LandRoadVeRecord selectByDomesticLisenceNo(@Param("domesticLisenceNo") String domesticLisenceNo);
}
\ No newline at end of file
... ...
package com.sunyo.wlpt.vehicle.manage.response;
import com.sunyo.wlpt.vehicle.manage.exception.CustomException;
import com.sunyo.wlpt.vehicle.manage.exception.CustomExceptionType;
import lombok.Data;
import java.io.Serializable;
/**
* @author 子诚
* Description:返回结果封装类
* 时间:2020/7/01 10:06
*/
@Data
public class ResultJson<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 响应业务状态,默认为200
*/
private String code;
/**
* 响应消息
*/
private String msg;
/**
* 错误消息内容
*/
private String error;
/**
* 数据总条数
*/
private Integer total;
/**
* 响应数据
*/
private T data;
/**
* JWT令牌
*/
private String jwtToken;
/**
* 无参,构造方法
*/
public ResultJson()
{
}
/**
* 定义有参构造器
*
* @param code 响应状态
* @param msg 响应消息
*/
public ResultJson(String code, String msg)
{
this.code = code;
this.msg = msg;
}
/**
* 定义有参构造器
*
* @param code 响应状态
* @param msg 响应消息
* @param data 响应数据
*/
public ResultJson(String code, String msg, T data)
{
this.code = code;
this.msg = msg;
this.data = data;
}
public ResultJson(String code, String msg, T data, Integer total)
{
this.code = code;
this.msg = msg;
this.data = data;
this.total = total;
}
/**
* 定义静态、成功方法(重载)
*
* @return 成功(没有响应数据)
*/
public static ResultJson success()
{
return new ResultJson<>("200", "success");
}
public static ResultJson success(String msg)
{
return new ResultJson<>("200", msg);
}
/**
* 定义静态、成功方法(重载)
*
* @return 成功(响应数据)
*/
public static ResultJson success(Object data)
{
return new ResultJson<>("200", "success", data);
}
/**
* 定义静态、成功方法(重载)
*
* @return 成功(响应数据)
*/
public static ResultJson success(String message, Object data)
{
return new ResultJson<>("200", message, data);
}
public static ResultJson success(CustomExceptionType customExceptionType)
{
return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg());
}
public static ResultJson success(CustomExceptionType customExceptionType, Object data)
{
return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg(), data);
}
/**
* 请求出现异常时的响应数据封装
*
* @param e 自定义异常类
* @return 返回异常信息
*/
public static ResultJson error(CustomException e)
{
ResultJson result = new ResultJson<>();
result.setCode(e.getCode());
if (e.getCode() == CustomExceptionType.CLIENT_ERROR.getCode()) {
result.setMsg(e.getMessage());
} else if (e.getCode() == CustomExceptionType.SYSTEM_ERROR.getCode()) {
result.setMsg(e.getMessage() + ";请将该异常发送给管理员");
} else {
result.setMsg("系统出现未知异常,请联系管理员!");
}
// 可以尝试着做异常信息持久化
return result;
}
public static ResultJson error(CustomExceptionType customExceptionType, String errorMessage)
{
return new ResultJson<>(customExceptionType.getCode(), errorMessage);
}
public static ResultJson error(CustomExceptionType customExceptionType)
{
return new ResultJson<>(customExceptionType.getCode(), customExceptionType.getMsg());
}
public static ResultJson error(String code, String msg)
{
return new ResultJson<>(code, msg);
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import com.sunyo.wlpt.vehicle.manage.response.ResultJson;
/**
* @author 子诚
* Description:
* 时间:2020/9/22 17:45
*/
public interface LandRoadVeRecordService {
/**
* 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(LandRoadVeRecord record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
ResultJson insertSelective(LandRoadVeRecord record);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
LandRoadVeRecord selectByPrimaryKey(String id);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
ResultJson updateByPrimaryKeySelective(LandRoadVeRecord record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(LandRoadVeRecord record);
/**
* 分页查询车辆信息
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @param pageNum 当前页数
* @param pageSize 每页大小
* @return 分页数据
*/
ResultJson selectListByPage(LandRoadVeRecord landRoadVeRecord, 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.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.mapper.LandRoadVeRecordMapper;
import com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord;
import com.sunyo.wlpt.vehicle.manage.service.LandRoadVeRecordService;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/9/22 17:45
*/
@Service
public class LandRoadVeRecordServiceImpl implements LandRoadVeRecordService {
@Resource
private LandRoadVeRecordMapper landRoadVeRecordMapper;
@Override
public ResultJson deleteByPrimaryKey(String id)
{
return landRoadVeRecordMapper.deleteByPrimaryKey(id) > 0
? new ResultJson<>("200", "删除车辆信息,成功!")
: new ResultJson<>("500", "删除车辆信息,失败!");
}
/**
* 批量删除
*
* @param ids 被删除的id,多个以,相隔的字符串
* @return
*/
@Override
public ResultJson batchRemoveByIds(String ids)
{
String[] idList = ids.split(",");
return landRoadVeRecordMapper.batchRemoveByIds(idList) > 0
? new ResultJson<>("200", "批量删除车辆信息,成功")
: new ResultJson<>("500", "批量删除车辆信息,失败");
}
@Override
public int insert(LandRoadVeRecord record)
{
return landRoadVeRecordMapper.insert(record);
}
/**
* 新增
*
* @param record the record
* @return
*/
@Override
public ResultJson insertSelective(LandRoadVeRecord record)
{
ResultJson validateAdd = validate(record);
if (!Common.RESULT_SUCCESS.equals(validateAdd.getCode())) {
return validateAdd;
}
record.setId(IdUtils.generateId());
return landRoadVeRecordMapper.insertSelective(record) > 0
? new ResultJson<>("200", "添加车辆信息,成功")
: new ResultJson<>("500", "添加车辆信息,失败");
}
@Override
public LandRoadVeRecord selectByPrimaryKey(String id)
{
return landRoadVeRecordMapper.selectByPrimaryKey(id);
}
/**
* 选择性编辑,By 主键
*
* @param record the updated record
* @return
*/
@Override
public ResultJson updateByPrimaryKeySelective(LandRoadVeRecord record)
{
ResultJson validateEdit = validate(record);
if (!Common.RESULT_SUCCESS.equals(validateEdit.getCode())) {
return validateEdit;
}
return landRoadVeRecordMapper.updateByPrimaryKeySelective(record) > 0
? new ResultJson<>("200", "编辑车辆信息,成功")
: new ResultJson<>("500", "编辑车辆信息,失败");
}
@Override
public int updateByPrimaryKey(LandRoadVeRecord record)
{
return landRoadVeRecordMapper.updateByPrimaryKey(record);
}
/**
* 使用 PageHelper 插件,实现分页查询
*
* @param landRoadVeRecord 车辆信息 {@link LandRoadVeRecord}
* @param pageNum 当前页数
* @param pageSize 每页大小
* @return
*/
@Override
public ResultJson selectListByPage(LandRoadVeRecord landRoadVeRecord, Integer pageNum, Integer pageSize)
{
PageHelper.startPage(pageNum, pageSize);
List<LandRoadVeRecord> landRoadVeRecordList = landRoadVeRecordMapper.selectListByPage(landRoadVeRecord);
PageInfo<LandRoadVeRecord> pageInfo = new PageInfo<>(landRoadVeRecordList);
return pageInfo.getTotal() >= 0
? new ResultJson<>("200", "查询车辆信息列表,成功!", pageInfo)
: new ResultJson<>("500", "查询车辆信息列表,失败!");
}
/**
* 新增 or 编辑
* 校验,国内车牌号唯一
*
* @param landRoadVeRecord {@link LandRoadVeRecord}
* @return
*/
private ResultJson validate(LandRoadVeRecord landRoadVeRecord)
{
String id = landRoadVeRecord.getId();
String domesticLisenceNo = landRoadVeRecord.getDomesticLisenceNo();
if (StringUtil.isNullOrEmpty(domesticLisenceNo)) {
return new ResultJson<>("400", "国内车牌号,不能为空!");
}
return StringUtil.isNullOrEmpty(id) ? validateInsert(domesticLisenceNo) : validateEdit(id, domesticLisenceNo);
}
/**
* 编辑,检验
*
* @param id 主键
* @param domesticLisenceNo 国内车牌号
* @return
*/
private ResultJson validateEdit(String id, String domesticLisenceNo)
{
LandRoadVeRecord oldVe = landRoadVeRecordMapper.selectByDomesticLisenceNo(id);
if (oldVe == null) {
return new ResultJson<>("400", "该车辆信息不存在");
}
if (!domesticLisenceNo.equals(oldVe.getDomesticLisenceNo())) {
if (landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo) != null) {
return new ResultJson<>("400", "该车辆信息,已存在");
}
}
return ResultJson.success("校验通过");
}
/**
* 新增,校验
* 国内车牌号,是否存在
*
* @param domesticLisenceNo 国内车牌号
* @return
*/
private ResultJson validateInsert(String domesticLisenceNo)
{
LandRoadVeRecord landRoadVeRecord = landRoadVeRecordMapper.selectByDomesticLisenceNo(domesticLisenceNo);
if (landRoadVeRecord == null) {
ResultJson.error("400", "校验失败");
}
return ResultJson.success("校验通过");
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.utils;
/**
* @author 子诚
* Description:生成雪花算法唯一id
* 时间:2020/7/1 9:26
*/
public class IdUtils {
/**
* 静态工具类
*
* @return id
*/
public static synchronized String generateId() {
IdWorker idWorker = new IdWorker();
long nextId = idWorker.nextId();
String id = String.valueOf(nextId);
return id;
}
public static void main(String[] args) {
System.out.println(com.sunyo.wlpt.vehicle.manage.utils.IdUtils.generateId());
System.out.println(com.sunyo.wlpt.vehicle.manage.utils.IdUtils.generateId().length());
}
}
... ...
package com.sunyo.wlpt.vehicle.manage.utils;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;
/**
* @author 子诚
* Description:雪花算法生成唯一ID
* 时间:2020/6/30 19:19
*/
public final class IdWorker {
/**
* 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
*/
private final static long TWEPOCH = 1288834974657L;
/**
* 机器标识位数
*/
private final static long WORKER_ID_BITS = 5L;
/**
* 数据中心标识位数
*/
private final static long DATA_CENTER_ID_BITS = 5L;
/**
* 机器ID最大值
*/
private final static long MAX_WORKER_ID = ~(-1L << WORKER_ID_BITS);
/**
* 数据中心ID最大值
*/
private final static long MAX_DATA_CENTER_ID = ~(-1L << DATA_CENTER_ID_BITS);
/**
* 毫秒内自增位
*/
private final static long SEQUENCE_BITS = 12L;
/**
* 机器ID偏左移12位
*/
private final static long WORKER_ID_SHIFT = SEQUENCE_BITS;
/**
* 数据中心ID左移17位
*/
private final static long DATA_CENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
/**
* 时间毫秒左移22位
*/
private final static long TIME_STAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATA_CENTER_ID_BITS;
private final static long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
/**
* 上次生产id时间戳
*/
private static long LAST_TIME_STAMP = -1L;
/**
* 0,并发控制
*/
private long sequence = 0L;
private final long workerId;
/**
* 数据标识id部分
*/
private final long DATA_CENTER_ID;
public IdWorker() {
this.DATA_CENTER_ID = getDatacenterId(MAX_DATA_CENTER_ID);
this.workerId = getMaxWorkerId(DATA_CENTER_ID, MAX_WORKER_ID);
}
public IdWorker(long workerId, long datacenterId) {
if (workerId > MAX_WORKER_ID || workerId < 0) {
throw new IllegalArgumentException(String.format("id不能大于最大值 %d 或者小于 0", MAX_WORKER_ID));
}
if (datacenterId > MAX_DATA_CENTER_ID || datacenterId < 0) {
throw new IllegalArgumentException(String.format("数据中心id不能大于最大值 %d 或者小于 0", MAX_DATA_CENTER_ID));
}
this.workerId = workerId;
this.DATA_CENTER_ID = datacenterId;
}
/**
* 获取下一个ID
*
* @return id
*/
public synchronized long nextId() {
long timestamp = timeGen();
if (timestamp < LAST_TIME_STAMP) {
throw new RuntimeException(String.format("时间生成异常 %d", LAST_TIME_STAMP - timestamp));
}
if (LAST_TIME_STAMP == timestamp) {
// 当前毫秒内,则+1
sequence = (sequence + 1) & SEQUENCE_MASK;
if (sequence == 0) {
// 当前毫秒内计数满了,则等待下一秒
timestamp = tilNextMillis(LAST_TIME_STAMP);
}
} else {
sequence = 0L;
}
LAST_TIME_STAMP = timestamp;
// ID偏移组合生成最终的ID,并返回ID
return ((timestamp - TWEPOCH) << TIME_STAMP_LEFT_SHIFT)
| (DATA_CENTER_ID << DATA_CENTER_ID_SHIFT)
| (workerId << WORKER_ID_SHIFT) | sequence;
}
private long tilNextMillis(final long lastTimestamp) {
long timestamp = this.timeGen();
while (timestamp <= lastTimestamp) {
timestamp = this.timeGen();
}
return timestamp;
}
private long timeGen() {
return System.currentTimeMillis();
}
/**
* <p>
* 获取 maxWorkerId
* </p>
*/
private static long getMaxWorkerId(long dataCenterId, long maxWorkerId) {
StringBuilder mpid = new StringBuilder();
mpid.append(dataCenterId);
String name = ManagementFactory.getRuntimeMXBean().getName();
if (!name.isEmpty()) {
/*
* GET jvmPid
*/
mpid.append(name.split("@")[0]);
}
/*
* MAC + PID 的 hashcode 获取16个低位
*/
return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
}
/**
* <p>
* 数据标识id部分
* </p>
*/
private static long getDatacenterId(long maxDatacenterId) {
long id = 0L;
try {
InetAddress ip = InetAddress.getLocalHost();
NetworkInterface network = NetworkInterface.getByInetAddress(ip);
if (network == null) {
id = 1L;
} else {
byte[] mac = network.getHardwareAddress();
id = ((0x000000FF & (long) mac[mac.length - 1])
| (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;
id = id % (maxDatacenterId + 1);
}
} catch (Exception e) {
System.out.println(" getDatacenterId: " + e.getMessage());
}
return id;
}
/**
* 静态工具类
*
* @return id
public static synchronized String generateId() {
String id = String.valueOf(new IdWorker().nextId());
return id;
}
*/
/**
* 测试
public static void main(String[] args) {
System.out.println("当前时间戳:" + System.currentTimeMillis());
for (int i = 0; i < 10; i++) {
//生成唯一雪花id
String id = IdWorker.generateId();
System.out.println("第" + i + "个:" + id + ";长度为:" + id.length());
}
}
*/
}
... ...
<?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.LandRoadVeRecordMapper">
<cache type="com.sunyo.wlpt.vehicle.manage.cache.RedisCache"/>
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord">
<!--@mbg.generated-->
<!--@Table land_road_ve_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="CO_CODE" jdbcType="VARCHAR" property="coCode"/>
<result column="VE_TARGET_NO" jdbcType="VARCHAR" property="veTargetNo"/>
<result column="DOMESTIC_LISENCE_NO" jdbcType="VARCHAR" property="domesticLisenceNo"/>
<result column="DOMESTIC_LICENSE_COLOR" jdbcType="VARCHAR" property="domesticLicenseColor"/>
<result column="FOREIGN_LICENSE" jdbcType="VARCHAR" property="foreignLicense"/>
<result column="VE_REG_PLACE" jdbcType="VARCHAR" property="veRegPlace"/>
<result column="VE_PROPERTY" jdbcType="VARCHAR" property="veProperty"/>
<result column="VE_CONVEY_QUA" jdbcType="VARCHAR" property="veConveyQua"/>
<result column="VE_CARD_NO" jdbcType="VARCHAR" property="veCardNo"/>
<result column="VE_OWNER_NAME" jdbcType="VARCHAR" property="veOwnerName"/>
<result column="VE_OWNER_NO" jdbcType="VARCHAR" property="veOwnerNo"/>
<result column="OWNER_INSIDE_ADDR" jdbcType="VARCHAR" property="ownerInsideAddr"/>
<result column="OWNER_INSIDE_TEL" jdbcType="VARCHAR" property="ownerInsideTel"/>
<result column="VE_TYPE" jdbcType="VARCHAR" property="veType"/>
<result column="BRAND" jdbcType="VARCHAR" property="brand"/>
<result column="MODEL" jdbcType="VARCHAR" property="model"/>
<result column="EXHAUST_CAPACITY" jdbcType="VARCHAR" property="exhaustCapacity"/>
<result column="VE_FACTORY_DATE" jdbcType="DATE" property="veFactoryDate"/>
<result column="VE_MOTOR_NO" jdbcType="VARCHAR" property="veMotorNo"/>
<result column="VE_FRAME_NO" jdbcType="VARCHAR" property="veFrameNo"/>
<result column="VE_TON" jdbcType="VARCHAR" property="veTon"/>
<result column="SELF_WT" jdbcType="VARCHAR" property="selfWt"/>
<result column="ALLOW_TOW_TOTAL_WT" jdbcType="VARCHAR" property="allowTowTotalWt"/>
<result column="CONTAINER_INNER_LENGTH" jdbcType="VARCHAR" property="containerInnerLength"/>
<result column="CONTAINER_INNER_WIDTH" jdbcType="VARCHAR" property="containerInnerWidth"/>
<result column="CONTAINER_INNER_HEIGHT" jdbcType="VARCHAR" property="containerInnerHeight"/>
<result column="OUTER_LENGTH" jdbcType="VARCHAR" property="outerLength"/>
<result column="OUTER_WIDTH" jdbcType="VARCHAR" property="outerWidth"/>
<result column="OUTER_HEIGHT" jdbcType="VARCHAR" property="outerHeight"/>
<result column="VE_BODY_COLOR" jdbcType="VARCHAR" property="veBodyColor"/>
<result column="OIL_BOX_CAPCITY" jdbcType="VARCHAR" property="oilBoxCapcity"/>
<result column="ALLOW_VE_IE_PORT" jdbcType="VARCHAR" property="allowVeIePort"/>
<result column="APPR_NO" jdbcType="VARCHAR" property="apprNo"/>
<result column="APPR_PERIOD" jdbcType="DATE" property="apprPeriod"/>
<result column="CURR_APPLY_BUSSINESS" jdbcType="VARCHAR" property="currApplyBussiness"/>
<result column="FRONT_45C_PIC" jdbcType="VARCHAR" property="front45cPic"/>
<result column="BACK_45C_PIC" jdbcType="VARCHAR" property="back45cPic"/>
<result column="OIL_BOX_PIC" jdbcType="VARCHAR" property="oilBoxPic"/>
<result column="VE_BOTTOM_PIC" jdbcType="VARCHAR" property="veBottomPic"/>
<result column="MEMO" jdbcType="VARCHAR" property="memo"/>
<result column="PROPOSER" jdbcType="VARCHAR" property="proposer"/>
<result column="PROPOSE_TIME" jdbcType="TIMESTAMP" property="proposeTime"/>
<result column="VE_CLASS_FLAG" jdbcType="VARCHAR" property="veClassFlag"/>
<result column="OPERATION_TYPE" jdbcType="VARCHAR" property="operationType"/>
<result column="TRAILER_LICENSE_NO" jdbcType="VARCHAR" property="trailerLicenseNo"/>
<result column="TRAILER_FRAME_NO" jdbcType="VARCHAR" property="trailerFrameNo"/>
<result column="APPRO_NO_PIC" jdbcType="VARCHAR" property="approNoPic"/>
<result column="VE_FRAME_NO_PIC" jdbcType="VARCHAR" property="veFrameNoPic"/>
<result column="MOTOR_NO_PIC" jdbcType="VARCHAR" property="motorNoPic"/>
<result column="FOREIGN_LICENSE_PIC" jdbcType="VARCHAR" property="foreignLicensePic"/>
<result column="NATIONALITY" jdbcType="VARCHAR" property="nationality"/>
<result column="RETURNMESSAGE" jdbcType="VARCHAR" property="returnmessage"/>
<result column="BARCODE" jdbcType="VARCHAR" property="barcode"/>
<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"/>
<result column="VE_FREE_TIME" jdbcType="TIMESTAMP" property="veFreeTime"/>
<result column="VE_PRIORITY" jdbcType="INTEGER" property="vePriority"/>
<result column="VE_STATE" jdbcType="VARCHAR" property="veState"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
ID, EPORT_ID, MAIN_PORT, CO_CODE, VE_TARGET_NO, DOMESTIC_LISENCE_NO, DOMESTIC_LICENSE_COLOR,
FOREIGN_LICENSE, VE_REG_PLACE, VE_PROPERTY, VE_CONVEY_QUA, VE_CARD_NO, VE_OWNER_NAME,
VE_OWNER_NO, OWNER_INSIDE_ADDR, OWNER_INSIDE_TEL, VE_TYPE, BRAND, MODEL, EXHAUST_CAPACITY,
VE_FACTORY_DATE, VE_MOTOR_NO, VE_FRAME_NO, VE_TON, SELF_WT, ALLOW_TOW_TOTAL_WT, CONTAINER_INNER_LENGTH,
CONTAINER_INNER_WIDTH, CONTAINER_INNER_HEIGHT, OUTER_LENGTH, OUTER_WIDTH, OUTER_HEIGHT,
VE_BODY_COLOR, OIL_BOX_CAPCITY, ALLOW_VE_IE_PORT, APPR_NO, APPR_PERIOD, CURR_APPLY_BUSSINESS,
FRONT_45C_PIC, BACK_45C_PIC, OIL_BOX_PIC, VE_BOTTOM_PIC, MEMO, PROPOSER, PROPOSE_TIME,
VE_CLASS_FLAG, OPERATION_TYPE, TRAILER_LICENSE_NO, TRAILER_FRAME_NO, APPRO_NO_PIC,
VE_FRAME_NO_PIC, MOTOR_NO_PIC, FOREIGN_LICENSE_PIC, NATIONALITY, RETURNMESSAGE, BARCODE,
CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE, VE_FREE_TIME, VE_PRIORITY, VE_STATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from land_road_ve_record
where ID = #{id,jdbcType=VARCHAR}
</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 id="selectListByPage" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from land_road_ve_record
<where>
<!-- 国内车牌号 -->
<if test="domesticLisenceNo != null and domesticLisenceNo != ''">
DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR}
</if>
<!-- 车辆类型 -->
<if test="veType != null and veType != ''">
AND VE_TYPE = #{veType,jdbcType=VARCHAR}
</if>
<!-- 车辆状态 -->
<if test="veState != null and veState != ''">
AND VE_STATE = #{veState,jdbcType=VARCHAR}
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete
from land_road_ve_record
where ID = #{id,jdbcType=VARCHAR}
</delete>
<delete id="batchRemoveByIds" parameterType="java.lang.String">
<!--@mbg.generated-->
delete
from land_road_ve_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.LandRoadVeRecord">
<!--@mbg.generated-->
insert into land_road_ve_record (ID, EPORT_ID, MAIN_PORT,
CO_CODE, VE_TARGET_NO, DOMESTIC_LISENCE_NO,
DOMESTIC_LICENSE_COLOR, FOREIGN_LICENSE, VE_REG_PLACE,
VE_PROPERTY, VE_CONVEY_QUA, VE_CARD_NO,
VE_OWNER_NAME, VE_OWNER_NO, OWNER_INSIDE_ADDR,
OWNER_INSIDE_TEL, VE_TYPE, BRAND,
MODEL, EXHAUST_CAPACITY, VE_FACTORY_DATE,
VE_MOTOR_NO, VE_FRAME_NO, VE_TON,
SELF_WT, ALLOW_TOW_TOTAL_WT, CONTAINER_INNER_LENGTH,
CONTAINER_INNER_WIDTH, CONTAINER_INNER_HEIGHT,
OUTER_LENGTH, OUTER_WIDTH, OUTER_HEIGHT,
VE_BODY_COLOR, OIL_BOX_CAPCITY, ALLOW_VE_IE_PORT,
APPR_NO, APPR_PERIOD, CURR_APPLY_BUSSINESS,
FRONT_45C_PIC, BACK_45C_PIC, OIL_BOX_PIC,
VE_BOTTOM_PIC, MEMO, PROPOSER,
PROPOSE_TIME, VE_CLASS_FLAG, OPERATION_TYPE,
TRAILER_LICENSE_NO, TRAILER_FRAME_NO, APPRO_NO_PIC,
VE_FRAME_NO_PIC, MOTOR_NO_PIC, FOREIGN_LICENSE_PIC,
NATIONALITY, RETURNMESSAGE, BARCODE,
CREATE_BY, CREATE_DATE, UPDATE_BY,
UPDATE_DATE, VE_FREE_TIME, VE_PRIORITY,
VE_STATE)
values (#{id,jdbcType=VARCHAR}, #{eportId,jdbcType=VARCHAR}, #{mainPort,jdbcType=VARCHAR},
#{coCode,jdbcType=VARCHAR}, #{veTargetNo,jdbcType=VARCHAR}, #{domesticLisenceNo,jdbcType=VARCHAR},
#{domesticLicenseColor,jdbcType=VARCHAR}, #{foreignLicense,jdbcType=VARCHAR}, #{veRegPlace,jdbcType=VARCHAR},
#{veProperty,jdbcType=VARCHAR}, #{veConveyQua,jdbcType=VARCHAR}, #{veCardNo,jdbcType=VARCHAR},
#{veOwnerName,jdbcType=VARCHAR}, #{veOwnerNo,jdbcType=VARCHAR}, #{ownerInsideAddr,jdbcType=VARCHAR},
#{ownerInsideTel,jdbcType=VARCHAR}, #{veType,jdbcType=VARCHAR}, #{brand,jdbcType=VARCHAR},
#{model,jdbcType=VARCHAR}, #{exhaustCapacity,jdbcType=VARCHAR}, #{veFactoryDate,jdbcType=DATE},
#{veMotorNo,jdbcType=VARCHAR}, #{veFrameNo,jdbcType=VARCHAR}, #{veTon,jdbcType=VARCHAR},
#{selfWt,jdbcType=VARCHAR}, #{allowTowTotalWt,jdbcType=VARCHAR}, #{containerInnerLength,jdbcType=VARCHAR},
#{containerInnerWidth,jdbcType=VARCHAR}, #{containerInnerHeight,jdbcType=VARCHAR},
#{outerLength,jdbcType=VARCHAR}, #{outerWidth,jdbcType=VARCHAR}, #{outerHeight,jdbcType=VARCHAR},
#{veBodyColor,jdbcType=VARCHAR}, #{oilBoxCapcity,jdbcType=VARCHAR}, #{allowVeIePort,jdbcType=VARCHAR},
#{apprNo,jdbcType=VARCHAR}, #{apprPeriod,jdbcType=DATE}, #{currApplyBussiness,jdbcType=VARCHAR},
#{front45cPic,jdbcType=VARCHAR}, #{back45cPic,jdbcType=VARCHAR}, #{oilBoxPic,jdbcType=VARCHAR},
#{veBottomPic,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{proposer,jdbcType=VARCHAR},
#{proposeTime,jdbcType=TIMESTAMP}, #{veClassFlag,jdbcType=VARCHAR}, #{operationType,jdbcType=VARCHAR},
#{trailerLicenseNo,jdbcType=VARCHAR}, #{trailerFrameNo,jdbcType=VARCHAR}, #{approNoPic,jdbcType=VARCHAR},
#{veFrameNoPic,jdbcType=VARCHAR}, #{motorNoPic,jdbcType=VARCHAR}, #{foreignLicensePic,jdbcType=VARCHAR},
#{nationality,jdbcType=VARCHAR}, #{returnmessage,jdbcType=VARCHAR}, #{barcode,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateDate,jdbcType=TIMESTAMP}, #{veFreeTime,jdbcType=TIMESTAMP}, #{vePriority,jdbcType=INTEGER},
#{veState,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord">
<!--@mbg.generated-->
insert into land_road_ve_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="coCode != null">
CO_CODE,
</if>
<if test="veTargetNo != null">
VE_TARGET_NO,
</if>
<if test="domesticLisenceNo != null">
DOMESTIC_LISENCE_NO,
</if>
<if test="domesticLicenseColor != null">
DOMESTIC_LICENSE_COLOR,
</if>
<if test="foreignLicense != null">
FOREIGN_LICENSE,
</if>
<if test="veRegPlace != null">
VE_REG_PLACE,
</if>
<if test="veProperty != null">
VE_PROPERTY,
</if>
<if test="veConveyQua != null">
VE_CONVEY_QUA,
</if>
<if test="veCardNo != null">
VE_CARD_NO,
</if>
<if test="veOwnerName != null">
VE_OWNER_NAME,
</if>
<if test="veOwnerNo != null">
VE_OWNER_NO,
</if>
<if test="ownerInsideAddr != null">
OWNER_INSIDE_ADDR,
</if>
<if test="ownerInsideTel != null">
OWNER_INSIDE_TEL,
</if>
<if test="veType != null">
VE_TYPE,
</if>
<if test="brand != null">
BRAND,
</if>
<if test="model != null">
MODEL,
</if>
<if test="exhaustCapacity != null">
EXHAUST_CAPACITY,
</if>
<if test="veFactoryDate != null">
VE_FACTORY_DATE,
</if>
<if test="veMotorNo != null">
VE_MOTOR_NO,
</if>
<if test="veFrameNo != null">
VE_FRAME_NO,
</if>
<if test="veTon != null">
VE_TON,
</if>
<if test="selfWt != null">
SELF_WT,
</if>
<if test="allowTowTotalWt != null">
ALLOW_TOW_TOTAL_WT,
</if>
<if test="containerInnerLength != null">
CONTAINER_INNER_LENGTH,
</if>
<if test="containerInnerWidth != null">
CONTAINER_INNER_WIDTH,
</if>
<if test="containerInnerHeight != null">
CONTAINER_INNER_HEIGHT,
</if>
<if test="outerLength != null">
OUTER_LENGTH,
</if>
<if test="outerWidth != null">
OUTER_WIDTH,
</if>
<if test="outerHeight != null">
OUTER_HEIGHT,
</if>
<if test="veBodyColor != null">
VE_BODY_COLOR,
</if>
<if test="oilBoxCapcity != null">
OIL_BOX_CAPCITY,
</if>
<if test="allowVeIePort != null">
ALLOW_VE_IE_PORT,
</if>
<if test="apprNo != null">
APPR_NO,
</if>
<if test="apprPeriod != null">
APPR_PERIOD,
</if>
<if test="currApplyBussiness != null">
CURR_APPLY_BUSSINESS,
</if>
<if test="front45cPic != null">
FRONT_45C_PIC,
</if>
<if test="back45cPic != null">
BACK_45C_PIC,
</if>
<if test="oilBoxPic != null">
OIL_BOX_PIC,
</if>
<if test="veBottomPic != null">
VE_BOTTOM_PIC,
</if>
<if test="memo != null">
MEMO,
</if>
<if test="proposer != null">
PROPOSER,
</if>
<if test="proposeTime != null">
PROPOSE_TIME,
</if>
<if test="veClassFlag != null">
VE_CLASS_FLAG,
</if>
<if test="operationType != null">
OPERATION_TYPE,
</if>
<if test="trailerLicenseNo != null">
TRAILER_LICENSE_NO,
</if>
<if test="trailerFrameNo != null">
TRAILER_FRAME_NO,
</if>
<if test="approNoPic != null">
APPRO_NO_PIC,
</if>
<if test="veFrameNoPic != null">
VE_FRAME_NO_PIC,
</if>
<if test="motorNoPic != null">
MOTOR_NO_PIC,
</if>
<if test="foreignLicensePic != null">
FOREIGN_LICENSE_PIC,
</if>
<if test="nationality != null">
NATIONALITY,
</if>
<if test="returnmessage != null">
RETURNMESSAGE,
</if>
<if test="barcode != null">
BARCODE,
</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>
<if test="veFreeTime != null">
VE_FREE_TIME,
</if>
<if test="vePriority != null">
VE_PRIORITY,
</if>
<if test="veState != null">
VE_STATE,
</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="coCode != null">
#{coCode,jdbcType=VARCHAR},
</if>
<if test="veTargetNo != null">
#{veTargetNo,jdbcType=VARCHAR},
</if>
<if test="domesticLisenceNo != null">
#{domesticLisenceNo,jdbcType=VARCHAR},
</if>
<if test="domesticLicenseColor != null">
#{domesticLicenseColor,jdbcType=VARCHAR},
</if>
<if test="foreignLicense != null">
#{foreignLicense,jdbcType=VARCHAR},
</if>
<if test="veRegPlace != null">
#{veRegPlace,jdbcType=VARCHAR},
</if>
<if test="veProperty != null">
#{veProperty,jdbcType=VARCHAR},
</if>
<if test="veConveyQua != null">
#{veConveyQua,jdbcType=VARCHAR},
</if>
<if test="veCardNo != null">
#{veCardNo,jdbcType=VARCHAR},
</if>
<if test="veOwnerName != null">
#{veOwnerName,jdbcType=VARCHAR},
</if>
<if test="veOwnerNo != null">
#{veOwnerNo,jdbcType=VARCHAR},
</if>
<if test="ownerInsideAddr != null">
#{ownerInsideAddr,jdbcType=VARCHAR},
</if>
<if test="ownerInsideTel != null">
#{ownerInsideTel,jdbcType=VARCHAR},
</if>
<if test="veType != null">
#{veType,jdbcType=VARCHAR},
</if>
<if test="brand != null">
#{brand,jdbcType=VARCHAR},
</if>
<if test="model != null">
#{model,jdbcType=VARCHAR},
</if>
<if test="exhaustCapacity != null">
#{exhaustCapacity,jdbcType=VARCHAR},
</if>
<if test="veFactoryDate != null">
#{veFactoryDate,jdbcType=DATE},
</if>
<if test="veMotorNo != null">
#{veMotorNo,jdbcType=VARCHAR},
</if>
<if test="veFrameNo != null">
#{veFrameNo,jdbcType=VARCHAR},
</if>
<if test="veTon != null">
#{veTon,jdbcType=VARCHAR},
</if>
<if test="selfWt != null">
#{selfWt,jdbcType=VARCHAR},
</if>
<if test="allowTowTotalWt != null">
#{allowTowTotalWt,jdbcType=VARCHAR},
</if>
<if test="containerInnerLength != null">
#{containerInnerLength,jdbcType=VARCHAR},
</if>
<if test="containerInnerWidth != null">
#{containerInnerWidth,jdbcType=VARCHAR},
</if>
<if test="containerInnerHeight != null">
#{containerInnerHeight,jdbcType=VARCHAR},
</if>
<if test="outerLength != null">
#{outerLength,jdbcType=VARCHAR},
</if>
<if test="outerWidth != null">
#{outerWidth,jdbcType=VARCHAR},
</if>
<if test="outerHeight != null">
#{outerHeight,jdbcType=VARCHAR},
</if>
<if test="veBodyColor != null">
#{veBodyColor,jdbcType=VARCHAR},
</if>
<if test="oilBoxCapcity != null">
#{oilBoxCapcity,jdbcType=VARCHAR},
</if>
<if test="allowVeIePort != null">
#{allowVeIePort,jdbcType=VARCHAR},
</if>
<if test="apprNo != null">
#{apprNo,jdbcType=VARCHAR},
</if>
<if test="apprPeriod != null">
#{apprPeriod,jdbcType=DATE},
</if>
<if test="currApplyBussiness != null">
#{currApplyBussiness,jdbcType=VARCHAR},
</if>
<if test="front45cPic != null">
#{front45cPic,jdbcType=VARCHAR},
</if>
<if test="back45cPic != null">
#{back45cPic,jdbcType=VARCHAR},
</if>
<if test="oilBoxPic != null">
#{oilBoxPic,jdbcType=VARCHAR},
</if>
<if test="veBottomPic != null">
#{veBottomPic,jdbcType=VARCHAR},
</if>
<if test="memo != null">
#{memo,jdbcType=VARCHAR},
</if>
<if test="proposer != null">
#{proposer,jdbcType=VARCHAR},
</if>
<if test="proposeTime != null">
#{proposeTime,jdbcType=TIMESTAMP},
</if>
<if test="veClassFlag != null">
#{veClassFlag,jdbcType=VARCHAR},
</if>
<if test="operationType != null">
#{operationType,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNo != null">
#{trailerLicenseNo,jdbcType=VARCHAR},
</if>
<if test="trailerFrameNo != null">
#{trailerFrameNo,jdbcType=VARCHAR},
</if>
<if test="approNoPic != null">
#{approNoPic,jdbcType=VARCHAR},
</if>
<if test="veFrameNoPic != null">
#{veFrameNoPic,jdbcType=VARCHAR},
</if>
<if test="motorNoPic != null">
#{motorNoPic,jdbcType=VARCHAR},
</if>
<if test="foreignLicensePic != null">
#{foreignLicensePic,jdbcType=VARCHAR},
</if>
<if test="nationality != null">
#{nationality,jdbcType=VARCHAR},
</if>
<if test="returnmessage != null">
#{returnmessage,jdbcType=VARCHAR},
</if>
<if test="barcode != null">
#{barcode,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>
<if test="veFreeTime != null">
#{veFreeTime,jdbcType=TIMESTAMP},
</if>
<if test="vePriority != null">
#{vePriority,jdbcType=INTEGER},
</if>
<if test="veState != null">
#{veState,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord">
<!--@mbg.generated-->
update land_road_ve_record
<set>
<if test="eportId != null">
EPORT_ID = #{eportId,jdbcType=VARCHAR},
</if>
<if test="mainPort != null">
MAIN_PORT = #{mainPort,jdbcType=VARCHAR},
</if>
<if test="coCode != null">
CO_CODE = #{coCode,jdbcType=VARCHAR},
</if>
<if test="veTargetNo != null">
VE_TARGET_NO = #{veTargetNo,jdbcType=VARCHAR},
</if>
<if test="domesticLisenceNo != null">
DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR},
</if>
<if test="domesticLicenseColor != null">
DOMESTIC_LICENSE_COLOR = #{domesticLicenseColor,jdbcType=VARCHAR},
</if>
<if test="foreignLicense != null">
FOREIGN_LICENSE = #{foreignLicense,jdbcType=VARCHAR},
</if>
<if test="veRegPlace != null">
VE_REG_PLACE = #{veRegPlace,jdbcType=VARCHAR},
</if>
<if test="veProperty != null">
VE_PROPERTY = #{veProperty,jdbcType=VARCHAR},
</if>
<if test="veConveyQua != null">
VE_CONVEY_QUA = #{veConveyQua,jdbcType=VARCHAR},
</if>
<if test="veCardNo != null">
VE_CARD_NO = #{veCardNo,jdbcType=VARCHAR},
</if>
<if test="veOwnerName != null">
VE_OWNER_NAME = #{veOwnerName,jdbcType=VARCHAR},
</if>
<if test="veOwnerNo != null">
VE_OWNER_NO = #{veOwnerNo,jdbcType=VARCHAR},
</if>
<if test="ownerInsideAddr != null">
OWNER_INSIDE_ADDR = #{ownerInsideAddr,jdbcType=VARCHAR},
</if>
<if test="ownerInsideTel != null">
OWNER_INSIDE_TEL = #{ownerInsideTel,jdbcType=VARCHAR},
</if>
<if test="veType != null">
VE_TYPE = #{veType,jdbcType=VARCHAR},
</if>
<if test="brand != null">
BRAND = #{brand,jdbcType=VARCHAR},
</if>
<if test="model != null">
MODEL = #{model,jdbcType=VARCHAR},
</if>
<if test="exhaustCapacity != null">
EXHAUST_CAPACITY = #{exhaustCapacity,jdbcType=VARCHAR},
</if>
<if test="veFactoryDate != null">
VE_FACTORY_DATE = #{veFactoryDate,jdbcType=DATE},
</if>
<if test="veMotorNo != null">
VE_MOTOR_NO = #{veMotorNo,jdbcType=VARCHAR},
</if>
<if test="veFrameNo != null">
VE_FRAME_NO = #{veFrameNo,jdbcType=VARCHAR},
</if>
<if test="veTon != null">
VE_TON = #{veTon,jdbcType=VARCHAR},
</if>
<if test="selfWt != null">
SELF_WT = #{selfWt,jdbcType=VARCHAR},
</if>
<if test="allowTowTotalWt != null">
ALLOW_TOW_TOTAL_WT = #{allowTowTotalWt,jdbcType=VARCHAR},
</if>
<if test="containerInnerLength != null">
CONTAINER_INNER_LENGTH = #{containerInnerLength,jdbcType=VARCHAR},
</if>
<if test="containerInnerWidth != null">
CONTAINER_INNER_WIDTH = #{containerInnerWidth,jdbcType=VARCHAR},
</if>
<if test="containerInnerHeight != null">
CONTAINER_INNER_HEIGHT = #{containerInnerHeight,jdbcType=VARCHAR},
</if>
<if test="outerLength != null">
OUTER_LENGTH = #{outerLength,jdbcType=VARCHAR},
</if>
<if test="outerWidth != null">
OUTER_WIDTH = #{outerWidth,jdbcType=VARCHAR},
</if>
<if test="outerHeight != null">
OUTER_HEIGHT = #{outerHeight,jdbcType=VARCHAR},
</if>
<if test="veBodyColor != null">
VE_BODY_COLOR = #{veBodyColor,jdbcType=VARCHAR},
</if>
<if test="oilBoxCapcity != null">
OIL_BOX_CAPCITY = #{oilBoxCapcity,jdbcType=VARCHAR},
</if>
<if test="allowVeIePort != null">
ALLOW_VE_IE_PORT = #{allowVeIePort,jdbcType=VARCHAR},
</if>
<if test="apprNo != null">
APPR_NO = #{apprNo,jdbcType=VARCHAR},
</if>
<if test="apprPeriod != null">
APPR_PERIOD = #{apprPeriod,jdbcType=DATE},
</if>
<if test="currApplyBussiness != null">
CURR_APPLY_BUSSINESS = #{currApplyBussiness,jdbcType=VARCHAR},
</if>
<if test="front45cPic != null">
FRONT_45C_PIC = #{front45cPic,jdbcType=VARCHAR},
</if>
<if test="back45cPic != null">
BACK_45C_PIC = #{back45cPic,jdbcType=VARCHAR},
</if>
<if test="oilBoxPic != null">
OIL_BOX_PIC = #{oilBoxPic,jdbcType=VARCHAR},
</if>
<if test="veBottomPic != null">
VE_BOTTOM_PIC = #{veBottomPic,jdbcType=VARCHAR},
</if>
<if test="memo != null">
MEMO = #{memo,jdbcType=VARCHAR},
</if>
<if test="proposer != null">
PROPOSER = #{proposer,jdbcType=VARCHAR},
</if>
<if test="proposeTime != null">
PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP},
</if>
<if test="veClassFlag != null">
VE_CLASS_FLAG = #{veClassFlag,jdbcType=VARCHAR},
</if>
<if test="operationType != null">
OPERATION_TYPE = #{operationType,jdbcType=VARCHAR},
</if>
<if test="trailerLicenseNo != null">
TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR},
</if>
<if test="trailerFrameNo != null">
TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR},
</if>
<if test="approNoPic != null">
APPRO_NO_PIC = #{approNoPic,jdbcType=VARCHAR},
</if>
<if test="veFrameNoPic != null">
VE_FRAME_NO_PIC = #{veFrameNoPic,jdbcType=VARCHAR},
</if>
<if test="motorNoPic != null">
MOTOR_NO_PIC = #{motorNoPic,jdbcType=VARCHAR},
</if>
<if test="foreignLicensePic != null">
FOREIGN_LICENSE_PIC = #{foreignLicensePic,jdbcType=VARCHAR},
</if>
<if test="nationality != null">
NATIONALITY = #{nationality,jdbcType=VARCHAR},
</if>
<if test="returnmessage != null">
RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR},
</if>
<if test="barcode != null">
BARCODE = #{barcode,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>
<if test="veFreeTime != null">
VE_FREE_TIME = #{veFreeTime,jdbcType=TIMESTAMP},
</if>
<if test="vePriority != null">
VE_PRIORITY = #{vePriority,jdbcType=INTEGER},
</if>
<if test="veState != null">
VE_STATE = #{veState,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.vehicle.manage.domain.LandRoadVeRecord">
<!--@mbg.generated-->
update land_road_ve_record
set EPORT_ID = #{eportId,jdbcType=VARCHAR},
MAIN_PORT = #{mainPort,jdbcType=VARCHAR},
CO_CODE = #{coCode,jdbcType=VARCHAR},
VE_TARGET_NO = #{veTargetNo,jdbcType=VARCHAR},
DOMESTIC_LISENCE_NO = #{domesticLisenceNo,jdbcType=VARCHAR},
DOMESTIC_LICENSE_COLOR = #{domesticLicenseColor,jdbcType=VARCHAR},
FOREIGN_LICENSE = #{foreignLicense,jdbcType=VARCHAR},
VE_REG_PLACE = #{veRegPlace,jdbcType=VARCHAR},
VE_PROPERTY = #{veProperty,jdbcType=VARCHAR},
VE_CONVEY_QUA = #{veConveyQua,jdbcType=VARCHAR},
VE_CARD_NO = #{veCardNo,jdbcType=VARCHAR},
VE_OWNER_NAME = #{veOwnerName,jdbcType=VARCHAR},
VE_OWNER_NO = #{veOwnerNo,jdbcType=VARCHAR},
OWNER_INSIDE_ADDR = #{ownerInsideAddr,jdbcType=VARCHAR},
OWNER_INSIDE_TEL = #{ownerInsideTel,jdbcType=VARCHAR},
VE_TYPE = #{veType,jdbcType=VARCHAR},
BRAND = #{brand,jdbcType=VARCHAR},
MODEL = #{model,jdbcType=VARCHAR},
EXHAUST_CAPACITY = #{exhaustCapacity,jdbcType=VARCHAR},
VE_FACTORY_DATE = #{veFactoryDate,jdbcType=DATE},
VE_MOTOR_NO = #{veMotorNo,jdbcType=VARCHAR},
VE_FRAME_NO = #{veFrameNo,jdbcType=VARCHAR},
VE_TON = #{veTon,jdbcType=VARCHAR},
SELF_WT = #{selfWt,jdbcType=VARCHAR},
ALLOW_TOW_TOTAL_WT = #{allowTowTotalWt,jdbcType=VARCHAR},
CONTAINER_INNER_LENGTH = #{containerInnerLength,jdbcType=VARCHAR},
CONTAINER_INNER_WIDTH = #{containerInnerWidth,jdbcType=VARCHAR},
CONTAINER_INNER_HEIGHT = #{containerInnerHeight,jdbcType=VARCHAR},
OUTER_LENGTH = #{outerLength,jdbcType=VARCHAR},
OUTER_WIDTH = #{outerWidth,jdbcType=VARCHAR},
OUTER_HEIGHT = #{outerHeight,jdbcType=VARCHAR},
VE_BODY_COLOR = #{veBodyColor,jdbcType=VARCHAR},
OIL_BOX_CAPCITY = #{oilBoxCapcity,jdbcType=VARCHAR},
ALLOW_VE_IE_PORT = #{allowVeIePort,jdbcType=VARCHAR},
APPR_NO = #{apprNo,jdbcType=VARCHAR},
APPR_PERIOD = #{apprPeriod,jdbcType=DATE},
CURR_APPLY_BUSSINESS = #{currApplyBussiness,jdbcType=VARCHAR},
FRONT_45C_PIC = #{front45cPic,jdbcType=VARCHAR},
BACK_45C_PIC = #{back45cPic,jdbcType=VARCHAR},
OIL_BOX_PIC = #{oilBoxPic,jdbcType=VARCHAR},
VE_BOTTOM_PIC = #{veBottomPic,jdbcType=VARCHAR},
MEMO = #{memo,jdbcType=VARCHAR},
PROPOSER = #{proposer,jdbcType=VARCHAR},
PROPOSE_TIME = #{proposeTime,jdbcType=TIMESTAMP},
VE_CLASS_FLAG = #{veClassFlag,jdbcType=VARCHAR},
OPERATION_TYPE = #{operationType,jdbcType=VARCHAR},
TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR},
TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR},
APPRO_NO_PIC = #{approNoPic,jdbcType=VARCHAR},
VE_FRAME_NO_PIC = #{veFrameNoPic,jdbcType=VARCHAR},
MOTOR_NO_PIC = #{motorNoPic,jdbcType=VARCHAR},
FOREIGN_LICENSE_PIC = #{foreignLicensePic,jdbcType=VARCHAR},
NATIONALITY = #{nationality,jdbcType=VARCHAR},
RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR},
BARCODE = #{barcode,jdbcType=VARCHAR},
CREATE_BY = #{createBy,jdbcType=VARCHAR},
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP},
VE_FREE_TIME = #{veFreeTime,jdbcType=TIMESTAMP},
VE_PRIORITY = #{vePriority,jdbcType=INTEGER},
VE_STATE = #{veState,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...