package com.ltgk.boat.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 船舶证书表
 * </p>
 *
 * @author songzh
 * @since 2022-06-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ds_boat_credential")
@ApiModel(value = "DsBoatCredential对象", description = "船舶证书表")
public class DsBoatCredential {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "船舶ID")
    @TableField("boat_id")
    private String boatId;
    @ApiModelProperty(value = "船名号")
    @TableField(value = "boat_name", condition = SqlCondition.LIKE)
    private String boatName;

    @ApiModelProperty(value = "证书类型")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "证书编号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "发证机关")
    @TableField("issue_authority")
    private String issueAuthority;

    @ApiModelProperty(value = "发证日期")
    @TableField("issue_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date issueDate;

    @ApiModelProperty(value = "证书状态 :正常、注销、证书过期、中止、未开始、即将过期")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "证书文件")
    @TableField("file")
    private String file;

    @ApiModelProperty(value = "证书开始时间")
    @TableField("credential_start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date credentialStartTime;

    @ApiModelProperty(value = "证书结束时间")
    @TableField("credential_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date credentialEndTime;

    @ApiModelProperty(value = "创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createAt;

    @ApiModelProperty(value = "编辑人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "编辑日期")
    @TableField("update_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateAt;

    @ApiModelProperty(value = "删除标志")
    @TableField("del_flag")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    /**
     * 有无证书 0无，1有
     */
    @TableField(exist = false)
    private String isHasCredentials;


    @ApiModelProperty(value = "行政区域编码")
    @TableField(value = "area_code")
    private String areaCode;

    @ApiModelProperty(value = "行政区域名称")
    @TableField(value = "area_name")
    private String areaName;

}
