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

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.dal.dataobject.finetuning.FineTuningDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.llm.controller.admin.finetuning.vo.*;

/**
 * 模型微调 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface FineTuningMapper extends BaseMapperX<FineTuningDO> {

    default PageResult<FineTuningDO> selectPage(FineTuningPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FineTuningDO>()
                .eqIfPresent(FineTuningDO::getBaseModelId, reqVO.getBaseModelId())
                .eqIfPresent(FineTuningDO::getTrainingDataSize, reqVO.getTrainingDataSize())
                .eqIfPresent(FineTuningDO::getEvaluationDataset, reqVO.getEvaluationDataset())
                .eqIfPresent(FineTuningDO::getAverageScore, reqVO.getAverageScore())
                .eqIfPresent(FineTuningDO::getEvaluationStatus, reqVO.getEvaluationStatus())
                .eqIfPresent(FineTuningDO::getLoraPath, reqVO.getLoraPath())
                .betweenIfPresent(FineTuningDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FineTuningDO::getId));
    }

}