package com.ruoyi.ucp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author gfhd
 * @since 2024-08-05
 */
@Data
@TableName("station_info_min")
public class StationInfoMin implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @JsonIgnore
    private Integer id;

    @JsonIgnore
    private String stationId;

    @JsonProperty("record_date")
    private Date recordDate;

    private Double pjfs;

    private Double pjgl;

    @JsonIgnore
    private Double llgl;

    @JsonIgnore
    private Double kygl;

    private Double agc;

    @JsonIgnore
    private Double dqycgl;

    @JsonIgnore
    private Double cdqycgl;

    private Double rfdl;

    private Double hjwd;
    //待机，运行，故障，检修
    private Long djts;
    private Long yxts;
    private Long gzts;
    private Long jxts;

    public void setLlgl(Double llgl) {
        if (llgl == null) llgl = 0.0;
        this.llgl = llgl;
    }

    public void setKygl(Double kygl) {
        if (kygl == null) kygl = 0.0;
        this.kygl = kygl;
    }

    public void setDjts(Long djts) {
        if (djts == null) djts = 0L;
        this.djts = djts;
    }

    public void setYxts(Long yxts) {
        if (yxts == null) yxts = 0L;
        this.yxts = yxts;
    }

    public void setGzts(Long gzts) {
        if (gzts == null) gzts = 0L;
        this.gzts = gzts;
    }

    public void setJxts(Long jxts) {
        if (jxts == null) jxts = 0L;
        this.jxts = jxts;
    }

    public void setPjfs(Double pjfs) {
        if (pjfs == null || pjfs < 0) pjfs = 0.0;
        if (pjfs > 25) pjfs = 25.0;
        this.pjfs = pjfs;
    }

    public void setPjgl(Double pjgl) {
        if (pjgl == null || pjgl<0) pjgl = 0.0;
        if (pjgl > 169600) pjgl = 169600.0;
        this.pjgl = pjgl;
    }

    public void setAgc(Double agc) {
        if (agc == null || agc < 0) agc = 0.0;
        if (agc > 170000) agc = 170000.0;
        this.agc = agc;
    }

    public void setRfdl(Double rfdl) {
        if (rfdl == null || rfdl < 0) rfdl = 0.0;
        this.rfdl = rfdl;
    }

    public void setHjwd(Double hjwd) {
        if (hjwd == null) hjwd = 0.0;
        if (hjwd < -30) hjwd = -30.0;
        if (hjwd > 55) hjwd = 55.0;
        this.hjwd = hjwd;
    }
}
