package com.ningdatech.carapi.car.rpt.model.dto;

import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.carapi.sys.contants.RegionContant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @Classname RptDailySpecialVehiclesLaunchRateParamDTO
 * @Description
 * @Date 2022/11/8 17:06
 * @Created by PoffyZhang
 */
@Data
public class RptDailySpecialVehiclesLaunchRateParamDTO implements Serializable {

    @ApiModelProperty("日期")
    @NotNull(message = "请选择日期")
    private String date;

    @ApiModelProperty("区域ID")
    private Long regionId;
    private Integer regionLevel;
    private List<Long> regionIds;

    private String dataScopeSql;

    private String tableName = "nd_vehicle_online_status_hour_" + NdDateUtils.format(new Date(),"yyyy_MM");

    public Long getRegionId(){
        if(Objects.isNull(this.regionId)){
            this.regionId = RegionContant.ZJ_REGION_ID;
            return this.regionId;
        }
        return this.regionId;
    }
}
