|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.file.service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ruoyi.file.mapper.FileSequenceMapper;
|
|
|
import com.ruoyi.file.mapper.FilesMapper;
|
|
@@ -198,4 +199,35 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|
|
throw new RuntimeException("删除文件失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<Files> queryFiles(String filesName, LocalDateTime startTime, LocalDateTime endTime, Boolean isDeleted, String fileType, Page<Files> page) {
|
|
|
+ QueryWrapper<Files> queryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
+ // 默认查询未删除的文件
|
|
|
+ if (isDeleted == null) {
|
|
|
+ queryWrapper.eq("is_delete", 0);
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("is_delete", isDeleted ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (filesName != null && !filesName.isEmpty()) {
|
|
|
+ queryWrapper.like("files_name", filesName);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (startTime != null && endTime != null) {
|
|
|
+ queryWrapper.ge("create_time", startTime); // 大于等于起始时间
|
|
|
+ queryWrapper.le("create_time", endTime); // 小于等于结束时间
|
|
|
+ } else if (startTime != null) {
|
|
|
+ queryWrapper.ge("create_time", startTime); // 只有起始时间
|
|
|
+ } else if (endTime != null) {
|
|
|
+ queryWrapper.le("create_time", endTime); // 只有结束时间
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fileType != null && !fileType.isEmpty()) {
|
|
|
+ queryWrapper.eq("type", fileType);
|
|
|
+ }
|
|
|
+
|
|
|
+ return page(page, queryWrapper);
|
|
|
+ }
|
|
|
}
|