4 天以前 06321d70dd7617fdc7d475b190e629143fec3263
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package cn.iocoder.yudao.module.mes.dal.mysql.home;
 
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
 
/**
 * MES 基础数据与一袋一码 首页统计 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface MesBagCodeHomeStatisticsMapper {
 
    // ========== 基础数据 ==========
 
    /** 统计品种总数(mdm_item) */
    Long selectMdmItemCount();
 
    /** 统计 MES 品种数(mes_md_item) */
    Long selectMesItemCount();
 
    /** 统计品种分类数(mes_md_item_type) */
    Long selectItemTypeCount();
 
    /** 统计计量单位数(mdm_unit_measure) */
    Long selectUnitMeasureCount();
 
    // ========== 一袋一码 ==========
 
    /** 统计产线数(mes_pro_line) */
    Long selectLineCount();
 
    /** 统计批次总数(mes_pro_batch) */
    Long selectBatchCount();
 
    /** 统计袋码总数(mes_pro_bag_code) */
    Long selectBagCodeCount();
 
    /** 统计托盘码总数(mes_pro_pallet) */
    Long selectPalletCount();
 
    // ========== 状态分布 ==========
 
    /**
     * 按状态统计批次数量
     *
     * @return [{ "status": 10, "count": 5 }, ...]
     */
    List<Map<String, Object>> selectBatchCountGroupByStatus();
 
    /**
     * 按状态统计袋码数量
     *
     * @return [{ "status": 10, "count": 5 }, ...]
     */
    List<Map<String, Object>> selectBagCodeCountGroupByStatus();
 
    // ========== 趋势 ==========
 
    /**
     * 按天聚合袋码生成量(近 N 天)
     *
     * @param beginTime >= 开始时间
     * @param endTime   < 结束时间
     * @return [{ "date": "2026-08-13", "count": 123 }, ...]
     */
    List<Map<String, Object>> selectDailyBagCodeTrend(@Param("beginTime") LocalDateTime beginTime,
                                                      @Param("endTime") LocalDateTime endTime);
 
}