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.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.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 渔港设备对象 ds_port_equ
 *
 * @author Qi ChengBin
 * @date 2024-12-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ds_port_equ")
@ApiModel(value = "渔港设备对象", description = "渔港设备表")
public class DsPortEqu extends Model<DsPortEqu> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "渔港设备主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "渔港设备主键不能为空", groups = {Update.class, Detail.class})
    private String id;

    @ApiModelProperty(value = "渔港主键")
    @TableField(value = "port_id")
    @NotNull(message = "渔港主键不能为空", groups = {Update.class, Add.class})
    private String portId;

    @ApiModelProperty(value = "渔港名称")
    @TableField(value = "port_name", condition = SqlCondition.LIKE)
    @NotNull(message = "渔港名称不能为空", groups = {Update.class, Add.class})
    private String portName;

    @ApiModelProperty(value = "设备编码")
    @TableField(value = "equ_code", condition = SqlCondition.LIKE)
    @NotNull(message = "设备编码不能为空", groups = {Update.class, Add.class})
    private String equCode;

    @ApiModelProperty(value = "设备名称")
    @TableField(value = "equ_name", condition = SqlCondition.LIKE)
    @NotNull(message = "设备名称不能为空", groups = {Update.class, Add.class})
    private String equName;

    /**
     * 设备类型：
     * 视频监控设备：video
     * 消防设备：fireFighting
     * 基站设备：baseStation
     * 广播设备：broadcast
     * 网络设备: net
     */
    @ApiModelProperty(value = "设备类型【视频监控设备、消防设备、基站设备、广播设备、网络设备等】")
    @TableField(value = "equ_type")
    private String equType;

    @ApiModelProperty(value = "设备状态【在用、闲置】")
    @TableField(value = "equ_state")
    private String equState;

    @ApiModelProperty(value = "健康状态")
    @TableField(value = "health_state")
    private String healthState;

    @ApiModelProperty(value = "设备创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "equ_create_time")
    private Date equCreateTime;

    @ApiModelProperty(value = "设备图片")
    @TableField(value = "equ_image")
    private String equImage;

    @ApiModelProperty(value = "设备资料")
    @TableField("equ_data")
    private String equData;

    @ApiModelProperty(value = "设备位置 --> 所在区域")
    @TableField(value = "equ_addr", condition = SqlCondition.LIKE)
    private String equAddr;

    @ApiModelProperty(value = "设备所属单位")
    @TableField(value = "equ_corp", condition = SqlCondition.LIKE)
    private String equCorp;

    @ApiModelProperty(value = "设备型号")
    @TableField(value = "equ_model", condition = SqlCondition.LIKE)
    private String equModel;

    @ApiModelProperty(value = "设备最大值")
    @TableField(value = "equ_max")
    private String equMax;

    @ApiModelProperty(value = "设备最小值")
    @TableField(value = "equ_min")
    private String equMin;

    @ApiModelProperty(value = "设备质保期[月]")
    @TableField(value = "equ_warranty_period")
    private String equWarrantyPeriod;

    @ApiModelProperty(value = "计量单位")
    @TableField("equ_unit")
    private String equUnit;

    @ApiModelProperty(value = "净值")
    @TableField("net_value")
    private BigDecimal netValue;

    @ApiModelProperty(value = "原值")
    @TableField("original_value")
    private BigDecimal originalValue;

    @ApiModelProperty(value = "设备厂商")
    @TableField(value = "equ_manufacturer", condition = SqlCondition.LIKE)
    private String equManufacturer;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "生产日期")
    @TableField(value = "equ_manufacture_date")
    private Date equManufactureDate;

    @ApiModelProperty(value = "厂商联系信息")
    @TableField(value = "equ_manufacture_tel", condition = SqlCondition.LIKE)
    private String equManufactureTel;

    @ApiModelProperty(value = "售后维修")
    @TableField(value = "equ_after_sale")
    private String equAfterSale;

    @ApiModelProperty(value = "责任人")
    @TableField("principal")
    private String principal;

    @ApiModelProperty(value = "责任人联系方式")
    @TableField("principal_phone")
    private String principalPhone;

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

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

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

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_at")
    private Date createAt;

    @TableField(value = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_at")
    private Date updateAt;

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