From ffbddedac17c4a7d18d382c4917b3f375356e061 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期二, 01 四月 2025 10:23:47 +0800
Subject: [PATCH] 整体流程测试修改0401-1

---
 platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml b/platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml
index 48f45ec..b4908b6 100644
--- a/platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml
+++ b/platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml
@@ -20,17 +20,39 @@
 		select
 			rni.id,
 			rni.num  ,
+			rni.device_code,
+			rni.device_name ,
+			rni.device_models ,
+			rni.key_parameter ,
+			rni.metering_unit ,
 			rni.`output` ,
-			ci.name contractItemName,
 			rn.release_code
 		from
 			receiving_note_item rni
-				join contract_item ci on rni.contract_item_id = ci.id
-				join receiving_note rn on rn.id = rni.note_id
+		join receiving_note rn on rn.id = rni.note_id
 		where
 			rni.del_flag = '0'
-		<if test="queryDTO.contractItemName != null and queryDTO.contractItemName !=''">
-			and c.name like CONCAT('%', #{queryDTO.contractItemName}, '%')
+		<if test="queryDTO.releaseCode != null and queryDTO.releaseCode !=''">
+			and rn.release_code like CONCAT('%', #{queryDTO.releaseCode}, '%')
 		</if>
+		<if test="queryDTO.noteId != null and queryDTO.noteId !=''">
+			and rni.note_id = #{queryDTO.noteId}
+		</if>
+	</select>
+    <select id="selectDeviceNumByContractId" resultType="java.lang.Integer">
+		select
+			ifnull(sum(rni.num),0)
+		from
+			receiving_note_item rni
+		where
+			rni.device_id = #{deviceId}
+		  and exists (
+				select
+					*
+				from
+					receiving_note rn
+				where
+					rn.contract_id = #{contractId}
+				  and rn.id = rni.note_id)
 	</select>
 </mapper>

--
Gitblit v1.9.1