package cn.iocoder.yudao.module.pms.controller.admin.iotmodeltemplateattrs.vo;

import cn.iocoder.yudao.module.pms.controller.admin.iotdevicetemplate.model.DeviceTemplateAttrs;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - PMS 功能优化 设备模板属性 Response VO")
@Data
@ExcelIgnoreUnannotated
public class IotModelTemplateAttrsRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12178")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "设备模板id", example = "32238")
    @ExcelProperty("设备模板id")
    private Long templateId;

    @Schema(description = "设备id", example = "32238")
    @ExcelProperty("设备id")
    private Long deviceId;

    @Schema(description = "设备分类id", example = "32238")
    @ExcelProperty("设备分类id")
    private Long deviceCategoryId;

    @Schema(description = "属性名称", example = "李四")
    @ExcelProperty("属性名称")
    private String name;

    @Schema(description = "属性编码")
    @ExcelProperty("属性编码")
    private String code;

    @Schema(description = "属性数据类型 string number boolean", example = "1")
    @ExcelProperty("属性数据类型 string number boolean")
    private String type;

    @Schema(description = "是否必填 0不必填 1必填")
    @ExcelProperty("是否必填 0不必填 1必填")
    private Integer requiredFlag;

    @Schema(description = "默认值")
    @ExcelProperty("默认值")
    private String defaultValue;

    @Schema(description = "属性值单位")
    @ExcelProperty("属性值单位")
    private String unit;

    @Schema(description = "模板描述", example = "随便")
    @ExcelProperty("模板描述")
    private String description;

    @Schema(description = "状态 0启用  1停用", example = "1")
    @ExcelProperty("状态 0启用  1停用")
    private Integer status;

    @Schema(description = "备注", example = "随便")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "排序")
    @ExcelProperty("排序")
    private Integer sort;

    @Schema(description = "下拉框选项 ")
    @ExcelProperty("下拉框选项 ")
    private DeviceTemplateAttrs selectOptions;

    @Schema(description = "模板版本号")
    @ExcelProperty("模板版本号")
    private Integer version;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate createTime;

    @Schema(description = "是否数采", example = "1")
    private Integer isCollection;


    @Schema(description = "是否累计", example = "1")
    private Integer isSum;

    @Schema(description = "物属性", example = "zyj")
    private String modelAttr;

    private String deviceCode;

    /**
     * 扩展属性
     */
    @Schema(description = "累计运行时长", example = "2398.2")
    private BigDecimal totalRunTime;

    @Schema(description = "累计运行公里数", example = "2398.2")
    private BigDecimal totalMileage;

    private int threshold;

    /**
     * 累计属性ID
     */
    private Long sumId;

    private int dailyReport;
}