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 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("gateway")
public class Gateway implements TransPojo {

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

    /**
     * 设备编号
     */
    @TableField("device_code")
    private String deviceCode;

    /**
     * 设备名称
     */
    @TableField("device_name")
    private String deviceName;

    /**
     * 型号
     */
    @TableField("type")
    private String type;

    @TableField("terminal_num")
    private Integer terminalNum;

    /**
     * 安装位置ID
     */
    @TableField("location_id")
    @Trans(type = TransType.SIMPLE, target = BasePigpen.class, fields = {"buildName","lng","lat"}, alias = "build", refs = {"locationName","lng","lat"})
    private Integer locationId;

    @TableField(exist = false)
    private String locationName;

    @TableField(exist = false)
    private String lng;

    @TableField(exist = false)
    private String lat;

    /**
     * 状态
     */
    @TableField("status")
    private Integer status;

    @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("version")
    private String version;

}
