package com.agri.system.domain;

import com.agri.common.annotation.Excel;
import com.agri.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDateTime;

/**
 * 自动化卷膜风口大小设置对象 sys_roller_air
 *
 * @author lld
 * @date 2026-03-04
 */
@Data
@TableName("sys_roller_air")
public class SysRollerAir extends BaseEntity
{
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 设备IMEI码 */
    @Excel(name = "设备IMEI码")
    private String imei;

    /** 卷膜器编号/标识 */
    @Excel(name = "卷膜器编号/标识")
    private String roller;

    /** 操作类型 0-停止 1-运行 2-查询 3-重置 */
    @Excel(name = "操作类型 0-停止 1-运行 2-查询 3-重置")
    private Integer opType;

    /** 操作参数(JSON格式，存储风口大小等配置) */
    @Excel(name = "操作参数(JSON格式，存储风口大小等配置)")
    private String payload;

    /** 客户端ID */
    @Excel(name = "客户端ID")
    private String clientid;

    /** 操作执行时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "操作执行时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime opTime;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("imei", getImei())
            .append("roller", getRoller())
            .append("opType", getOpType())
            .append("payload", getPayload())
            .append("clientid", getClientid())
            .append("opTime", getOpTime())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
