package com.jwipc.order.model.query;

import com.baomidou.mybatisplus.core.enums.SqlLike;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlUtils;
import com.google.common.base.Strings;
import com.jwipc.query.BaseSortQuery;
import lombok.Data;

import java.util.List;
import java.util.Set;


@Data
public class BasicForeignQuotaQuery extends BaseSortQuery {
    private Long planId;
    private String type;
    private String material;
    private String supplier;
    private Long version;
    private Long detailId;
    private Integer status;
    private String purchaseGroup;
    private Long userId;
    private Long replyUserId;//用于采购代回复
    private String isRiskMaterial;//是否风险物料
    private Set<String> userPurchaseGroupCodes;

    private String demandStartDate;
    private String demandEndDate;
    private String factory;
    private Integer deployToSupplier;
    private Long shortageQuantity;

    /**
     * 工单号
     */
    private String workOrderNumber;
    /**
     * 状态
     */
    private List<Integer> statusList;

    public String getLikeSupplier() {
        if (!Strings.isNullOrEmpty(this.supplier)) {
            return SqlUtils.concatLike(this.supplier, SqlLike.DEFAULT);
        }
        return "";
    }
}
