package com.gci.boot.modules.gis.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.annotation.Query.OrderQuery;
import com.gci.boot.annotation.Query.SelectQuery;
import com.gci.boot.common.validated.SaveValidated;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

/**
 * @author 24642
 */
@Data
public class GpsHistoryQuery {
    @NotBlank(message = "车牌号不能为空！",groups = {SaveValidated.class})
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String plateNumber;

    @Size(min = 2,max = 2,message = "查询时间必须包括起止时间!")
    @SelectQuery(Type = SelectQuery.SelectType.BETWEEN,PropName = "gpsTime")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "查询时间范围不能为空!",groups = {SaveValidated.class})
    List<Date> time;

    @ApiModelProperty("gps采集时间")
    @OrderQuery(IsAsc = true)
    private Date gpsTime;
}
