refactor(data-management): 移除未使用的数据库操作方法并优化查询条件

- 从 DatasetFileMapper 中移除未使用的 update 和 deleteById 方法
- 从 DatasetMapper 中移除未使用的 deleteById 方法
- 在 Python 项目中添加 or_ 操作符导入用于复杂查询
- 为数据集文件查询添加状态过滤条件,排除已归档的文件记录
This commit is contained in:
2026-02-05 03:21:06 +08:00
parent 9057807ec1
commit c03bdf1a24
5 changed files with 5 additions and 27 deletions

View File

@@ -26,8 +26,6 @@ public interface DatasetFileMapper extends BaseMapper<DatasetFile> {
@Param("status") String status,
RowBounds rowBounds);
int update(DatasetFile file);
int deleteById(@Param("id") String id);
int updateFilePathPrefix(@Param("datasetId") String datasetId,
@Param("oldPrefix") String oldPrefix,
@Param("newPrefix") String newPrefix);

View File

@@ -28,6 +28,5 @@ public interface DatasetMapper extends BaseMapper<Dataset> {
@Param("keyword") String keyword,
@Param("tagNames") List<String> tagNames);
int deleteById(@Param("id") String id);
AllDatasetStatisticsResponse getAllDatasetStatistics();
}

View File

@@ -97,24 +97,6 @@
</select>
<update id="update" parameterType="com.datamate.datamanagement.domain.model.dataset.DatasetFile">
UPDATE t_dm_dataset_files
SET file_name = #{fileName},
file_path = #{filePath},
logical_path = #{logicalPath},
version = #{version},
file_type = #{fileType},
file_size = #{fileSize},
upload_time = #{uploadTime},
last_access_time = #{lastAccessTime},
status = #{status}
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="string">
DELETE FROM t_dm_dataset_files WHERE id = #{id}
</delete>
<update id="updateFilePathPrefix">
UPDATE t_dm_dataset_files
SET file_path = CONCAT(#{newPrefix}, SUBSTRING(file_path, LENGTH(#{oldPrefix}) + 1))

View File

@@ -139,10 +139,6 @@
</where>
</select>
<delete id="deleteById" parameterType="string">
DELETE FROM t_dm_datasets WHERE id = #{id}
</delete>
<select id="getAllDatasetStatistics" resultType="com.datamate.datamanagement.interfaces.dto.AllDatasetStatisticsResponse">
SELECT
(SELECT COUNT(*) FROM t_dm_datasets) AS total_datasets,