package com.zcxk.charge.api.dto.query;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Andy
 * @version V1.0
 * @description: TODO
 * @date 2021/8/17
 **/
@Data
public class MonitorDataChartDto {

    @ApiModelProperty(value = "设备id")
    private List<Long> deviceIds;

    @ApiModelProperty(value = "时间")
    private String reportDate;

    @NotNull
    @ApiModelProperty(value = "日期类型,1年报2月报3日报4自定义")
    private Integer reportType;

    @ApiModelProperty(value = "统计类型,1压力2流量3水质")
    private Integer searchType;

    @ApiModelProperty(value = "开始时间")
    private String startTime;

    @ApiModelProperty(value = "结束时间")
    private String endTime;

    public String getStartTime(){
        return StringUtils.isNotEmpty(startTime) ? startTime + " 00:00:00" : startTime;
    }

    public String getEndTime(){
        return StringUtils.isNotEmpty(endTime) ? endTime + " 23:59:59" : endTime;
    }
}
