package com.njzscloud.supervisory.biz.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.njzscloud.supervisory.biz.constant.AuditStatus;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 司机信息
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName(value = "biz_driver", autoResultMap = true)
public class BizDriverEntity {

    /**
     * Id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 用户 Id; sys_user.id
     */
    private Long userId;

    /**
     * 清运公司 Id; biz_company.id
     */
    private Long companyId;

    /**
     * 清运公司名称; biz_company.company_name (联表查询字段，不映射到数据库)
     */
    @TableField(exist = false)
    private String companyName;

    /**
     * 司机名称
     */
    private String driverName;

    /**
     * 联系电话
     */
    private String phone;
    private Boolean busy;

    /**
     * 驾驶证; 图片
     */
    private String drivingLicence;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDate licenceStartTime;

    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDate licenceEndTime;

    /**
     * 创建人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long creatorId;

    /**
     * 修改人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long modifierId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;

    /**
     * 审核状态; 字典代码: audit_status
     */
    private AuditStatus auditStatus;

    /**
     * 审核备注
     */
    private String auditMemo;

    /**
     * 是否删除; 0-->未删除、1-->已删除
     */
    @TableLogic
    private Boolean deleted;

    /**
     * 驾驶证编号
     */
    private String drivingLicenceNo;

}
