2025-10-28 12:20:20 +08:00
|
|
|
|
package com.klp.mapper;
|
|
|
|
|
|
|
2025-10-29 16:55:26 +08:00
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
2026-04-20 14:29:33 +08:00
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
2025-10-28 12:20:20 +08:00
|
|
|
|
import com.klp.domain.WmsMaterialCoil;
|
2026-06-17 08:21:42 +08:00
|
|
|
|
import com.klp.domain.vo.*;
|
2025-10-28 12:20:20 +08:00
|
|
|
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
2025-10-29 14:40:09 +08:00
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
2026-03-07 14:37:12 +08:00
|
|
|
|
import com.klp.domain.vo.dashboard.CoilTrimRawVo;
|
2026-03-09 10:46:22 +08:00
|
|
|
|
import com.klp.domain.vo.dashboard.CategoryWidthRawVo;
|
2025-10-29 14:13:06 +08:00
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import java.util.Map;
|
2025-10-28 12:20:20 +08:00
|
|
|
|
|
|
|
|
|
|
public interface WmsMaterialCoilMapper extends BaseMapperPlus<WmsMaterialCoilMapper, WmsMaterialCoil, WmsMaterialCoilVo> {
|
|
|
|
|
|
|
2025-10-29 14:13:06 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询各个库区中不同类型的钢卷分布情况
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* 按库区分组,统计每种物品类型和物品ID的钢卷数量和重量
|
2025-10-29 14:13:06 +08:00
|
|
|
|
*
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* @param itemType 物品类型(可选)
|
|
|
|
|
|
* @param itemId 物品ID(可选)
|
2025-10-29 14:13:06 +08:00
|
|
|
|
* @return 分布情况列表
|
|
|
|
|
|
*/
|
2025-10-29 14:40:09 +08:00
|
|
|
|
List<Map<String, Object>> getDistributionByWarehouse(@Param("itemType") String itemType, @Param("itemId") Long itemId);
|
2025-10-29 14:13:06 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询不同类型的钢卷在不同库区的分布情况
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* 按物品类型和物品ID分组,统计每个库区的钢卷数量和重量
|
2025-10-29 14:13:06 +08:00
|
|
|
|
*
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* @param itemType 物品类型(可选)
|
|
|
|
|
|
* @param itemId 物品ID(可选)
|
2025-10-29 14:13:06 +08:00
|
|
|
|
* @return 分布情况列表
|
|
|
|
|
|
*/
|
2025-10-29 14:40:09 +08:00
|
|
|
|
List<Map<String, Object>> getDistributionByItemType(@Param("itemType") String itemType, @Param("itemId") Long itemId);
|
2025-10-29 16:55:26 +08:00
|
|
|
|
|
|
|
|
|
|
Page<WmsMaterialCoilVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<WmsMaterialCoil> lqw);
|
2025-10-30 14:59:46 +08:00
|
|
|
|
|
2026-03-12 17:05:22 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* orderBy=true 时使用:包含库位排序辅助字段(aw_sort_key/aw_layer_key/aw_id_key)以及父库位 join
|
|
|
|
|
|
*/
|
|
|
|
|
|
Page<WmsMaterialCoilVo> selectVoPagePlusOrderBy(Page<Object> build, @Param("ew") QueryWrapper<WmsMaterialCoil> lqw);
|
|
|
|
|
|
|
2026-06-02 11:11:55 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* orderByPlanDesc=true 时使用:包含发货计划 join,支持按计划创建时间排序
|
|
|
|
|
|
*/
|
|
|
|
|
|
Page<WmsMaterialCoilVo> selectVoPagePlusPlanOrder(Page<Object> build, @Param("ew") QueryWrapper<WmsMaterialCoil> lqw);
|
|
|
|
|
|
|
2025-10-30 14:59:46 +08:00
|
|
|
|
List<WmsMaterialCoilVo> selectVoListWithDynamicJoin(@Param("ew")QueryWrapper<WmsMaterialCoil> lqw);
|
2025-11-03 17:06:17 +08:00
|
|
|
|
|
2026-05-23 19:34:52 +08:00
|
|
|
|
Map<String, Object> selectCountForSpecSync(@Param("ew") QueryWrapper<WmsMaterialCoil> qw);
|
|
|
|
|
|
|
2025-11-03 17:06:17 +08:00
|
|
|
|
List<Map<String, Object>> getDistributionByActualWarehouse(@Param("itemType") String itemType, @Param("itemId") Long itemId);
|
2025-11-17 17:57:57 +08:00
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> getDistributionByActualItemType(@Param("itemType")String itemType,@Param("itemId") Long itemId);
|
2025-11-27 13:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询钢卷导出数据(包含所有关联字段)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param lqw 查询条件
|
|
|
|
|
|
* @return 导出数据列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<com.klp.domain.vo.WmsMaterialCoilExportVo> selectExportList(@Param("ew")QueryWrapper<WmsMaterialCoil> lqw);
|
2026-01-11 17:42:15 +08:00
|
|
|
|
|
2026-01-28 11:50:17 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询重复入场卷号的钢卷信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return 重复入场卷号的钢卷列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<WmsMaterialCoilVo> selectDuplicateEnterCoilNoList();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询重复当前卷号的钢卷信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return 重复当前卷号的钢卷列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<WmsMaterialCoilVo> selectDuplicateCurrentCoilNoList();
|
|
|
|
|
|
|
2026-01-11 17:42:15 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 更新钢卷发货撤回:将发货时间置空,状态改为指定值
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param coilId 钢卷ID
|
|
|
|
|
|
* @param status 目标状态
|
|
|
|
|
|
* @return 影响行数
|
|
|
|
|
|
*/
|
|
|
|
|
|
int updateForWithdrawExport(@Param("coilId") Long coilId, @Param("status") Integer status);
|
|
|
|
|
|
|
2026-01-29 16:22:36 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 发货报表导出:按钢卷ID列表联查(钢卷 + 发货单明细 + 发货单主表 + 发货计划)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param coilIds 钢卷ID集合
|
|
|
|
|
|
* @return 发货报表导出数据
|
|
|
|
|
|
*/
|
2026-06-02 11:11:55 +08:00
|
|
|
|
List<WmsMaterialCoilDeliveryExportVo> selectDeliveryExportListByCoilIds(@Param("coilIds") java.util.Collection<Long> coilIds);
|
2026-03-07 14:37:12 +08:00
|
|
|
|
|
2026-04-22 16:48:50 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 退火报表导出:按钢卷ID列表联查(钢卷 + 退火计划 + 退火计划钢卷关系)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param coilIds 钢卷ID集合
|
|
|
|
|
|
* @return 退火报表导出数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<WmsMaterialCoilAnnealExportVo> selectAnnealExportListByCoilIds(@Param("coilIds") java.util.Collection<Long> coilIds);
|
|
|
|
|
|
|
2026-05-19 14:18:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询钢卷报表数据(轻量级,仅返回必要字段)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param lqw 查询条件
|
|
|
|
|
|
* @return 分页报表数据
|
|
|
|
|
|
*/
|
2026-06-17 08:21:42 +08:00
|
|
|
|
List<WmsMaterialCoilReportVo> selectReportList(@Param("ew") QueryWrapper<WmsMaterialCoil> lqw);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询钢卷环比报表数据(轻量级,包含实际长度、理论长度、理论厚度)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param lqw 查询条件
|
|
|
|
|
|
* @return 环比报表数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<WmsMaterialCoilPeriodComparisonVo> selectPeriodComparisonList(@Param("ew") QueryWrapper<WmsMaterialCoil> lqw);
|
2026-05-19 14:18:18 +08:00
|
|
|
|
|
2026-03-07 14:37:12 +08:00
|
|
|
|
List<CoilTrimRawVo> selectCoilTrimStatistics();
|
2026-03-09 10:46:22 +08:00
|
|
|
|
|
|
|
|
|
|
List<CategoryWidthRawVo> selectCategoryWidthStatistics();
|
2026-04-08 14:18:59 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询itemId和itemType不匹配的钢卷
|
|
|
|
|
|
* @return 不匹配的钢卷列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<WmsMaterialCoil> selectMismatchedItemCoils();
|
2026-04-16 13:54:12 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 统计筛选条件下的全量汇总数据(高性能:只查sum/count)
|
|
|
|
|
|
* @param qw 查询条件(只使用WHERE和JOIN部分)
|
|
|
|
|
|
* @return 统计结果(Map包含totalGrossWeight, totalNetWeight)
|
|
|
|
|
|
*/
|
|
|
|
|
|
Map<String, Object> selectStatistics(@Param("ew") QueryWrapper<WmsMaterialCoil> qw);
|
2026-04-16 14:25:54 +08:00
|
|
|
|
|
2026-06-04 17:06:08 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 统计已发货钢卷的平均囤积周期和平均囤积成本
|
|
|
|
|
|
* 使用JSON_EXTRACT解析二维码steps[0].create_time,一次SQL完成聚合
|
|
|
|
|
|
* @param qw 查询条件(与buildQueryWrapperPlus一致)
|
|
|
|
|
|
* @return Map包含total_count, avg_hoarding_days, avg_hoarding_cost
|
|
|
|
|
|
*/
|
|
|
|
|
|
Map<String, Object> selectHoardingStatistics(@Param("ew") QueryWrapper<WmsMaterialCoil> qw);
|
|
|
|
|
|
|
2026-04-16 14:25:54 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 统计仓库使用次数(按warehouse_id出现次数排序)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param warehouseIds 仓库ID列表
|
|
|
|
|
|
* @return 每个仓库的钢卷数量
|
|
|
|
|
|
*/
|
|
|
|
|
|
List<Map<String, Object>> selectWarehouseIdCount(@Param("list") List<Long> warehouseIds);
|
2026-04-20 14:29:33 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页查询材质异常的钢卷
|
|
|
|
|
|
*/
|
|
|
|
|
|
IPage<WmsMaterialCoil> selectMaterialMismatchCoilsPage(IPage<WmsMaterialCoil> page);
|
2026-05-12 10:11:30 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据入场钢卷号查询最早的热轧卷板材质
|
|
|
|
|
|
* @param enterCoilNo 入场钢卷号
|
|
|
|
|
|
* @return 材质信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
String selectEarliestHotRolledMaterial(@Param("enterCoilNo") String enterCoilNo);
|
2025-10-28 12:20:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|