package com.bohuikeji.delivery.backstage.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.api.R;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.constant.RegEx;
import com.bohuikeji.frame.module.admin.entity.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.sys.SysConfig;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 车辆信息表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TVehicleInformation对象", description="车辆信息表")
@TableName("t_vehicle_information")
public class TVehicleInformation extends EntityBase<TVehicleInformation> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "vehicle_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer vehicleId;

    @ApiModelProperty(value = "车牌号")
    @TableField("vehicle_number")
    @TableShowField(value = "车牌号")
    @TableNewField
    private String vehicleNumber;

    @ApiModelProperty(value = "驾驶证照片")
    @TableField("vehicle_drivers_license")
    @TableShowField(value = "驾驶证照片",type = ColumnTypeEnum.IMAGE,show = false)
    @TableNewField(block = FileBlock.class,required = false,edit = false,show = false)
    private String vehicleDriversLicense;

    @ApiModelProperty(value = "行驶证照片")
    @TableField("vehicle_driving_license")
    @TableShowField(value = "行驶证照片",type = ColumnTypeEnum.IMAGE,show = false)
    @TableNewField(block = FileBlock.class,required = false,edit = false,show = false)
    private String vehicleDrivingLicense;

    @ApiModelProperty(value = "运输许可证")
    @TableField("vehicle_transport_license")
    @TableShowField(value = "运输许可证",show = false)
    @TableNewField(required = false,edit = false,show = false)
    private String vehicleTransportLicense;

    @ApiModelProperty(value = "车架号")
    @TableField("vehicle_frame")
    @TableShowField(value = "车架号",show = false)
    @TableNewField(edit = false,show = false)
    private String vehicleFrame;

    @ApiModelProperty(value = "发动机号")
    @TableField("vehicle_engine")
    @TableShowField(value = "发动机号",show = false)
    @TableNewField(edit = false,show = false)
    private String vehicleEngine;

    @ApiModelProperty(value = "保险证")
    @TableField("vehicle_insurance")
    @TableShowField(value = "保险证",show = false)
    @TableNewField(edit = false,show = false)
    private String vehicleInsurance;

    @ApiModelProperty(value = "保险日期")
    @TableField("vehicle_insurance_date")
    @TableShowField(value = "保险日期",show = false)
    /*@TableNewField(edit = false,show = false)*/
    private LocalDate vehicleInsuranceDate;

    @ApiModelProperty(value = "年检日期")
    @TableField("vehicle_renewal")
    @TableShowField(value = "年检日期",show = false)
    /*@TableNewField(edit = false,show = false)*/
    private LocalDate vehicleRenewal;

    @ApiModelProperty(value = "车辆照片")
    @TableField("vehicle_picture")
    @TableShowField(value = "车辆照片",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false)
    private String vehiclePicture;

    @ApiModelProperty(value = "最大载量(KG)")
    @TableField("vehicle_max_weight")
    @TableShowField(value = "最大载量(KG)")
    @TableNewField(limit = RegEx.INTEGER)
    private Double vehicleMaxWeight;

    @ApiModelProperty(value = "车型宽度(米)")
    @TableField("vehicle_width")
    @TableShowField(value = "车型宽度(米)",show = false)
    @TableNewField(limit = RegEx.INTEGER,edit = false,show = false)
    private Double vehicleWidth;

    @ApiModelProperty(value = "载物高度(米)")
    @TableField("vehicle_carrier_height")
    @TableShowField(value = "载物高度(米)",show = false)
    @TableNewField(limit = RegEx.INTEGER,edit = false,show = false)
    private Double vehicleCarrierHeight;

    @ApiModelProperty(value = "百公里耗油")
    @TableField("vehicle_oil")
    @TableShowField(value = "耗油(L/100KM)",show = false)
    @TableNewField(limit = RegEx.INTEGER,required = false,edit = false,show = false)
    private Double vehicleOil;

    @ApiModelProperty(value = "备注")
    @TableField("vehicle_comment")
    @TableShowField(value = "备注",show = false)
    @TableNewField(block = TextBlock.class,required = false)
    private String vehicleComment;

    @ApiModelProperty(value = "车辆状态")
    @TableField("vehicle_status")
    @TableShowField("车辆状态")
    @TableNewField(options = {"正常","维修","脱保","扣押","报废"})
    @TableQueryField
    private String vehicleStatus="正常";

    @ApiModelProperty(value = "车辆状态(仅对派送员)")
    @TableField("auth_status")
    @TableShowField("车辆认证状态")
    @TableNewField(options = {"待认证","认证成功","认证失败"})
    @TableQueryField
    private String authStatus="待认证";

    @ApiModelProperty(value = "车辆名称")
    @TableField("vehicle_name")
    @TableShowField(value = "车辆名称")
    @TableNewField(required = false)
    private String vehicleName;

    @ApiModelProperty(value = "创建时间")
    @TableField("vehicle_create_time")
    @TableShowField("创建时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0)
    private LocalDateTime vehicleCreateTime=LocalDateTime.now();

    @ApiModelProperty(value = "更新时间")
    @TableField("vehicle_update_time")
    @TableShowField(value = "更新时间",show = false)
    private LocalDateTime vehicleUpdateTime=LocalDateTime.now();

    @ApiModelProperty(value = "车辆类型id")
    @TableField(value = "vehicle_type_id")
    @TableShowField(value = "车辆类型")
    @TableQueryField
    @TableKeyField(table = "sys_config",keyShowFields = {"config_name"},where = "config_id in (12,14,15)",key = SysConfig.class)
    @TableNewField(block = SelectBlock.class)
    private Integer vehicleTypeId;


    @ApiModelProperty(value = "所属派送员id")
    @TableField("courier_id")
    @TableShowField(value = "所属派送员")
    @TableNewField(block =SelectBlock.class,edit = false)
    @TableQueryField()
    @TableKeyField(table = "t_courier",keyShowFields = {"courier_name"},key = TCourier.class)
    private Integer courierId;

    @ApiModelProperty(value = "所属平台Id")
    @TableField("fran_id")
    @TableShowField(value = "车属机构",show = false)
    @TableNewField(block = SelectBlock.class,required = false)
    @TableQueryField
    @TableKeyField(table = "t_franchisee_information",keyShowFields = {"fran_name"},keyLikeFields = {"fran_name"},key = TFranchiseeInformation.class)
    private Integer franId;

}
