From 2ead57f252fe2a6e21205a114df0d160a4c63cbe Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 13 Jun 2025 08:47:20 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=9B=B8=E5=85=B3SQL=E6=B7=BB=E5=8A=A0is=5Fflag=20=3D?= =?UTF-8?q?=20'1'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/mes/MesOrderBindMapper.xml | 4 +--- .../main/resources/mapper/mes/MesPurchaseOrderMapper.xml | 4 +--- .../main/resources/mapper/wms/WmsProductInstockMapper.xml | 5 ++--- .../main/resources/mapper/wms/WmsProductStockMapper.xml | 4 ++-- .../mapper/wms/WmsProductStockSaleorderMapper.xml | 3 +-- .../src/main/resources/mapper/wms/WmsRawOutstockMapper.xml | 3 +-- .../src/main/resources/mapper/wms/WmsRawStockMapper.xml | 3 +-- .../src/main/resources/mapper/wms/WmsStockTotalMapper.xml | 7 +++---- 8 files changed, 12 insertions(+), 21 deletions(-) diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml index 89fb8437..e364e3e0 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml @@ -147,10 +147,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mso.order_amount from mes_order_bind mob left join mes_base_material_info pbmi on mob.product_id=pbmi.material_id left join mes_base_material_info mbmi on mob.material_id=mbmi.material_id - left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id - + left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id and mso.is_flag = '1' - mso.is_flag = '1' and mob.bind_amount=1 and mob.barcode_amount=0 and mso.order_amount=1 and mob.bind_amount > mob.barcode_amount and mob.safe_flag = #{safeFlag} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index c9902466..dc804b29 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -467,10 +467,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from mes_purchase_order mpo left join mes_order_bind mob on mpo.purchase_order_id = mob.purchase_order_id left join mes_base_material_info pbmi on mob.product_id=pbmi.material_id left join mes_base_material_info mbmi on mob.material_id=mbmi.material_id - left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id - + left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id and mso.is_flag = '1' - mso.is_flag = '1' and mob.bind_amount=1 and mob.barcode_amount=0 and mpo.order_amount=1 and mso.order_amount=1 and (mob.bind_amount > mob.barcode_amount or mbmi.always_flag='1') and mob.safe_flag = #{safeFlag} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml index 08fffd4d..8ee89bcd 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml @@ -254,9 +254,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_material_info mbmi on mbmi.material_id = wpi.product_id left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wpi.plan_code - left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id - where mso.is_flag = '1' - and wpi.product_type = '3' + left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id and mso.is_flag = '1' + where wpi.product_type = '3' and wpi.execute_status = '2' and (wpi.erp_status is null or wpi.erp_status != '1') and wpi.instock_amount > if(wpi.erp_amount is null, 0, wpi.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml index 011a601a..6c7ef402 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml @@ -276,9 +276,9 @@ from wms_product_stock wps left join mes_base_material_info mbmi on wps.product_id=mbmi.material_id left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id - left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id + left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id and mso.is_flag = '1' - mso.is_flag = '1' and wps.total_amount>0 and wps.stock_type='3' + wps.total_amount>0 and wps.stock_type='3' and mso.saleorder_code = #{saleorderCode} and wps.warehouse_id = #{warehouseId} and wps.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml index b484d0cf..f54a0c54 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml @@ -146,11 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wpss.total_amount,wpss.apply_amount, wpss.occupy_amount,wpss.frozen_amount,wpss.outstock_amount, wpss.confirm_amount, mso.order_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name from wms_product_stock_saleorder wpss - left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id + left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id and mso.is_flag = '1' left join wms_base_warehouse wbw on wpss.warehouse_id=wbw.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id=wpss.product_id - mso.is_flag = '1' and wpss.saleorder_code = #{saleorderCode} and wpss.warehouse_id = #{warehouseId} and wpss.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml index 71ccc0d2..3e6f1d59 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml @@ -390,9 +390,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_material_info mbmi on mbmi.material_id = wro.material_id left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wro.plan_code - left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id + left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id and mso.is_flag = '1' - mso.is_flag = '1' and wro.real_outstock_amount > 0 and wro.outstock_amount >= wro.real_outstock_amount and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index 96f4a215..41984d7c 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -322,10 +322,9 @@ from wms_raw_stock wrs left join wms_base_warehouse wbw on wbw.warehouse_id = wrs.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id = wrs.material_id - left join mes_sale_order mso on wrs.sale_order_id = mso.sale_order_id + left join mes_sale_order mso on wrs.sale_order_id = mso.sale_order_id and mso.is_flag = '1' left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id - mso.is_flag = '1' and wrs.warehouse_id = #{warehouseId} and wrs.location_code = #{locationCode} and wrs.stock_type = #{stockType} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index df69fb1e..604127d7 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -270,10 +270,10 @@ from wms_stock_total wst left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id - left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id + left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id and mso.is_flag = '1' left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id - mso.is_flag = '1' and wst.total_amount > 0 + wst.total_amount > 0 and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wst.stock_type = #{stockType} @@ -325,9 +325,8 @@ from wms_stock_total wst left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id - left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id + left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id and mso.is_flag = '1' - mso.is_flag = '1' and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wbw.warehouse_type = #{warehouseType}