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

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.modelassesstaskmanualbackup.vo.ManualModelAnswerBackupPageReqVO;
import cn.iocoder.yudao.module.llm.dal.dataobject.modelassesstaskmanualbackup.ManualModelAnswerBackupDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

/**
 * 模型评估人工标注 模型回答 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface ManualModelAnswerBackupMapper extends BaseMapperX<ManualModelAnswerBackupDO> {

    default PageResult<ManualModelAnswerBackupDO> selectPage(ManualModelAnswerBackupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ManualModelAnswerBackupDO>()
                .eqIfPresent(ManualModelAnswerBackupDO::getManalTaskId, reqVO.getManalTaskId())
                .eqIfPresent(ManualModelAnswerBackupDO::getQuestionId, reqVO.getQuestionId())
                .eqIfPresent(ManualModelAnswerBackupDO::getDatasetId, reqVO.getDatasetId())
                .eqIfPresent(ManualModelAnswerBackupDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ManualModelAnswerBackupDO::getModelAnswer, reqVO.getModelAnswer())
                .betweenIfPresent(ManualModelAnswerBackupDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ManualModelAnswerBackupDO::getReqRespVos, reqVO.getReqRespVos())
                .orderByDesc(ManualModelAnswerBackupDO::getId));
    }
    @Delete("delete from llm_manual_model_answer_backup where manal_task_id = #{id}")
    void deleteTrue(Long id);
}