From 2f1ae9c10a1751438d09b3d848677deb883631aa Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期三, 14 一月 2026 11:28:16 +0800
Subject: [PATCH] 修改了对应代码

---
 archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
index 0f47537..ffcf2e1 100644
--- a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
+++ b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
@@ -12,10 +12,21 @@
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
+import java.util.Date;
 import java.util.List;
 
 @Mapper
 public interface ArchiveRecordsMapper extends BaseMapper<ArchiveRecords> {
+    @Select({
+            "<script>",
+            "select * from (SELECT distinct c.*,a.archive_records_id, if(a.user_id=#{userId}, TRUE, FALSE) as tst,b.user_id FROM archiverecordstouser a inner join sys_user b ON a.user_id = b.user_id inner join archive_records c on c.id=a.archive_records_id ${ew.customSqlSegment} ) as tmp\n" +
+                    "where tst=true",
+            "<if test= \"userId !=1 \">",
+            "order by tst desc",
+            "</if>",
+            "</script>"
+    })
+    Page<ArchiveRecords> selectJoinCommonUserPage(Page<ArchiveRecords> page, @Param("userId") Long userId, @Param("ew") LambdaQueryWrapper<ArchiveRecords> queryWrapper);
 
 
     @Select({
@@ -34,7 +45,7 @@
     @Select("UPDATE `archivesys`.`archive_records` SET  `inquiry_number` = '', `case_title` = NULL, `public_attribute` = NULL, `preparation_unit` = NULL, `preparation_date` = NULL, `retention_period` = NULL, `security_classification` = NULL, `page_count` = NULL, `filing_number` = NULL, `construction_unit` = NULL, `construction_address` = NULL, `project_name` = '', `project_number` = NULL, `scanning_company` = NULL, `archive_room_number` = NULL, `microfilm_number` = NULL, `remarks` = NULL, `historical_reference_number` = NULL, `record_status` = '寰呬慨鏀�', `every_project_name` = NULL WHERE `id` = #{id}")
     Long updateAllInfoById(@Param("id") Long id);
 
-    @Select("select record_id,archive_room_number,microfilm_number,inquiry_number,case_title,preparation_date,preparation_unit,retention_period,security_classification from archive_records where id=#{id}")
+    @Select("select record_id,page_count,archive_room_number,microfilm_number,inquiry_number,case_title,preparation_date,preparation_unit,retention_period,security_classification from archive_records where id=#{id}")
     ArchiveInfoVo findByRecordId(@Param("id") Long id);
 
     @Select("SELECT every_project_name, count(*) as cnt, (select count(*) from archive_records as ac where ac.every_project_name=ar.every_project_name and record_status='鏈綍鍏�') as unfinished,\n" +
@@ -46,8 +57,8 @@
     List<AnalysisResult> statisticAyasis();
 
 
-    @Select("update archive_records set record_status=#{status} where id=#{id}")
-    public void updateStatusById(@Param("status") String status, @Param("id")Long id);
+    @Select("update archive_records set record_status=#{status}, create_time=#{date} where id=#{id}")
+    public void updateStatusById(@Param("status") String status, @Param("id")Long id ,@Param("date") Date date);
 
     @Select("select ROW_NUMBER() OVER (ORDER BY record_id) AS num, filing_number, concat_ws(\" \", inquiry_number,record_id) as inqrid, case_title, public_attribute, (select count(*) as cnt from document_materials where record_id=ar.id) as cnt, remarks from archive_records as ar \n" +
             "${ew.customSqlSegment}")

--
Gitblit v1.9.1