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.BEnterpriseIrSdoept;
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_enterprise_ir_sdoept
 *
 * @author szhpt
 * @date 2023-03-14*/
@ApiModel(value = "知识库-排污治理科普库")
@EqualsAndHashCode(callSuper = false)
@Data
public class BEnterpriseIrSdoeptQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "排污治理科普库分类")
    private String sdoeptType;
    @ApiModelProperty(value = "排污治理科普库名称")
    private String sdoeptName;
    @ApiModelProperty(value = "排污治理科普库标题")
    private String sdoeptTitle;
    @ApiModelProperty(value = "排污治理科普库内容")
    private String sdoeptDetails;
    @ApiModelProperty(value = "排污治理科普库附件名称")
    private String sdoeptFileName;
    @ApiModelProperty(value = "排污治理科普库附件url")
    private String sdoeptFileUrl;
    @ApiModelProperty(value = "实施时间")
    private String sdoeptTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<BEnterpriseIrSdoept> createLambdaQueryWrapper(BEnterpriseIrSdoeptQuery query) {
        QueryWrapper<BEnterpriseIrSdoept> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getSdoeptType()), "sdoept_type", query.getSdoeptType());
        wrapper.like(StringUtils.isNotEmpty(query.getSdoeptName()), "sdoept_name", query.getSdoeptName());
        wrapper.like(StringUtils.isNotEmpty(query.getSdoeptTitle()), "sdoept_title", query.getSdoeptTitle());
        wrapper.eq(StringUtils.isNotEmpty(query.getSdoeptDetails()), "sdoept_details", query.getSdoeptDetails());
        wrapper.eq(StringUtils.isNotEmpty(query.getSdoeptFileName()), "sdoept_file_name", query.getSdoeptFileName());
        wrapper.eq(StringUtils.isNotEmpty(query.getSdoeptFileUrl()), "sdoept_file_url", query.getSdoeptFileUrl());
        wrapper.eq(StringUtils.isNotEmpty(query.getSdoeptTime()), "sdoept_time", query.getSdoeptTime());
        wrapper.orderByDesc("sdoept_time");
        return wrapper;
        }
}
