package cn.cecep.talroad.vo.query.analysis;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.analysis.SRaFactoryTransferRateAnalysis;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;


/**
 * 企业传输率分析对象 s_ra_factory_transfer_rate_analysis
 *
 * @author szhpt
 * @date 2023-04-11*/
@ApiModel(value = "企业传输率分析")
@EqualsAndHashCode(callSuper = false)
@Data
public class SRaFactoryTransferRateAnalysisQuery extends PageQuery
{

    @ApiModelProperty(value = "id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "企业名字")
    private String factoryName;
    @ApiModelProperty(value = "数据来源")
    private String dataSource;
    @ApiModelProperty(value = "点位/设备名称")
    private String outletName;
    @ApiModelProperty(value = "点位/设备编号")
    private String outletCode;
    @ApiModelProperty(value = "区域名称")
    private String districtName;
    /**
     * 所属行业名称
     */
    @ApiModelProperty(value = "所属行业名称")
    private String industryCategoryName;

    @ApiModelProperty(value = "统计类型;字典bus_executive_report（y 年报 s 季报 m 月报 d 日报）年：2023，季：20231，月：202301，日：20230101")
    private String countType;
    @ApiModelProperty(value = "统计时间")
    private String statisticsTime;
    @ApiModelProperty(value = "应传个数")
    private Long transmittNum;
    @ApiModelProperty(value = "实际上传个数")
    private Long actualTransmittNum;
    @ApiModelProperty(value = "传输率")
    private BigDecimal transmissionRate;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @ApiModelProperty(value = "统计时间开始")
    private String statisticsTimeStart;
    @ApiModelProperty(value = "统计时间结束")
    private String statisticsTimeEnd;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<SRaFactoryTransferRateAnalysis> createLambdaQueryWrapper(SRaFactoryTransferRateAnalysisQuery query) {
        QueryWrapper<SRaFactoryTransferRateAnalysis> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.like(ObjectUtil.isNotEmpty(query.getFactoryName()), "factory_name", query.getFactoryName());
        wrapper.like(ObjectUtil.isNotEmpty(query.getIndustryCategoryName()), "industry_category_name", query.getIndustryCategoryName());
        wrapper.eq(ObjectUtil.isNotNull(query.getDataSource()), "data_source", query.getDataSource());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletName()), "outlet_name", query.getOutletName());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletCode()), "outlet_code", query.getOutletCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getStatisticsTime()), "statistics_time", query.getStatisticsTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getTransmittNum()), "transmitt_num", query.getTransmittNum());
        wrapper.eq(ObjectUtil.isNotNull(query.getActualTransmittNum()), "actual_transmitt_num", query.getActualTransmittNum());
        wrapper.eq(ObjectUtil.isNotNull(query.getTransmissionRate()), "transmission_rate", query.getTransmissionRate());
        wrapper.ge(ObjectUtil.isNotEmpty(query.getStatisticsTimeStart()), "statistics_time", query.getStatisticsTimeStart());
        wrapper.le(ObjectUtil.isNotEmpty(query.getStatisticsTimeEnd()), "statistics_time", query.getStatisticsTimeEnd());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getCreateBy()), "create_by", query.getCreateBy());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getUpdateBy()), "update_by", query.getUpdateBy());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateTime()), "update_time", query.getUpdateTime());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getDistrictName()), "district_name", query.getDistrictName());
        wrapper.eq(ObjectUtil.isNotEmpty(query.getCountType()), "count_type", query.getCountType());
        return wrapper;
        }
}
