package com.chushang.inspection.work.dto;

import cn.hutool.core.date.DatePattern;
import com.chushang.common.mybatis.annotation.Condition;
import com.chushang.common.mybatis.page.CommonParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class BankDispatchQuery extends CommonParam {

    @Condition(name = "mer_id")
    private String merId;

    @Condition(name = "mer_name", type = Condition.ConditionType.like)
    private String merName;

    @Condition(name = "term_id")
    private String termId;

    @Condition(name = "device_no")
    private String deviceNo;

    @Condition(name = "order_status")
    private String orderStatus;

    /**
     * 状态
     */
    @Condition(name = "status")
    @Range(min = 1, max = 4, message = "状态只有（1 下发  2 派单成功   3 推送成功  4 推送失败）")
    private Integer status;


    /**
     * 下发时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @Condition(name = "req_date", type = Condition.ConditionType.between)
    private List<LocalDateTime> reqDate;

    /**
     * 是否为银行派单 (1 是 2否)
     */
    @Condition(name ="is_bank")
    @Range(min = 1,max = 2,message = "状态只有 (1 是 2否)")
    private Integer isBank;
    /**
     * 商户名称或者编号
     */
    @Condition(name ="mer_id,mer_name", type = Condition.ConditionType.or_like)
    @Size(max = 128,message = "商户名称或编号不能超过128字符")
    private String blurry;
}
