package com.fizz.business.dto;

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 lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Data
@TableName("cpl_segment_total")
public class SegmentDTO implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("en_coil_id")
    private String enCoilID;

    @TableField("pickling_count")
    private Integer picklingCount;

    @TableField("seg_no")
    private Integer segNo;

    // 以下字段用于业务逻辑，不存入数据库
    @TableField(exist = false)
    private BigDecimal headPos;
    @TableField(exist = false)
    private BigDecimal tailPos;

    // 以下字段存入数据库
    @TableField("start_pos")
    private BigDecimal startPos;
    @TableField("end_pos")
    private BigDecimal endPos;
    @TableField("seg_len")
    private BigDecimal segLen;
    @TableField("total_values_json")
    private String totalValuesJson;

    // 以下 Map 用于业务逻辑，不存入数据库
    @TableField(exist = false)
    private Map<String, SegValue> totalValues = new ConcurrentHashMap<>();
    @TableField(exist = false)
    private Map<String, SegValue> L3values = new ConcurrentHashMap<>();

    // 两个未使用的字段，可以根据需要保留或移除
    @TableField(exist = false)
    private int headPosNum;
    @TableField(exist = false)
    private int tailPosNum;
}