package cn.cecep.talroad.vo.analysis;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.BasModelAnalyse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BasModelAnalyseQuery  extends PageQuery {

    @ApiModelProperty(value="模型名称")
    private String modelName;

    /**
     * 参数名称
     */
    @ApiModelProperty(value="参数名称")
    private String paramName;

    public static QueryWrapper<BasModelAnalyse> createWrpper(BasModelAnalyseQuery query) {
        QueryWrapper<BasModelAnalyse> queryWrapper = Wrappers.query();
        queryWrapper.like(StringUtils.isNotBlank(query.getModelName()),BasModelAnalyse.COL_MODEL_NAME,query.getModelName());
        queryWrapper.like(StringUtils.isNotBlank(query.getParamName()),BasModelAnalyse.COL_PARAM_NAME,query.getParamName());
        queryWrapper.eq(BasModelAnalyse.COL_DELETE_STATUS,"0");
        return queryWrapper;
    }
}
