package com.njcn.influx.bo.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 
 * Description:
 * Date: 2024/1/23  14:14【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Data
@TableName(value = "JOB_DETAIL_HOURS_INFLUXDB")
@NoArgsConstructor
@AllArgsConstructor
public class JobDetailHoursInfluxDB {
    /**
     * 指标表名
     */
    @MppMultiId(value = "TABLE_NAME")
    private String tableName;

    /**
     * 执行日期
     */
    @MppMultiId(value = "EXCUTE_DATE")
    private LocalDateTime excuteDate;

    /**
     * 记录数
     */
    @TableField(value = "\"ROW_COUNT\"")
    private Integer rowCount;

    /**
     * 状态（0-执行中、1-成功、2-失败）
     */
    @TableField(value = "\"STATE\"")
    private Integer state;

    @TableField(value = "UPDATE_TIME")
    private LocalDateTime updateTime;

    /**
     * 消耗时长
     */
    @TableField(value = "DURATION")
    private Double duration;

    public JobDetailHoursInfluxDB(String tableName, LocalDateTime excuteDate, Integer state, Integer rowCount, LocalDateTime updateTime) {
        this.tableName = tableName;
        this.excuteDate = excuteDate;
        this.state = state;
        this.rowCount = rowCount;
        this.updateTime = updateTime;
    }

    public JobDetailHoursInfluxDB(String tableName, LocalDateTime excuteDate, Integer rowCount) {
        this.tableName = tableName;
        this.excuteDate = excuteDate;
        this.rowCount = rowCount;
    }
}