package cn.com.victorysoft.business.analyze.param;

import cn.com.victorysoft.business.sys.param.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel("自定义查询参数")
@Data
public class CstSearchParam extends PageParam {

    @ApiModelProperty("单位代码")
    private String unitcode;

    @ApiModelProperty("模板ID")
    private String templateId;

    @ApiModelProperty("是否统计")
    private boolean useGroup;

    @ApiModelProperty("查询条件")
    private List<CstConditionValue> values;

    @ApiModelProperty("统计方式")
    private List<CstGroupSetting> groupSettings;

    @ApiModel("查询条件值")
    @Data
    public static class CstConditionValue {

        @ApiModelProperty("查询条件指标ID")
        private String indicatorId;

        @ApiModelProperty("操作符")
        private String operator;

        @ApiModelProperty("数据类型")
        private String dataTypeId;

        @ApiModelProperty(value = "查询条件值1", notes = "日期和数字转为字符串，日期格式传yyyy-MM-dd")
        private String value1;

        @ApiModelProperty(value = "查询条件值2", notes = "日期和数字转为字符串，日期格式传yyyy-MM-dd")
        private String value2;
    }

    @ApiModel("统计设置")
    @Data
    public static class CstGroupSetting {

        @ApiModelProperty("指标ID")
        private String id;

        @ApiModelProperty("统计方式")
        private String groupType;
    }
}
