package com.lingyue.graph.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lingyue.graph.entity.TextStorage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 文本存储Repository
 * 
 * @author lingyue
 * @since 2026-01-14
 */
@Mapper
public interface TextStorageRepository extends BaseMapper<TextStorage> {
    
    /**
     * 根据文档ID查询文本存储记录
     * 
     * @param documentId 文档ID
     * @return 文本存储记录
     */
    @Select("SELECT * FROM text_storage WHERE document_id = #{documentId}")
    TextStorage findByDocumentId(@Param("documentId") String documentId);
    
    /**
     * 根据文件路径查询
     * 
     * @param filePath 文件路径
     * @return 文本存储记录
     */
    @Select("SELECT * FROM text_storage WHERE file_path = #{filePath}")
    TextStorage findByFilePath(@Param("filePath") String filePath);
}
