package com.huimv.env.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 端口
 * </p>
 *
 * @author newspaper
 * @since 2024-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("terminal_port")
public class TerminalPort implements TransPojo {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 端口编号
     */
    @TableField("device_code")
    private String deviceCode;

    /**
     * 终端ID
     */
    @TableField("terminal_id")
    @Trans(type = TransType.SIMPLE, target = Terminal.class, fields = "deviceName", alias = "terminal", ref = "terminalName")
    private Integer terminalId;

    @TableField(exist = false)
    private String terminalName;


    @TableField("location_id")
    @Trans(type = TransType.SIMPLE, target = BasePigpen.class, fields = "buildName", alias = "build", ref = "locationName")
    private Integer locationId;

    @TableField(exist = false)
    private String locationName;

    @TableField("farm_id")
    @Trans(type = TransType.SIMPLE, target = BaseFarm.class, fields = "farmName", alias = "farm", ref = "farmName")
    private Integer farmId;

    @TableField(exist = false)
    private String farmName;

    @TableField("voltage")
    private String voltage;

    @TableField("electric_current")
    private String electricCurrent;

    @TableField("temp")
    private String temp;

    @TableField("leakage_value")
    private String leakageValue;

    @TableField("active_power")
    private Integer activePower;

    @TableField("reactive_power")
    private Integer reactivePower;

    @TableField("apparent_power")
    private Integer apparentPower;

    @TableField("height_temp_warning")
    private Integer heightTempWarning;

    @TableField("charging_warning")
    private Integer chargingWarning;

    @TableField("leakage_warning")
    private Integer leakageWarning;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")
    private Date updateTime;

    @TableField("status")
    private Integer status;



}
