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();
|
|
// ========== 出库流通 / 仓储 / 质量 ==========
|
|
/** 统计发货通知单数(mes_wm_sales_notice) */
|
Long selectSalesNoticeCount();
|
|
/** 统计销售出库单数(mes_wm_product_sales) */
|
Long selectProductSalesCount();
|
|
/** 统计销售退货单数(mes_wm_return_sales) */
|
Long selectReturnSalesCount();
|
|
/** 统计未处理库存预警数(mes_wm_stock_warning.status=10) */
|
Long selectStockWarningPendingCount();
|
|
/** 统计待评审不合格品单数(mes_qc_ncr.status=0) */
|
Long selectNcrPendingCount();
|
|
// ========== 状态分布 ==========
|
|
/**
|
* 按状态统计批次数量
|
*
|
* @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);
|
|
}
|