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 org.springframework.format.annotation.DateTimeFormat;

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

/**
 * 船员保险信息表
 *
 * @author Qi ChengBin
 * @date 2024/12/02 14:59:04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ds_crew_insurance")
@ApiModel(value = "船员保险信息对象", description = "船员保险信息表")
public class DsCrewInsurance extends Model<DsCrewInsurance> {

    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 = "船员ID")
    @NotBlank(message = "船员主键不能为空", groups = {Update.class, Add.class})
    @TableField("crew_id")
    private String crewId;

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

    @ApiModelProperty(value = "保险类型")
    @TableField(value = "insurance_type", condition = SqlCondition.LIKE)
    private String insuranceType;

    @ApiModelProperty(value = "保险编号")
    @TableField(value = "insurance_code", condition = SqlCondition.LIKE)
    private String insuranceCode;

    @ApiModelProperty(value = "保险来源")
    @TableField(value = "insurance_source", condition = SqlCondition.LIKE)
    private String insuranceSource;

    @ApiModelProperty(value = "保险公司")
    @TableField(value = "insurance_company", condition = SqlCondition.LIKE)
    private String insuranceCompany;

    @ApiModelProperty(value = "保险状态状态（保单待承保、保单有效、保单中止、保单过期）")
    @TableField(value = "insurance_status", condition = SqlCondition.LIKE)
    private String insuranceStatus;

    @ApiModelProperty(value = "保险生效时间")
    @TableField("insurance_start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date insuranceStartTime;

    @ApiModelProperty(value = "保险截止时间")
    @TableField("insurance_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date insuranceEndTime;

    @ApiModelProperty(value = "投保人")
    @TableField(value = "insurance_holder", condition = SqlCondition.LIKE)
    private String insuranceHolder;

    @ApiModelProperty(value = "投保人联系方式")
    @TableField(value = "holder_phone", condition = SqlCondition.LIKE)
    private String holderPhone;

    @ApiModelProperty(value = "保险受益人")
    @TableField(value = "insurance_beneficiary", condition = SqlCondition.LIKE)
    private String insuranceBeneficiary;

    @ApiModelProperty(value = "保险受益人联系方式")
    @TableField("beneficiary_phone")
    private String beneficiaryPhone;

    @ApiModelProperty(value = "保单图片")
    @TableField("picture")
    private String picture;

    @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 = "删除标记, 0 - 未删除, 1 - 已删除")
    @TableLogic
    @TableField("del_flag")
    private Integer delFlag;

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

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

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

}
