package com.ltgk.crew.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ltgk.common.validation.groups.Add;
import com.ltgk.common.validation.groups.Detail;
import com.ltgk.common.validation.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 船员证书对象 ds_crew_credential
 *
 * @author Qi ChengBin
 * @date 2024-12-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ds_crew_credential")
@ApiModel(value = "船员证书对象", description = "船员证书表")
public class DsCrewCredential extends Model<DsCrewCredential> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "船员证书主键")
    @NotBlank(message = "船员证书主键不能为空！", groups = {Update.class, Detail.class})
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "流水号")
    @TableField(value = "water_code")
    private String waterCode;

    @ApiModelProperty(value = "船员ID")
    @NotBlank(message = "船员主键不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "crew_id")
    private String crewId;

    @ApiModelProperty(value = "船员姓名")
    @NotBlank(message = "船员姓名不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "crew_name", condition = SqlCondition.LIKE)
    private String crewName;

    @ApiModelProperty(value = "身份证号")
    @TableField(value = "id_card_no", condition = SqlCondition.LIKE)
    private String idCardNo;

    @ApiModelProperty(value = "电话")
    @TableField(value = "phone", condition = SqlCondition.LIKE)
    private String phone;

    @ApiModelProperty(value = "证书类型")
    @NotBlank(message = "证书类型不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_type", condition = SqlCondition.LIKE)
    private String certificateType;

    @ApiModelProperty(value = "证书类型名称")
    @NotBlank(message = "证书类型名称不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_type_name", condition = SqlCondition.LIKE)
    private String certificateTypeName;

    @ApiModelProperty(value = "类别代码")
    @NotBlank(message = "类别代码不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "category_code")
    private String categoryCode;

    @ApiModelProperty(value = "类别名称")
    @NotBlank(message = "类别名称不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "category_name")
    private String categoryName;

    @ApiModelProperty(value = "证书种类代码")
    @NotBlank(message = "证书种类名称不能为空", groups = {Add.class, Update.class})
    @TableField(value = "certificate_kind_code", condition = SqlCondition.LIKE)
    private String certificateKindCode;

    @ApiModelProperty(value = "证书种类名称")
    @TableField(value = "certificate_kind_name", condition = SqlCondition.LIKE)
    private String certificateKindName;

    @ApiModelProperty(value = "船员证书等级")
    @NotBlank(message = "证书等级不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_level", condition = SqlCondition.LIKE)
    private String certificateLevel;

    @ApiModelProperty(value = "船员证书等级名称")
    @NotBlank(message = "证书等级名称不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_level_name")
    private String certificateLevelName;

    @ApiModelProperty(value = "证书职务")
    @NotBlank(message = "证书职务不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_post", condition = SqlCondition.LIKE)
    private String certificatePost;

    @ApiModelProperty(value = "证书职务名称")
    @TableField(value = "certificate_post_name", condition = SqlCondition.LIKE)
    @NotBlank(message = "证书职务名称不能为空！", groups = {Add.class, Update.class})
    private String certificatePostName;

    @ApiModelProperty(value = "适用船舶")
    @TableField(value = "apply_boat")
    private String applyBoat;

    @ApiModelProperty(value = "船员证书号码/证书编号")
    @NotBlank(message = "证书编号不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_code", condition = SqlCondition.LIKE)
    private String certificateCode;

    @ApiModelProperty(value = "证书照片")
    @TableField(value = "certificate_pic")
    private String certificatePic;

    @ApiModelProperty(value = "签发机关")
    @NotBlank(message = "签发机关不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_authority", condition = SqlCondition.LIKE)
    private String certificateAuthority;

    @ApiModelProperty(value = "签发机关名称")
    @NotBlank(message = "签发机关名称不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_authority_name", condition = SqlCondition.LIKE)
    private String certificateAuthorityName;

    @ApiModelProperty(value = "签发官员姓名")
    @NotBlank(message = "签发官员姓名不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_people")
    private String certificatePeople;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "签发日期")
    @NotNull(message = "签发日期不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_issued_date")
    private Date certificateIssuedDate;

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

    @ApiModelProperty(value = "截止日期")
    @NotBlank(message = "截至日期不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_expired_date")
    private String certificateExpiredDate;

    @ApiModelProperty(value = "证书状态:A-无效(待发证) 0-无效(到期) 1-有效 2-无效(换证) 3-无效(注销)")
    @NotBlank(message = "证书状态不能为空！", groups = {Add.class, Update.class})
    @TableField(value = "certificate_status", condition = SqlCondition.LIKE)
    private String certificateStatus;

    @ApiModelProperty(value = "档案号码")
    @TableField(value = "archives_code")
    private String archivesCode;

    @ApiModelProperty(value = "多职务标志(其它证书流水号，分号隔开)")
    @TableField(value = "many_positions_flag")
    private String manyPositionsFlag;

    @ApiModelProperty(value = "时间戳")
    @TableField(value = "timestamp")
    private String timestamp;

    @ApiModelProperty(value = "操作时间")
    @TableField(value = "operate_time")
    private String operateTime;

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

    @ApiModelProperty(value = "证书文件名称")
    @TableField(value = "file_name")
    private String fileName;

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

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

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

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

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

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

    @TableLogic(delval = "1", value = "0")
    @TableField(value = "del_flag")
    @ApiModelProperty(value = "删除标志: 0-未删除, 1-已删除")
    private Integer delFlag;

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

}
