20260409修改内容
This commit is contained in:
@@ -82,19 +82,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="orderDate" column="ORDER_DATE" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 计划入库数量:入库明细主行 quantity 汇总(列表 quantity / plan_in_quantity 均以此为准展示) -->
|
||||
<sql id="sumPlanInMaterialQuantity">
|
||||
(select ifnull(sum(imd.quantity), 0)
|
||||
from in_material_detail imd
|
||||
where imd.in_order_number = a.in_order_number
|
||||
and imd.del_flag = 1
|
||||
and (imd.level is null or imd.level = 1))
|
||||
</sql>
|
||||
|
||||
<sql id="selectStockInOrderPo">
|
||||
a.in_order_id, a.organization_id, a.organization_name, a.top_organization_id, a.notice_number, a.in_order_number, a.status,
|
||||
a.audit_status, a.audit_remark, a.audit_by, a.audit_by_name, a.audit_time, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_code,
|
||||
a.shipper_name, a.order_type_code, a.order_type_name, a.supplier_id, a.supplier_code, a.supplier_name, a.expect_time, a.supply_chain_number,
|
||||
a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity,
|
||||
-- 计划入库数量:入库明细表 in_material_detail 的 quantity 汇总
|
||||
(select ifnull(sum(imd.quantity), 0)
|
||||
from in_material_detail imd
|
||||
where imd.in_order_number = a.in_order_number
|
||||
and imd.del_flag = 1
|
||||
and (imd.level is null or imd.level = 1)
|
||||
) as plan_in_quantity,
|
||||
a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity,
|
||||
<include refid="sumPlanInMaterialQuantity"/> as quantity,
|
||||
<include refid="sumPlanInMaterialQuantity"/> as plan_in_quantity,
|
||||
-- 收货数量:收货单表 stock_receipt_order 的 receipt_quantity 汇总
|
||||
(select ifnull(sum(sro.receipt_quantity), 0)
|
||||
from stock_receipt_order sro
|
||||
|
||||
Reference in New Issue
Block a user