package com.agri.system.domain;

import com.agri.common.annotation.Excel;
import com.agri.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * DTU温湿度上报数据对象 sys_dtu_data
 *
 * @author agri
 * @LocalDateTime 2025-12-23
 */
public class SysDtuData extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 设备唯一标识(IMEI/DeviceId) */
    @Excel(name = "设备唯一标识(IMEI/DeviceId)")
    private String imei;

    /** 设备上报时间戳(ms或s，建议统一ms) */
    @Excel(name = "设备上报时间戳(ms或s，建议统一ms)")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long ts;

    /** ts转换后的正常时间(由服务端转换入库) */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "ts转换后的正常时间(由服务端转换入库)", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime time;

    /** 温度1(℃) */
    @Excel(name = "温度1(℃)")
    private BigDecimal temp1;

    /** 湿度1(%RH) */
    @Excel(name = "湿度1(%RH)")
    private BigDecimal humi1;

    /** 温度2(℃) */
    @Excel(name = "温度2(℃)")
    private BigDecimal temp2;

    /** 湿度2(%RH) */
    @Excel(name = "湿度2(%RH)")
    private BigDecimal humi2;

    /** 温度3(℃) */
    @Excel(name = "温度3(℃)")
    private BigDecimal temp3;

    /** 湿度3(%RH) */
    @Excel(name = "湿度3(%RH)")
    private BigDecimal humi3;

    /** 温度4(℃) */
    @Excel(name = "温度4(℃)")
    private BigDecimal temp4;

    /** 湿度4(%RH) */
    @Excel(name = "湿度4(%RH)")
    private BigDecimal humi4;

    /** 原始JSON元信息(原始上报码/额外字段) */
    @Excel(name = "原始JSON元信息(原始上报码/额外字段)")
    private String raw;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setImei(String imei)
    {
        this.imei = imei;
    }

    public String getImei()
    {
        return imei;
    }

    public void setTs(Long ts)
    {
        this.ts = ts;
    }

    public Long getTs()
    {
        return ts;
    }

    public void setTime(LocalDateTime time)
    {
        this.time = time;
    }

    public LocalDateTime getTime()
    {
        return time;
    }

    public void setTemp1(BigDecimal temp1)
    {
        this.temp1 = temp1;
    }

    public BigDecimal getTemp1()
    {
        return temp1;
    }

    public void setHumi1(BigDecimal humi1)
    {
        this.humi1 = humi1;
    }

    public BigDecimal getHumi1()
    {
        return humi1;
    }

    public void setTemp2(BigDecimal temp2)
    {
        this.temp2 = temp2;
    }

    public BigDecimal getTemp2()
    {
        return temp2;
    }

    public void setHumi2(BigDecimal humi2)
    {
        this.humi2 = humi2;
    }

    public BigDecimal getHumi2()
    {
        return humi2;
    }

    public void setTemp3(BigDecimal temp3)
    {
        this.temp3 = temp3;
    }

    public BigDecimal getTemp3()
    {
        return temp3;
    }

    public void setHumi3(BigDecimal humi3)
    {
        this.humi3 = humi3;
    }

    public BigDecimal getHumi3()
    {
        return humi3;
    }

    public void setTemp4(BigDecimal temp4)
    {
        this.temp4 = temp4;
    }

    public BigDecimal getTemp4()
    {
        return temp4;
    }

    public void setHumi4(BigDecimal humi4)
    {
        this.humi4 = humi4;
    }

    public BigDecimal getHumi4()
    {
        return humi4;
    }

    public void setRaw(String raw)
    {
        this.raw = raw;
    }

    public String getRaw()
    {
        return raw;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("imei", getImei())
            .append("ts", getTs())
            .append("time", getTime())
            .append("temp1", getTemp1())
            .append("humi1", getHumi1())
            .append("temp2", getTemp2())
            .append("humi2", getHumi2())
            .append("temp3", getTemp3())
            .append("humi3", getHumi3())
            .append("temp4", getTemp4())
            .append("humi4", getHumi4())
            .append("raw", getRaw())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .toString();
    }
}
