package com.xhpc.evcs.domain;

import com.xhpc.common.core.utils.DateUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;

@Table(name = "xhpc_statistics_time_interval")
@Entity
public class XhpcStatisticsTimeInterval {

    @Id
    @Column(name = "statistics_time_interval_id", nullable = false)
    private Long id;

    @Column(name = "history_order_id", nullable = false)
    private Long historyOrderId;

    @Column(name = "charging_degree", precision = 10, scale = 2)
    private BigDecimal chargingDegree;

    @Column(name = "power_price", precision = 10, scale = 2)
    private BigDecimal powerPrice;

    @Column(name = "service_price", precision = 10, scale = 2)
    private BigDecimal servicePrice;

    @Column(name = "start_time_evcs", length = 50)
    private String startTimeEvcs;

    @Column(name = "end_time_evcs", length = 50)
    private String endTimeEvcs;

    @Column(name = "elec_price_evcs", precision = 10, scale = 2)
    private BigDecimal elecPriceEvcs;

    @Column(name = "service_price_evcs", precision = 10, scale = 2)
    private BigDecimal servicePriceEvcs;

    public Long getHistoryOrderId() {

        return historyOrderId;
    }

    public void setHistoryOrderId(Long historyOrderId) {

        this.historyOrderId = historyOrderId;
    }

    public BigDecimal getServicePriceEvcs() {

        return servicePriceEvcs == null ? BigDecimal.ZERO : servicePriceEvcs;
    }

    public void setServicePriceEvcs(BigDecimal servicePriceEvcs) {

        this.servicePriceEvcs = servicePriceEvcs;
    }

    public BigDecimal getElecPriceEvcs() {

        return elecPriceEvcs == null ? BigDecimal.ZERO : elecPriceEvcs;
    }

    public void setElecPriceEvcs(BigDecimal elecPriceEvcs) {

        this.elecPriceEvcs = elecPriceEvcs;
    }

    public String getEndTimeEvcs() {

        return endTimeEvcs == null ? DateUtils.getTime() : endTimeEvcs;
    }

    public void setEndTimeEvcs(String endTimeEvcs) {

        this.endTimeEvcs = endTimeEvcs;
    }

    public String getStartTimeEvcs() {

        return startTimeEvcs == null ? DateUtils.getTime() : startTimeEvcs;
    }

    public void setStartTimeEvcs(String startTimeEvcs) {

        this.startTimeEvcs = startTimeEvcs;
    }

    public BigDecimal getServicePrice() {

        return servicePrice;
    }

    public void setServicePrice(BigDecimal servicePrice) {

        this.servicePrice = servicePrice;
    }

    public BigDecimal getPowerPrice() {

        return powerPrice;
    }

    public void setPowerPrice(BigDecimal powerPrice) {

        this.powerPrice = powerPrice;
    }

    public BigDecimal getChargingDegree() {

        return chargingDegree == null ? BigDecimal.ZERO : chargingDegree;
    }

    public void setChargingDegree(BigDecimal chargingDegree) {

        this.chargingDegree = chargingDegree;
    }

    public Long getId() {

        return id;
    }

    public void setId(Long id) {

        this.id = id;
    }

}
