package com.ltgk.catches.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.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.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 渔获上岸记录对象 tp_fish_catch
 *
 * @author Qi ChengBin
 * @date 2025-01-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tp_fish_catch")
@ApiModel(value = "渔获上岸记录对象", description = "渔获上岸记录表")
public class TpFishCatch extends Model<TpFishCatch> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "渔获上岸记录主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "渔获上岸记录主键不能为空！", groups = {Update.class})
    private String id;

    @ApiModelProperty(value = "渔港主键")
    @TableField(value = "port_id")
    private String portId;

    @ApiModelProperty(value = "渔港名称")
    @TableField(value = "port_name", condition = SqlCondition.LIKE)
    private String portName;

    @ApiModelProperty(value = "上岸地点")
    @TableField(value = "land_port", condition = SqlCondition.LIKE)
    private String landPort;

    @ApiModelProperty(value = "捕捞渔船")
    @TableField(value = "boat_name", condition = SqlCondition.LIKE)
    private String boatName;

    @ApiModelProperty(value = "渔获总重量")
    @TableField(value = "fish_weight")
    private BigDecimal fishWeight;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "上岸时间")
    @TableField(value = "land_time")
    private Date landTime;

    @ApiModelProperty(value = "批次号")
    @TableField(value = "batch_code")
    private Long batchCode;

    @ApiModelProperty(value = "信息追溯码链接")
    @TableField(value = "info_code_url")
    private String infoCodeUrl;

    @ApiModelProperty(value = "信息来源")
    @TableField(value = "info_source")
    private Integer infoSource;

    @ApiModelProperty(value = "智能电子秤编号")
    @TableField(value = "scale_no")
    private String scaleNo;

    @ApiModelProperty(value = "实际经营人")
    @TableField(value = "operator")
    private String operator;

    @ApiModelProperty(value = "联系方式")
    @TableField(value = "operator_phone")
    private String operatorPhone;

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

    @ApiModelProperty(value = "渔获明细记录")
    @TableField(exist = false)
    private List<TpFishCatchRecord> tpFishCatchRecordList;
}
