From 07a2f9c762efb3be3a29e2e8cc7004d4164cc9d8 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期一, 22 十二月 2025 20:15:58 +0800
Subject: [PATCH] 修改了对应代码
---
archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
index 518b1ff..1d501f1 100644
--- a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
+++ b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.DocumentMaterials;
import com.ruoyi.domain.vo.DocumentMaterialFileStyle;
+import com.ruoyi.domain.vo.DocumentMaterialsFileList;
import com.ruoyi.domain.vo.DocumentMaterialsVo;
import com.ruoyi.domain.vo.DocumentMaterialsVoLarge;
import org.apache.ibatis.annotations.Mapper;
@@ -27,8 +28,8 @@
@Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage} and record_id=#{recordId}")
Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage, @Param("recordId") Long recordId);
- //璁$畻鏂囦欢鐨勫簭鍙�
- @Select("select count(distinct(title))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}")
+ //璁$畻鏂囦欢鐨勫簭鍙凤紝title鏈夊彲鑳介噸澶�
+ @Select("select count(distinct(concat_ws(',', title, stage)))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}")
Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId);
@@ -50,11 +51,36 @@
" is_canceled, format, size_type, horizontal_resolution, vertical_resolution, width,\n" +
" height, file_size, attachment_history_numbers,url, dm.remarks\n" +
" from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
- "and dm.record_id=#{recordId}")
+ "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
List<DocumentMaterialsVoLarge> getDocumentMaterialsvoLarge(@Param("recordId") int recordId);
-
+ @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,file_style, ar.record_id, ar.inquiry_number, ar.case_title, " +
+ " document_number, title, page_number, \n" +
+ " publicity, dm.retention_period, dm.remarks\n" +
+ " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
+ "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
+ List<DocumentMaterialsFileList> getDocumentMaterialsFileList(@Param("recordId") int recordId);
@Select("select count(*) as cnt, file_style from document_materials " +
"where record_id=#{recordId} GROUP BY file_style")
List<DocumentMaterialFileStyle> getFileStyleInfo(@Param("recordId") int recordId);
+
+ @Select("select if(count(*) < max(page_number), false, true) as res from document_materials where record_id=#{recordId}")
+ boolean isPageNumberLegal(@Param("recordId") int recordId);
+
+
+ //鎷垮埌闄ゅ叾瀹冩潗鏂欎箣澶栫殑鍏ㄩ儴鏁版嵁鐨勪釜鏁�
+ @Select("select count(*) FROM document_materials where file_style!='鍏朵粬鏉愭枡' and record_id=#{recordId}")
+ int getCount(@Param("recordId") int recordId);
+
+
+ //鍒ゆ柇鍗峰唴鐩綍鏄惁鍏ㄩ儴涓婁紶浜嗛檮浠�
+ @Select("select if(num=total_count, true, false) as res from (\n" +
+ "SELECT\n" +
+ " ROW_NUMBER() OVER (ORDER BY page_number) AS num, SUM(CASE WHEN dm.url IS NOT NULL THEN 1 ELSE 0 END) OVER() AS total_count\n" +
+ " from document_materials as dm, archive_records as ar \n" +
+ " WHERE ar.id = dm.record_id and page_number IN (SELECT MIN(page_number) \n" +
+ " FROM document_materials where record_id=#{recordId}\n" +
+ " GROUP BY stage, title) and ar.id =#{recordId} order by page_number desc limit 1) as res ")
+ Boolean judgeArchiveInfo( @Param("recordId") int recordId);
+
}
--
Gitblit v1.9.1