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.PcLabelValue;
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_value
 *
 * @author szhpt
 * @date 2023-02-02*/
@ApiModel(value = "特征标签-参数值")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcLabelValueQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "特征标签id")
    private String labelId;
    @ApiModelProperty(value = "参数编码")
    private String argumentsCode;
    @ApiModelProperty(value = "参数名称")
    private String argumentsName;
    @ApiModelProperty(value = "排序")
    private int orderNum;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcLabelValue> createLambdaQueryWrapper(PcLabelValueQuery query) {
        QueryWrapper<PcLabelValue> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(query.getId()), "id", query.getId());
        wrapper.eq(StringUtils.isNotEmpty(query.getLabelId()), "label_id", query.getLabelId());
        wrapper.eq(StringUtils.isNotEmpty(query.getArgumentsCode()), "arguments_code", query.getArgumentsCode());
        wrapper.eq(StringUtils.isNotEmpty(query.getArgumentsName()), "arguments_name", query.getArgumentsName());
        wrapper.orderByAsc("order_num", "id");
        return wrapper;
        }
}
