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

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

/**
 * 向量化存储 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface KnowledgeDocumentsChunksVectorizedMapper extends BaseMapperX<KnowledgeDocumentsChunksVectorizedDO> {

    default PageResult<KnowledgeDocumentsChunksVectorizedDO> selectPage(KnowledgeDocumentsChunksVectorizedPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KnowledgeDocumentsChunksVectorizedDO>()
                .eqIfPresent(KnowledgeDocumentsChunksVectorizedDO::getKnowledgeBaseId, reqVO.getKnowledgeBaseId())
                .eqIfPresent(KnowledgeDocumentsChunksVectorizedDO::getDocumentId, reqVO.getDocumentId())
                .eqIfPresent(KnowledgeDocumentsChunksVectorizedDO::getIndexInDocument, reqVO.getIndexInDocument())
                .betweenIfPresent(KnowledgeDocumentsChunksVectorizedDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(KnowledgeDocumentsChunksVectorizedDO::getChunkText, reqVO.getChunkText())
                .orderByDesc(KnowledgeDocumentsChunksVectorizedDO::getId));
    }

}