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.PcLabel;
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_label
 *
 * @author szhpt
 * @date 2023-01-10*/
@ApiModel(value = "特征标签")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcLabelQuery extends PageQuery
{

    @ApiModelProperty(value = "标签类型id")
    private String id;
    @ApiModelProperty(value = "标签类型")
    private String labelType;
    @ApiModelProperty(value = "标签类别")
    private String labelCategory;
    @ApiModelProperty(value = "标签编码")
    private String labelCode;
    @ApiModelProperty(value = "标签值")
    private String labelVal;
    @ApiModelProperty(value = "标签级别")
    private String labelLevel;
    @ApiModelProperty(value = "标签父类id")
    private String labelParamid;
    @ApiModelProperty(value = "排序")
    private int orderNum;
    @ApiModelProperty(value = "参数是否多选(0:单选，1:多选)")
    private String labelMultipleChoice;
    @ApiModelProperty(value = "更新时间")
    private String updateTimes;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcLabel> createLambdaQueryWrapper(PcLabelQuery query) {
        QueryWrapper<PcLabel> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelType()), "label_type", query.getLabelType());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelCategory()), "label_category", query.getLabelCategory());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelCode()), "label_code", query.getLabelCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelVal()), "label_val", query.getLabelVal());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelLevel()), "label_level", query.getLabelLevel());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelParamid()), "label_paramid", query.getLabelParamid());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelMultipleChoice()), "labelMultipleChoice", query.getLabelMultipleChoice());
        wrapper.orderByAsc("order_num");
        return wrapper;
        }
}
