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

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.common.core.utils.DateUtils;
import cn.cecep.talroad.common.core.utils.StringUtils;
import cn.cecep.talroad.domain.analysis.SRaHandworkEmissionsWater;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 手工监测排放监控-水污染要素对象 s_ra_handwork_emissions_water
 *
 * @author szhpt
 * @date 2023-03-24*/
@ApiModel(value = "手工监测排放监控-水污染要素")
@EqualsAndHashCode(callSuper = false)
@Data
public class SRaHandworkEmissionsWaterQuery extends PageQuery
{

    @ApiModelProperty(value = "主键")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "监测点位名称")
    private String pointName;
    @ApiModelProperty(value = "排口编号")
    private String outletCode;
    @ApiModelProperty(value = "排口类型")
    private String outletType;
    @ApiModelProperty(value = "污染物种类")
    private String pollutantName;
    @ApiModelProperty(value = "监测开始时间")
    private String monitorTimeStart;
    @ApiModelProperty(value = "监测截至时间")
    private String monitorTimeEnd;
    @ApiModelProperty(value = "监测浓度")
    private String monitorVal;
    @ApiModelProperty(value = "浓度单位")
    private String unit;
    @ApiModelProperty(value = "废水流量（m³/d）")
    private String wasteWaterFlow;
    @ApiModelProperty(value = "核算周期开始")
    private String checkCycleStart;
    @ApiModelProperty(value = "核算周期结束")
    private String checkCycleEnd;
    @ApiModelProperty(value = "核算周期生产运行时间")
    private String checkRunTime;
    @ApiModelProperty(value = "运行时间来源")
    private String runTimeSource;
    @ApiModelProperty(value = "排放量（t）")
    private String emissions;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;
    @ApiModelProperty(value = "企业名称")
    private String factoryName;
    @ApiModelProperty(value = "行业类别名称(多个使用''、''拼接)")
    private String industryCategoryName;
    @ApiModelProperty(value = "行业类别编码(多个使用''、''拼接)")
    private String industryCategoryCode;
    @ApiModelProperty(value = "区域名称")
    private String districtName;
    @ApiModelProperty(value = "区域编码")
    private String districtCode;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<SRaHandworkEmissionsWater> createLambdaQueryWrapper(SRaHandworkEmissionsWaterQuery query) {
        QueryWrapper<SRaHandworkEmissionsWater> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(StringUtils.isNotEmpty(query.getPointName()), "point_name", query.getPointName());
        wrapper.like(StringUtils.isNotEmpty(query.getOutletCode()), "outlet_code", query.getOutletCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getOutletType()), "outlet_type", query.getOutletType());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollutantName()), "pollutant_name", query.getPollutantName());
        wrapper.between(StringUtils.isNotEmpty(query.getMonitorTimeStart()) && StringUtils.isNotEmpty(query.getMonitorTimeEnd()), "monitor_time", DateUtils.parseDate(query.getMonitorTimeStart()), DateUtils.parseDate(query.getMonitorTimeEnd()));
        wrapper.eq(StringUtils.isNotEmpty(query.getMonitorVal()), "monitor_val", query.getMonitorVal());
        wrapper.eq(StringUtils.isNotEmpty(query.getUnit()), "unit", query.getUnit());
        wrapper.eq(StringUtils.isNotEmpty(query.getWasteWaterFlow()), "waste_water_flow", query.getWasteWaterFlow());
        wrapper.ge(StringUtils.isNotEmpty(query.getCheckCycleStart()), "check_cycle_start", DateUtils.parseDate(query.getCheckCycleStart()));
        wrapper.le(StringUtils.isNotEmpty(query.getCheckCycleEnd()), "check_cycle_end", DateUtils.parseDate(query.getCheckCycleEnd()));
        wrapper.eq(StringUtils.isNotEmpty(query.getCheckRunTime()), "check_run_time", query.getCheckRunTime());
        wrapper.eq(StringUtils.isNotEmpty(query.getRunTimeSource()), "run_time_source", query.getRunTimeSource());
        wrapper.eq(StringUtils.isNotEmpty(query.getEmissions()), "emissions", query.getEmissions());
        wrapper.eq(StringUtils.isNotEmpty(query.getCreateBy()), "create_by", query.getCreateBy());
        wrapper.eq(StringUtils.isNotEmpty(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(StringUtils.isNotEmpty(query.getUpdateBy()), "update_by", query.getUpdateBy());
        wrapper.eq(StringUtils.isNotEmpty(query.getUpdateTime()), "update_time", query.getUpdateTime());
        wrapper.like(StringUtils.isNotEmpty(query.getFactoryName()), "factory_name", query.getFactoryName());
        wrapper.like(StringUtils.isNotEmpty(query.getIndustryCategoryName()), "industry_category_name", query.getIndustryCategoryName());
        wrapper.eq(StringUtils.isNotEmpty(query.getIndustryCategoryCode()), "industry_category_code", query.getIndustryCategoryCode());
        wrapper.like(StringUtils.isNotEmpty(query.getDistrictName()), "district_name", query.getDistrictName());
        wrapper.eq(StringUtils.isNotEmpty(query.getDistrictCode()), "district_code", query.getDistrictCode());
        return wrapper;
    }
}
