yaowanxin
3 天以前 8f4db901aa772a808c243f8a4e39522f6f09d5da
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
36
37
38
39
40
41
42
43
44
package com.ruoyi.warehouse.mapper;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto;
import com.ruoyi.warehouse.dto.DocumentationDto;
import com.ruoyi.warehouse.pojo.Documentation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
import java.util.Map;
 
/**
* @author 86151
* @description 针对表【documentation(文档信息表)】的数据库操作Mapper
* @createDate 2025-08-14 14:05:49
* @Entity com.ruoyi.warehouse.pojo.Documentation
*/
@Mapper
public interface DocumentationMapper extends BaseMapper<Documentation> {
 
    IPage<DocumentationDto> listPage(Page page, @Param("documentation") Documentation documentation);
    List<DocumentationDto> list();
    List<DocumentationDto> listByDocumentClassificationId(@Param("documentClassificationId") Long documentClassificationId);
    List<DocumentationDto> listBywarehouseGoodsShelvesRowcolId(@Param("warehouseGoodsShelvesRowcolId") Long warehouseGoodsShelvesRowcolId);
    @Select("select count(*) from documentation")
    Integer countTotalDocs();
    @Select("select count(distinct document_classification_id) from documentation")
    Integer countCategoryNum();
    @Select("select count(*) from documentation where doc_status = '借出'")
    Integer countBorrowedDocs();
    @Select("select count(*) from documentation where create_time >= date_format(now(), '%Y-%m-01') and create_time < date_format(now(), '%Y-%m-%d')")
    Integer countMonthlyAddedDocs();
 
    @Select("select dc.category, count(*) as count from documentation doc left join document_classification dc on doc.document_classification_id = dc.id group by dc.category")
    List<Map<String, Object>> countCategoryDistribution();
 
    @Select("select doc_status as docStatus, count(*) as count from documentation group by doc_status")
    List<Map<String, Object>> countStatusDistribution();
 
}