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/05 14:59:04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ds_crew_train_record")
@ApiModel(value = "船员培训记录对象", description = "船员培训记录表")
public class DsCrewTrainRecord extends Model<DsCrewTrainRecord> {

    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 = "培训课程ID不能为空！", groups = {Update.class, Add.class})
    @TableField("train_id")
    private String trainId;

    @ApiModelProperty(value = "培训类型")
    @TableField("train_type")
    @NotBlank(message = "培训类型不能为空！", groups = {Update.class, Add.class})
    private String trainType;

    @ApiModelProperty(value = "船员id")
    @TableField("crew_id")
    private String crewId;

    @ApiModelProperty(value = "船员姓名")
    @TableField(value = "crew_name", condition = SqlCondition.LIKE)
    private String crewName;

    @ApiModelProperty(value = "联系方式")
    @TableField(value = "crew_phone", condition = SqlCondition.LIKE)
    private String crewPhone;

    @ApiModelProperty(value = "得分")
    @TableField("scores")
    private Integer scores;

    @ApiModelProperty(value = "完成情况：0未通过，1已通过")
    @TableField("train_situation")
    private String trainSituation;

    @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(value = "update_by", condition = SqlCondition.LIKE)
    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-已删除")
    @TableField("del_flag")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark", condition = SqlCondition.LIKE)
    private String remark;

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

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

    @ApiModelProperty(value = "app端登录用户id")
    @TableField(value = "login_user_id")
    private String loginUserId;

    @ApiModelProperty(value = "是否有考试题目")
    @TableField(exist = false)
    private Integer beHaveProblem;

    @ApiModelProperty(value = "培训课程名称")
    @TableField(exist = false)
    private String trainName;

    @ApiModelProperty(value = "培训内容")
    @TableField(exist = false)
    private String trainContent;

    @ApiModelProperty(value = "培训开始日期")
    @TableField(exist = false)
    private Date trainStartTime;

    @ApiModelProperty(value = "培训结束日期")
    @TableField(exist = false)
    private Date trainEndTime;

    @ApiModelProperty(value = "培训人")
    @TableField(exist = false)
    private String trainer;
}
