WMS出库查询问题修改
This commit is contained in:
@@ -409,4 +409,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.uniqueId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 出库列表:按单号批量聚合(仅 level=1,与列表上对父行汇总一致) -->
|
||||
<select id="selectAggregatesForStockOutList" resultType="com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg">
|
||||
SELECT
|
||||
a.out_order_number AS outOrderNumber,
|
||||
COALESCE(SUM(a.outbound_quantity), 0) AS totalOutboundQuantity,
|
||||
COALESCE(SUM(a.check_quantity), 0) AS checkQuantitySum,
|
||||
COUNT(DISTINCT CASE
|
||||
WHEN a.material_base_info_id IS NOT NULL THEN CAST(a.material_base_info_id AS VARCHAR(50))
|
||||
ELSE a.material_code
|
||||
END) AS materialKindCountDistinct
|
||||
FROM out_material_detail a
|
||||
WHERE a.del_flag = 1
|
||||
AND a.level = 1
|
||||
AND a.out_order_number IN
|
||||
<foreach collection="outOrderNumbers" item="num" open="(" separator="," close=")">
|
||||
#{num}
|
||||
</foreach>
|
||||
GROUP BY a.out_order_number
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user