package com.ltgk.boat.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ltgk.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 渔船进出港记录（数据来自船位动态监控）对象 ds_enter_out_port
 *
 * @author Qi ChengBin
 * @date 2024-12-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ds_enter_out_port")
@ApiModel(value = "渔船进出港记录（数据来自船位动态监控）对象", description = "渔船进出港记录（数据来自船位动态监控）表")
public class DsEnterOutPort extends Model<DsEnterOutPort> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "船名号")
    @TableField(value = "boat_name", condition = SqlCondition.LIKE)
    @Excel(name = "渔船名称", sort = 0)
    private String boatName;

    @ApiModelProperty(value = "进出港类型：0进港/1出港")
    @TableField(value = "entry_dir")
    @Excel(name = "进出港类型", readConverterExp = "0=进港,1=出港", sort = 4)
    private Integer entryDir;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "进出港时间")
    @TableField(value = "enter_out_time")
    @Excel(name = "进出港时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 3)
    private Date enterOutTime;

    @ApiModelProperty(value = "渔港名称")
    @TableField(value = "port_name")
    @Excel(name = "渔港名称", sort = 1)
    private String portName;

    @ApiModelProperty(value = "渔船标识")
    @TableField(value = "ship_flag")
    private String shipFlag;

    @ApiModelProperty(value = "设备类型")
    @TableField(value = "device_type")
    @Excel(name = "设备类型", sort = 5)
    private String deviceType;

    @ApiModelProperty(value = "设备编码")
    @TableField(value = "device_code")
    private String deviceCode;

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

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

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

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

    @ApiModelProperty(value = "是不是本地渔船 0本地 1外地")
    @JsonProperty("isLocal")
    @TableField(value = "is_local")
    @Excel(name = "是否为本地渔船", readConverterExp = "0=本地,1=外地", sort = 2)
    private Integer isLocal = 0;

    @ApiModelProperty(value = "船舶id")
    @JsonProperty("BoatId")
    @TableField(value = "boat_id")
    private String BoatId;

    @ApiModelProperty(value = "港口id")
    @JsonProperty("PortId")
    @TableField(value = "port_id")
    private String PortId;

    @JsonProperty("longitude")
    @TableField("longitude")
    @ApiModelProperty(value = "经度")
    private BigDecimal longitude;

    @JsonProperty("latitude")
    @TableField("latitude")
    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;

    @ApiModelProperty(value = "船舶所有人名称")
    @JsonProperty("holderName")
    @TableField(exist = false)
    private String holderName;

    @ApiModelProperty(value = "联系方式")
    @JsonProperty("holderPhone")
    @TableField(exist = false)
    private String holderPhone;

    @ApiModelProperty(value = "是否报备， 0 - 是，1 - 否;数据库默认为否")
    @JsonProperty("beReport")
    @TableField(value = "be_report")
    private Integer beReport;

    @ApiModelProperty(value = "设备编号")
    @JsonProperty("terminalCode")
    @TableField(exist = false)
    private String terminalCode;
}
