package com.fs.company.param;

import lombok.Data;

import java.util.Arrays;

@Data
public class SalesStatCIDParam {
    private Long deptId;
    private Long userId;
    private Long companyId;
    private String corpId; //主体id qw_user.corp_id
    private String qwUserName; //企微用户名 qw_user.qw_user_name 模糊匹配
    private String companyUserName;
    private Long qwAcquisitionAssistantId;//获客链接主键id
    private String startAddTime;    // 进粉开始时间
    private String endAddTime;      // 进粉结束时间
    private String startOrderTime;  // 下单开始时间
    private String endOrderTime;    // 下单结束时间

    // 分页
    private Integer pageNum = 1;
    private Integer pageSize = 10;

    // 排序
    private String orderByColumn;   // 列名（如 fansCount、totalAmount 等）
    private String isAsc;           // "asc" 或 "desc"

    public void setOrderByColumn(String orderByColumn) {
        // 仅允许以下列名
        if (Arrays.asList("fansCount", "totalAmount", "orderCount", "buyerCount").contains(orderByColumn)) {
            this.orderByColumn = orderByColumn;
        } else {
            this.orderByColumn = null;
        }
    }
}