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

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

/**
 * 人工打分 评估维度 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface ModelAssessTaskDimensionBackupMapper extends BaseMapperX<ModelAssessTaskDimensionBackupDO> {

    default PageResult<ModelAssessTaskDimensionBackupDO> selectPage(ModelAssessTaskDimensionBackupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ModelAssessTaskDimensionBackupDO>()
                .eqIfPresent(ModelAssessTaskDimensionBackupDO::getTaskId, reqVO.getTaskId())
                .eqIfPresent(ModelAssessTaskDimensionBackupDO::getDimensionId, reqVO.getDimensionId())
                .eqIfPresent(ModelAssessTaskDimensionBackupDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ModelAssessTaskDimensionBackupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ModelAssessTaskDimensionBackupDO::getId));
    }
    @Delete("delete from llm_model_assess_task_dimension_backup where task_id = #{id}")
    void deleteTrue(Long id);
}