You've already forked DataMate
feat(repository): 添加查询衍生文件源文件ID功能
- 在 DatasetFileRepository 接口中添加 findSourceFileIdsWithDerivedFiles 方法定义 - 在 DatasetFileRepositoryImpl 实现类中实现该方法 - 添加查询 metadata 中包含 derived_from_file_id 记录的源文件ID逻辑 - 提供完整的 JavaDoc 文档注释说明方法用途和参数
This commit is contained in:
@@ -102,4 +102,12 @@
|
||||
WHERE dataset_id = #{datasetId}
|
||||
AND file_path LIKE CONCAT(#{oldPrefix}, '%')
|
||||
</update>
|
||||
|
||||
<select id="findSourceFileIdsWithDerivedFiles" resultType="java.lang.String">
|
||||
SELECT DISTINCT JSON_UNQUOTE(JSON_EXTRACT(metadata, '$.derived_from_file_id')) AS source_file_id
|
||||
FROM t_dm_dataset_files
|
||||
WHERE dataset_id = #{datasetId}
|
||||
AND metadata IS NOT NULL
|
||||
AND JSON_EXTRACT(metadata, '$.derived_from_file_id') IS NOT NULL
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user