package com.ltgk.port.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ltgk.common.annotation.Excel;
import com.ltgk.common.validation.groups.Add;
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.time.LocalDate;
import java.util.Date;

/**
 * 渔港设施设备报修管理对象 port_equ_repair
 *
 * @author Qi ChengBin
 * @date 2025-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("port_equ_repair")
@ApiModel(value = "渔港设施设备报修管理对象", description = "渔港设施设备报修管理表")
public class PortEquRepair extends Model<PortEquRepair> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "渔港设施设备报修管理主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotBlank(message = "渔港设施设备报修管理主键不能为空！", groups = {Update.class})
    private String id;

    @ApiModelProperty(value = "渔港id")
    @TableField(value = "port_id")
    @NotBlank(message = "渔港信息不能为空！", groups = {Add.class, Update.class})
    private String portId;

    @ApiModelProperty(value = "渔港名称")
    @TableField(value = "port_name", condition = SqlCondition.LIKE)
    @Excel(name = "渔港名称", width = 25, height = 18)
    @NotBlank(message = "渔港信息不能为空！", groups = {Add.class, Update.class})
    private String portName;

    @ApiModelProperty(value = "设备id")
    @TableField(value = "equ_id")
    @NotBlank(message = "设备信息不能为空！", groups = {Add.class, Update.class})
    private String equId;

    @ApiModelProperty(value = "设备编码")
    @TableField(value = "equ_code", condition = SqlCondition.LIKE)
    private String equCode;

    @ApiModelProperty(value = "设备名称")
    @TableField(value = "equ_name", condition = SqlCondition.LIKE)
    @Excel(name = "设备名称", width = 25, height = 18)
    private String equName;

    @ApiModelProperty(value = "详细位置")
    @TableField(value = "addr", condition = SqlCondition.LIKE)
    @Excel(name = "详细位置", width = 25, height = 18)
    private String addr;

    @ApiModelProperty(value = "设备损坏原因")
    @TableField(value = "damage_reason")
    @Excel(name = "设备损坏原因", width = 25, height = 18)
    @NotBlank(message = "设备损坏原因不能为空", groups = {Add.class, Update.class})
    private String damageReason;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "设备损坏时间")
    @TableField(value = "damage_time")
    @Excel(name = "设备损坏时间", width = 25, height = 18, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "设备损坏时间不能为空！", groups = {Add.class, Update.class})
    private LocalDate damageTime;

    @ApiModelProperty(value = "提报人id")
    @TableField(value = "report_user_id")
    private String reportUserId;

    @ApiModelProperty(value = "提报人名称")
    @TableField(value = "report_user_name")
    @Excel(name = "提报人名称", width = 25, height = 18)
    private String reportUserName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "提报时间")
    @TableField(value = "report_time")
    @Excel(name = "提报时间", width = 25, height = 18, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date reportTime;

    @ApiModelProperty(value = "维修人员id")
    @TableField(value = "repair_user_id")
    private String repairUserId;

    @ApiModelProperty(value = "维修人员名称")
    @TableField(value = "repair_user_name")
    @Excel(name = "维修人员名称", width = 25, height = 18)
    private String repairUserName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "维修时间")
    @TableField(value = "repair_time")
    @Excel(name = "维修时间", width = 25, height = 18, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date repairTime;

    @ApiModelProperty(value = "维修情况")
    @TableField(value = "repair_situation")
    @Excel(name = "维修情况", width = 25, height = 18)
    private String repairSituation;

    @ApiModelProperty(value = "维修进展")
    @TableField(value = "repair_progress")
    @Excel(name = "维修进展", width = 25, height = 18)
    private String repairProgress;

    @ApiModelProperty(value = "维修结果")
    @TableField(value = "repair_results")
    @Excel(name = "维修结果", width = 25, height = 18)
    private String repairResults;

    @ApiModelProperty(value = "确认人id")
    @TableField(value = "confirm_user_id")
    private String confirmUserId;

    @ApiModelProperty(value = "确认人名称")
    @TableField(value = "confirm_user_name")
    @Excel(name = "确认人名称", width = 25, height = 18)
    private String confirmUserName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "确认时间")
    @TableField(value = "confirm_time")
    @Excel(name = "确认时间", width = 25, height = 18, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date confirmTime;

    @ApiModelProperty(value = "状态【0-已提报，1-已维修，2-确认通过, 3-确认未通过】")
    @TableField(value = "repair_state")
    @Excel(name = "状态", readConverterExp = "0=已提报,1=已维修,2=确认通过,3=确认未通过")
    private Integer repairState;

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

    @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;

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