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("terminal")
public class Terminal 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("status")
    private Integer status;

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

    @TableField(exist = false)
    private String buildName;

    @TableField("floor_id")
    @Trans(type = TransType.SIMPLE, target = BasePigpen.class, fields = "buildName", alias = "floor", ref = "floorName")
    private Integer floorId;

    @TableField(exist = false)
    private String floorName;

    /**
     * 网关ID
     */
    @TableField("gateway_id")
    @Trans(type = TransType.SIMPLE, target = Gateway.class, fields = {"deviceCode","deviceName"}, alias = "gateWay", refs = {"gatewayCode","gatewayName"})
    private Integer gatewayId;

    @TableField(exist = false)
    private String gatewayCode;

    @TableField(exist = false)
    private String gatewayName;

    @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("orders")
    private Integer orders;


}
