package cn.cecep.talroad.vo.query;

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


/**
 * 固危废贮存信息对象 b_main_solid_hazardous
 *
 * @author szhpt
 * @date 2023-01-18*/
@ApiModel(value = "固危废贮存信息")
@EqualsAndHashCode(callSuper = false)
@Data
public class BMainSolidHazardousQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "企业id")
    private String factoryId;
    @ApiModelProperty(value = "自行贮存设施名称")
    private String facilityName;
    @ApiModelProperty(value = "自行贮存设施编号")
    private String facilityCode;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BMainSolidHazardous> createLambdaQueryWrapper(BMainSolidHazardousQuery query) {
        QueryWrapper<BMainSolidHazardous> 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.getFacilityName()), "facility_name", query.getFacilityName());
        wrapper.eq(ObjectUtil.isNotNull(query.getFacilityCode()), "facility_code", query.getFacilityCode());
        wrapper.orderByAsc("facility_name", "id");
        return wrapper;
    }
}
