/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.dto.order;

import lombok.Data;
import java.util.List;

import cn.ysk.cashier.annotation.Query;
import org.apache.commons.lang3.StringUtils;

/**
* @website https://eladmin.vip
* @author lyf
* @date 2024-03-02
**/
@Data
public class TbOrderInfoQueryCriteria{

    /** 精确 */
    @Query
    private Integer id;

    /** 精确 */
    @Query
    private String orderNo;

    /** 精确 */
    @Query
    private String sendType;

    /** 精确 */
    @Query
    private String status;

    /** 精确 */
    @Query
    private String orderType;

    /** 精确 */
    @Query
    private String payType;

    @Query
    private String source;

    /** 精确 */
    @Query
    private String shopId;

    private Integer pageSize;

    private Integer page;

    private String sort;

    /** BETWEEN */
    @Query(type = Query.Type.BETWEEN)
    private List<Long> createdAt;

    private Integer userId;


    @Query
    private String tableName;

    private String productName;

    public void setProductName(String productName) {
        if(StringUtils.isNotBlank(productName)) this.productName = productName;
    }

    public Integer getPage() {
        if (page == null) {
            return 0;
        }
        return page;
    }

    public Integer getPageSize() {
        if (pageSize == null) {
            return 10;
        }
        return pageSize;
    }
}
