package com.jwipc.finance.model.query;

import cn.hutool.core.util.StrUtil;
import com.jwipc.query.BasePageQuery;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 购销合同查询
 */
@Data
public class AccountSalesContractsDetailQuery extends BasePageQuery {

    private String sort;
    private String order;
    /**
     * 对账单ID
     */
    private String accountStatementId;
    /**
     * 对账单编号
     */
    private String accountStatementNo;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplierName;

    private String accountStatementYear;

    private String accountStatementMonth;

    /**
     * 创建时间(起)
     */
    private String createTimeStart;
    /**
     * 创建时间(至)
     */
    private String createTimeEnd;

    private String delFlag;


    public String getSort(){
        if(StringUtils.isNotEmpty(this.sort)){
            return StrUtil.toUnderlineCase(this.sort);
        }
        return "";
    }

    public String getCreateTimeStart(){
        if(StringUtils.isNotEmpty(this.createTimeStart)){
            return this.createTimeStart + " 00:00:00";
        }
        return "";
    }

    public String getCreateTimeEnd(){
        if(StringUtils.isNotEmpty(this.createTimeEnd)){
            return this.createTimeEnd + " 23:59:59";
        }
        return "";
    }
}
