package cn.cecep.talroad.vo.query;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.PcAdsl;
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_adsl
 *
 * @author szhpt
 * @date 2023-02-02*/
@ApiModel(value = "企业接入数据类型")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcAdslQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private Long adslId;
    @ApiModelProperty(value = "接入数据类型编码")
    private String adslName;
    @ApiModelProperty(value = "接入数据类型名称")
    private String adslCode;
    @ApiModelProperty(value = "是否启用")
    private String adslEnable;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcAdsl> createLambdaQueryWrapper(PcAdslQuery query) {
        QueryWrapper<PcAdsl> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getAdslId()), "adsl_id", query.getAdslId());
        wrapper.eq(ObjectUtil.isNotNull(query.getAdslName()), "adsl_name", query.getAdslName());
        wrapper.eq(ObjectUtil.isNotNull(query.getAdslCode()), "adsl_code", query.getAdslCode());
        wrapper.eq(ObjectUtil.isNotNull(query.getAdslEnable()), "adsl_enable", query.getAdslEnable());
        wrapper.eq("adsl_enable", 1);
        wrapper.orderByAsc("sort");
        return wrapper;
        }
}
