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

import com.ningdatech.basic.model.PagePo;
import com.ningdatech.carapi.sys.contants.RegionContant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 * 车辆趟次分页传参
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-11-07
 */
@Data
@Builder
@ApiModel(value = "VehicleTripsParamDTO", description = "车辆趟次分页传参")
@AllArgsConstructor
@NoArgsConstructor
public class VehicleTripsParamDTO extends PagePo implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @ApiModelProperty("区域ID")
    private Long regionId;

    private List<Long> regionIds;
    private String regionCode;
    private String dataScopeSql;
    private Integer regionLevel;
    private List<Integer> vehicleTypes;

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