package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.annotation.Excel;
import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.SupermonitorDrainOutlet;
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;


/**
 * 排污口对象 m_supermonitor_drain_outlet
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "排污口")
@EqualsAndHashCode(callSuper = false)
@Data
public class SupermonitorDrainOutletQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排口id")
    private String outletId;
    @ApiModelProperty(value = "排放口类型（入河、雨水）")
    private String outletType;
    @ApiModelProperty(value = "排放口编号")
    private String outletCode;
    @ApiModelProperty(value = "排放口名称")
    private String outletName;
    @ApiModelProperty(value = "入河排污口批复文号")
    private String approvalDocument;
    @ApiModelProperty(value = "其他信息")
    private String otherInformation;
    @ApiModelProperty(value = "排放口地理位置-经度")
    private String lon;
    @ApiModelProperty(value = "排放口地理位置-纬度")
    private String lat;
    @ApiModelProperty(value = "排水去向")
    private String drainageTo;
    @ApiModelProperty(value = "排放规律")
    private String emissionsLaws;
    @ApiModelProperty(value = "间歇式排放时间段")
    private String intermittentEmissionPeriod;
    @ApiModelProperty(value = "受纳自然水体信息-名称")
    private String receivingWaterName;
    @ApiModelProperty(value = "受纳自然水体信息-功能目标")
    private String receivingWaterObjective;
    @ApiModelProperty(value = "汇入受纳自然水体处地理坐标-经度")
    private String receivingWaterLon;
    @ApiModelProperty(value = "汇入受纳自然水体处地理坐标-纬度")
    private String receivingWaterLat;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<SupermonitorDrainOutlet> createLambdaQueryWrapper(SupermonitorDrainOutletQuery query) {
        QueryWrapper<SupermonitorDrainOutlet> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getFactoryId()), "factory_id", query.getFactoryId());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletId()), "outlet_id", query.getOutletId());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletType()), "outlet_type", query.getOutletType());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletCode()), "outlet_code", query.getOutletCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getOutletName()), "outlet_name", query.getOutletName());
        wrapper.eq(ObjectUtil.isNotNull(query.getApprovalDocument()), "approval_document", query.getApprovalDocument());
        wrapper.eq(ObjectUtil.isNotNull(query.getOtherInformation()), "other_information", query.getOtherInformation());
        wrapper.eq(ObjectUtil.isNotNull(query.getLon()), "lon", query.getLon());
        wrapper.eq(ObjectUtil.isNotNull(query.getLat()), "lat", query.getLat());
        wrapper.eq(ObjectUtil.isNotNull(query.getDrainageTo()), "drainage_to", query.getDrainageTo());
        wrapper.eq(ObjectUtil.isNotNull(query.getEmissionsLaws()), "emissions_laws", query.getEmissionsLaws());
        wrapper.eq(ObjectUtil.isNotNull(query.getIntermittentEmissionPeriod()), "intermittent_emission_period", query.getIntermittentEmissionPeriod());
        wrapper.eq(ObjectUtil.isNotNull(query.getReceivingWaterName()), "receiving_water_name", query.getReceivingWaterName());
        wrapper.eq(ObjectUtil.isNotNull(query.getReceivingWaterObjective()), "receiving_water_objective", query.getReceivingWaterObjective());
        wrapper.eq(ObjectUtil.isNotNull(query.getReceivingWaterLon()), "receiving_water_lon", query.getReceivingWaterLon());
        wrapper.eq(ObjectUtil.isNotNull(query.getReceivingWaterLat()), "receiving_water_lat", query.getReceivingWaterLat());
        wrapper.orderByAsc("outlet_code", "id");
        return wrapper;
    }

    @ApiModel(value = "排污许可-入河排口信息query")
    @Data
    public static class PwxkRh {
        @ApiModelProperty(value = "企业查询条件")
        private PcFactoryQuery.SearchVo searchVo;

        @ApiModelProperty(value = "入河口名称")
        private String riversOutletName;

        @ApiModelProperty(value = "入河口编号")
        private String riversOutletCode;
    }

    @ApiModel(value = "排污许可-雨水排口信息query")
    @Data
    public static class PwxkYs {
        @ApiModelProperty(value = "企业查询条件")
        private PcFactoryQuery.SearchVo searchVo;

        @ApiModelProperty(value = "排放口编号")
        private String outletCode;

        @ApiModelProperty(value = "排放口名称")
        private String outletName;

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

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

        @ApiModelProperty(value = "受纳自然水体信息-名称")
        private String receivingWaterName;

        @ApiModelProperty(value = "受纳自然水体信息-功能目标")
        private String receivingWaterObjective;
    }

}
