package cn.cecep.talroad.vo.query.analysis;

import cn.cecep.talroad.common.core.domain.query.PageQuery;
import cn.cecep.talroad.domain.analysis.PcRaProblemType;
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_ra_problem_type
 *
 * @author szhpt
 * @date 2023-03-24*/
@ApiModel(value = "问题分类")
@EqualsAndHashCode(callSuper = false)
@Data
public class PcRaProblemTypeQuery extends PageQuery
{

    @ApiModelProperty(value = "主键id")
    private String id;
    @ApiModelProperty(value = "分类名称")
    private String name;
    @ApiModelProperty(value = "父分类id")
    private String parentId;
    @ApiModelProperty(value = "排序")
    private Long sort;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;
    /**
     *
     * @Title: getQueryWrapper
     * @Description: 查询参数组装
     * @param: @return
     * @return: QueryWrapper<BasIndustry>
     * @throws
     */
    public static QueryWrapper<PcRaProblemType> createLambdaQueryWrapper(PcRaProblemTypeQuery query) {
        QueryWrapper<PcRaProblemType> wrapper = new QueryWrapper<>();
        wrapper.eq(ObjectUtil.isNotNull(query.getId()), "id", query.getId());
        wrapper.eq(ObjectUtil.isNotNull(query.getName()), "name", query.getName());
        wrapper.eq(ObjectUtil.isNotNull(query.getParentId()), "parent_id", query.getParentId());
        wrapper.eq(ObjectUtil.isNotNull(query.getSort()), "sort", query.getSort());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateBy()), "create_by", query.getCreateBy());
        wrapper.eq(ObjectUtil.isNotNull(query.getCreateTime()), "create_time", query.getCreateTime());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateBy()), "update_by", query.getUpdateBy());
        wrapper.eq(ObjectUtil.isNotNull(query.getUpdateTime()), "update_time", query.getUpdateTime());
        return wrapper;
        }
}
