/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.dmParkingTraffic.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhirong
* @date 2022-05-05
**/
@Entity
@Data
@Table(name="dm_parking_traffic")
public class DmParkingTraffic implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Integer id;

    @Column(name = "park_code")
    @ApiModelProperty(value = "停车场唯一标识")
    private String parkCode;

    @Column(name = "entrance_code")
    @ApiModelProperty(value = "出入口唯一标识")
    private String entranceCode;

    @Column(name = "entrance_name")
    @ApiModelProperty(value = "出入口名称")
    private String entranceName;

    @Column(name = "roadway_code")
    @ApiModelProperty(value = "车道唯一标识 通道/出入口信息")
    private String roadwayCode;

    @Column(name = "roadway_name")
    @ApiModelProperty(value = "车道名称")
    private String roadwayName;

    @Column(name = "plate_no")
    @ApiModelProperty(value = "车牌号码")
    private String plateNo;

    @Column(name = "plate_color")
    @ApiModelProperty(value = "车牌颜色")
    private String plateColor;

    @Column(name = "vehicle_out")
    @ApiModelProperty(value = "出入类型  0-进场，1-出场")
    private Integer vehicleOut;

    @Column(name = "vehicle_color")
    @ApiModelProperty(value = "车辆颜色")
    private Integer vehicleColor;

    @Column(name = "vehicle_type")
    @ApiModelProperty(value = "车辆类型       0：其他车  1：小型车  2：大型车  3：摩托车")
    private Integer vehicleType;

    @Column(name = "release_way")
    @ApiModelProperty(value = "放行方式   10-未开闸   11-自动开闸   12-人工/人工开闸   13-遥控器开闸")
    private Integer releaseWay;

    @Column(name = "release_result")
    @ApiModelProperty(value = "放行结果  0-未放行 1-正常放行 2-离线放行")
    private Integer releaseResult;

    @Column(name = "release_remark")
    @ApiModelProperty(value = "放行原因(备注)")
    private String releaseRemark;

    @Column(name = "cross_time")
    @ApiModelProperty(value = "入园时间/出园时间")
    private Timestamp crossTime;

    public void copy(DmParkingTraffic source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}