package cn.cecep.talroad.vo.query;

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


/**
 * 企业与污染物关系对象 pc_factory_pollutant
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "企业与污染物关系")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcFactoryPollutantQuery extends PageQuery
{

    @ApiModelProperty(value = "中间表id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "排口id")
    private String outletId;
    @ApiModelProperty(value = "污染物id")
    private String pollutantId;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcFactoryPollutant> createLambdaQueryWrapper(PcFactoryPollutantQuery query) {
        QueryWrapper<PcFactoryPollutant> 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.getPollutantId()), "pollutant_id", query.getPollutantId());
        return wrapper;
        }
}
