fei
2025-12-10 6adcb9d2eaa5676fbbaa251dca95a12f40223f4a
archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
@@ -28,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);
@@ -63,4 +63,12 @@
            "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);
}