From f150561704223972e580ffb3a10321ce781abd23 Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Thu, 10 Oct 2024 16:23:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=91=E5=AE=A4=E5=BE=80=E6=9D=A5?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/mapper/inout/IoOrderDetailResultDao.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml index 609bae5d7..bc6f42b35 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml @@ -122,12 +122,12 @@ aw.code as fromInvCode, aw.name as fromInvName, SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0) - WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.price,0) * COALESCE(a2.count,0)) + WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.price,0) * COALESCE(a2.count,0)) ELSE 0 END) AS amount, SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.count,0) - WHEN a1.mainAction = 'WareHouseIn' THEN -(COALESCE(a2.count,0)) + WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.count,0)) ELSE 0 END) AS `count` @@ -176,13 +176,13 @@ SELECT aw.code as fromInvCode, aw.name as fromInvName, - bc.name as fromCorpName, - SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN -COALESCE(a2.price,0) * COALESCE(a2.count,0) + IFNULL(bc.name,aw2.name) as fromCorpName, + SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.price,0) * COALESCE(a2.count,0) WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.price,0) * COALESCE(a2.count,0)) ELSE 0 END) AS amount, - SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN -COALESCE(a2.count,0) + SUM(CASE WHEN a1.mainAction = 'WareHouseOut' THEN COALESCE(a2.count,0) WHEN a1.mainAction = 'WareHouseIn' THEN (COALESCE(a2.count,0)) ELSE 0 END) AS `count` @@ -192,8 +192,9 @@ LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk LEFT JOIN basic_udirel bu on bu.id = a2.bindRlFk LEFT JOIN basic_corp bc on bc.erpId = a1.fromCorp + LEFT JOIN auth_warehouse aw2 on a1.fromInvCode = aw2.CODE - a1.status = 7 and a1.fromCorp is not null + a1.status = 7 AND a1.invCode = #{invCode}