fei
1 天以前 e899d2709f21b322232fb64778fef296233be3f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.ruoyi.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.DocumentMaterials;
import com.ruoyi.domain.vo.DocumentMaterialsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
@Mapper
public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> {
 
    @Select("update document_materials SET url = #{url},file_number=#{fileNumber},page_order=#{pageOrder},width=#{width},height=#{height},file_size=#{fileSize}, format=#{format} where page_number = #{pageNumber}")
    Long updateInfoByPageNumber(@Param("pageNumber") Long pageNumber,@Param("fileNumber") Long fileNumber,@Param("pageOrder") Long pageOrder,@Param("width") int width, @Param("height") int height, @Param("fileSize") Double fileSize,@Param("url")  String url,@Param("format")  String format);
 
 
    //根据题名拿到最大的pageOrder
    @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage}")
    Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage);
 
    //计算文件的序号
    @Select("select count(distinct(title))-1 from document_materials where  page_number<=#{pageNumber}")
    Long getFileNumber(@Param("pageNumber") Long pageNumber);
 
    //查询卷内目录
    @Select("select creator,title, date, page_number,remarks from document_materials\n" +
            "WHERE page_number  IN (\n" +
            "    SELECT MIN(page_number)\n" +
            "    FROM document_materials where record_id=#{recordId}\n" +
            "    GROUP BY stage, title\n" +
            ") order by page_number ;")
    List<DocumentMaterialsVo> getArchiveMatInfo(@Param("recordId") String recordId);
}