package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.common.core.utils.StringUtils;
import cn.cecep.talroad.domain.BMainProductionWater;
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.util.List;


/**
 * 废水排放产治排信息对象 b_main_production_water
 *
 * @author szhpt
 * @date 2023-02-08*/
@ApiModel(value = "废水排放产治排信息")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainProductionWaterQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private Long id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排放口编号")
    private String outletCode;
    @ApiModelProperty(value = "排放口名称")
    private String outletName;
    @ApiModelProperty(value = "排放口类型")
    private String outletType;
    @ApiModelProperty(value = "排口监测类型")
    private String outletMonType;
    @ApiModelProperty(value = "治理设施编号")
    private String cepFacilityCode;
    @ApiModelProperty(value = "治理设施名称")
    private String cepFacilityName;
    @ApiModelProperty(value = "治理设施工艺")
    private String cepFacilityCraft;
    @ApiModelProperty(value = "污染物种类")
    private String pollutionType;
    @ApiModelProperty(value = "废水类别")
    private String waterType;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainProductionWater> createLambdaQueryWrapper(BMainProductionWaterQuery query) {
        QueryWrapper<BMainProductionWater> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.like(StringUtils.isNotEmpty(query.getOutletCode()), "outlet_code", query.getOutletCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getOutletName()), "outlet_name", query.getOutletName());
        wrapper.eq(StringUtils.isNotEmpty(query.getOutletType()), "outlet_type", query.getOutletType());
        wrapper.eq(StringUtils.isNotEmpty(query.getOutletMonType()), "outlet_mon_type", query.getOutletMonType());
        wrapper.like(StringUtils.isNotEmpty(query.getCepFacilityCode()), "cep_facility_code", query.getCepFacilityCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getCepFacilityName()), "cep_facility_name", query.getCepFacilityName());
        wrapper.eq(StringUtils.isNotEmpty(query.getCepFacilityCraft()), "cep_facility_craft", query.getCepFacilityCraft());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollutionType()), "pollution_type", query.getPollutionType());
        wrapper.eq(StringUtils.isNotEmpty(query.getWaterType()), "water_type", query.getWaterType());
        wrapper.orderByAsc("outlet_code", "id");
        return wrapper;
    }

    @ApiModel(value = "排污许可-废水类别及治理设施信息query")
    @Data
    public static class PwxkCzp {
        @ApiModelProperty(value = "企业查询条件")
        private PcFactoryQuery.SearchVo searchVo;

        @ApiModelProperty(value = "废水类别")
        private String waterType;

        @ApiModelProperty(value = "污染物种类")
        private List<String> pollutionType;

        @ApiModelProperty(value = "治理设施工艺")
        private List<String> cepFacilityCraft;

        @ApiModelProperty(value = "排口类型 1:主要排口, 2:一般排口")
        private String outletTypes;

        @ApiModelProperty(value = "排放口设置是否符合要求 0:否, 1:是")
        private String whetherOutletRequirements;

        @ApiModelProperty(value = "排水去向")
        private List<String> directionDrainage;

        @ApiModelProperty(value = "排放规律")
        private List<String> dischargeLaw;

        @ApiModelProperty(value = "排放形式。 直接排放/间接排放")
        private String emissionsForm;
    }
}
