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.BMainProductionOrganizGas;
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_organiz_gas
 *
 * @author szhpt
 * @date 2023-02-08*/
@ApiModel(value = "废气有组织排放产治排信息")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainProductionOrganizGasQuery 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 proFacilityCode;
    @ApiModelProperty(value = "生产设施名称")
    private String proFacilityName;
    @ApiModelProperty(value = "视频监控")
    private Long devId;
    @ApiModelProperty(value = "生产设施参数")
    private String proFacilityParam;
    @ApiModelProperty(value = "对应产污环节名称")
    private String pollutionProductionLink;
    @ApiModelProperty(value = "污染物种类")
    private String pollutionType;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainProductionOrganizGas> createLambdaQueryWrapper(BMainProductionOrganizGasQuery query) {
        QueryWrapper<BMainProductionOrganizGas> 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.like(StringUtils.isNotEmpty(query.getProFacilityCode()), "pro_facility_code", query.getProFacilityCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getProFacilityName()), "pro_facility_name", query.getProFacilityName());
        wrapper.eq(ObjectUtil.isNotNull(query.getDevId()), "dev_id", query.getDevId());
        wrapper.eq(StringUtils.isNotEmpty(query.getProFacilityParam()), "pro_facility_param", query.getProFacilityParam());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollutionProductionLink()), "pollution_production_link", query.getPollutionProductionLink());
        wrapper.eq(StringUtils.isNotEmpty(query.getPollutionType()), "pollution_type", query.getPollutionType());
        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 proFacilityCode;

        @ApiModelProperty(value = "生产设施名称")
        private String proFacilityName;

        @ApiModelProperty(value = "对应产污环节名称")
        private String pollutionProductionLink;

        @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;
    }
}
