From ecb9ece90cb766214e682f33d4c670b2d09b8ca3 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期三, 13 十二月 2023 18:03:56 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml |   78 ++++++++++++++++++++++++++++-----------
 1 files changed, 56 insertions(+), 22 deletions(-)

diff --git a/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml b/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
index 50b7939..1819532 100644
--- a/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
@@ -17,38 +17,72 @@
         </if>
     </select>
     <select id="itemList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
-        SELECT p.secret_class,
-               SUBSTRING(m.name, LOCATE('杞欢', m.name) , LENGTH(m.name)) AS itemName,
-               m.identify AS version,
-               m.name AS Item_identify
-        FROM software_test_order s
-                 JOIN software_test_order_measured m ON s.project_id = ${projectId}
+        SET @row_number = 0;
+        SELECT (@row_number := @row_number + 1)                        AS no,
+               p.secret_class,
+               SUBSTRING(t.name, LOCATE('杞欢', t.name), LENGTH(t.name)) AS itemName,
+               t.identify                                              AS version,
+               t.name                                                  AS Item_identify
+        FROM item_circulat_order_technical t
+                 JOIN item_circulat_order i ON i.project_id = ${projectId}
                  JOIN project p ON p.id = ${projectId}
-        WHERE s.is_delete = 0
-          AND  s.id = m.order_id
+        WHERE t.is_delete = 0
+          AND i.id = t.circulat_order_id
         UNION
-        SELECT NULL AS secretClass,
-               '杞欢娴嬭瘯濮旀墭鍗�' AS itemName,
-               NULL AS version,
-               s.code AS itemIdentify
+        SELECT (@row_number := @row_number + 1) AS no,
+               NULL                             AS secretClass,
+               '杞欢娴嬭瘯濮旀墭鍗�'                        AS itemName,
+               NULL                             AS version,
+               s.code                           AS itemIdentify
         FROM software_test_order s
         WHERE s.is_delete = 0
-          AND  s.project_id = ${projectId}
+          AND s.project_id = ${projectId}
         UNION
-        SELECT NULL AS secretClass,
-               '鐗╁搧娴佽浆鍗�' AS itemName,
-               NULL AS version,
-               i.code AS itemIdentify
+        SELECT (@row_number := @row_number + 1) AS no,
+               NULL                             AS secretClass,
+               '鐗╁搧娴佽浆鍗�'                          AS itemName,
+               NULL                             AS version,
+               i.code                           AS itemIdentify
         FROM item_circulat_order i
         WHERE i.is_delete = 0
-          AND  i.project_id = ${projectId}
+          AND i.project_id = ${projectId}
     </select>
-    <select id="warehouseList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
-        select a.*
+    <select id="changeSelectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
+        SET @row_number = 0;
+        SELECT (@row_number := @row_number + 1) AS no,
+        a.item_name,a.item_identify,a.version as retrospect_version,a.secret_class,a.project_id,a.id as change_select_id
         from config_item_warehouse_detail a
-                 JOIN config_item_warehouse w ON w.project_id = ${projectId}
         WHERE a.is_delete = 0
-          AND  w.id = a.warehouse_id
+        and a.project_id = ${projectId}
+        and a.outbound_select_id IS NOT NULL
+        <if test="ids!=null and ids!=''">
+            AND id not in (${ids})
+        </if>
+        and a.id NOT IN (SELECT change_select_id FROM config_item_warehouse_detail
+        WHERE
+        ( SELECT count(*) FROM config_item_warehouse_detail WHERE id IN (SELECT
+        change_select_id
+        FROM
+        config_item_warehouse_detail) ) > 0)
     </select>
+    <select id="outboundSelectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
+        SET @row_number = 0;
+        SELECT (@row_number := @row_number + 1) AS no,
+        a.item_name,a.item_identify,a.version,a.secret_class,a.project_id,a.id as outbound_select_id
+        from config_item_warehouse_detail a
+        WHERE a.is_delete = 0
+        and a.project_id = ${projectId}
+        and a.change_select_id IS NOT NULL
+        <if test="ids!=null and ids!=''">
+            AND id not in (${ids})
+        </if>
+        and a.id NOT IN (SELECT outbound_select_id FROM config_item_warehouse_detail
+        WHERE
+        ( SELECT count(*) FROM config_item_warehouse_detail WHERE id IN (SELECT
+        outbound_select_id
+        FROM
+        config_item_warehouse_detail) ) > 0)
+    </select>
+
 
 </mapper>

--
Gitblit v1.9.1