package cn.iocoder.yudao.module.llm.dal.mysql.dataset;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;

import cn.iocoder.yudao.module.llm.controller.admin.dataset.vo.DatasetQuestionPageReqVO;
import cn.iocoder.yudao.module.llm.dal.dataobject.dataset.DatasetQuestionDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 数据集数据问题 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface DatasetQuestionMapper extends BaseMapperX<DatasetQuestionDO> {

    default PageResult<DatasetQuestionDO> selectPage(DatasetQuestionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DatasetQuestionDO>()
                .eqIfPresent(DatasetQuestionDO::getDatasetId, reqVO.getDatasetId())
                .eqIfPresent(DatasetQuestionDO::getDatasetFilesId, reqVO.getDatasetFilesId())
                .eqIfPresent(DatasetQuestionDO::getQuestion, reqVO.getQuestion())
                .eqIfPresent(DatasetQuestionDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(DatasetQuestionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DatasetQuestionDO::getId));
    }

}