| | |
| | | @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); |
| | | |
| | | |
| | |
| | | "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); |
| | | |
| | | } |