From 7a0c5479c363a10f573aa15a54dc8130eabd47ff Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 29 一月 2024 11:47:53 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml |   95 +++++++++++++++++++++++++++++------------------
 1 files changed, 59 insertions(+), 36 deletions(-)

diff --git a/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml b/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
index 8fd3706..a545f79 100644
--- a/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/configItemWarehouse/WarehouseConfigItemDao.xml
@@ -12,45 +12,68 @@
                 and warehouse_id = ${warehouseId}
             </if>
         </where>
-        <if test="orderBySql!=null">
-            ORDER BY ${orderBySql}
-        </if>
+        ORDER BY `no`
     </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}
-                 JOIN project p ON p.id = ${projectId}
-        WHERE s.is_delete = 0
-          AND s.id = m.order_id
-        UNION
-        SELECT 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}
-        UNION
-        SELECT 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}
-    </select>
-    <select id="warehouseList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem">
-        select a.item_name,a.item_identify,a.version as retrospect_version,a.secret_class,a.project_id,a.id as select_id
-        from config_item_warehouse_detail a
-        WHERE a.is_delete = 0
-          and a.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,
+        t.id as src_id
+        FROM item_circulat_order_technical t
+        JOIN item_circulat_order i ON i.project_id = ${projectId}
+        JOIN project p ON p.id = ${projectId}
+        WHERE t.is_delete = 0
+        AND i.id = t.circulat_order_id
         <if test="ids!=null and ids!=''">
-            AND id not in  (${ids})
+            AND t.id not in (${ids})
+        </if>
+        UNION
+        SELECT (@row_number := @row_number + 1) AS no,
+        p.secret_class,
+        '杞欢娴嬭瘯濮旀墭鍗�' AS itemName,
+        NULL AS version,
+        s.code AS itemIdentify,
+        s.id as src_id
+        FROM software_test_order s
+        JOIN project p ON p.id = ${projectId}
+        WHERE s.is_delete = 0
+        AND s.project_id = ${projectId}
+        <if test="ids!=null and ids!=''">
+            AND s.id not in (${ids})
+        </if>
+        UNION
+        SELECT (@row_number := @row_number + 1) AS no,
+        p.secret_class,
+        '鐗╁搧娴佽浆鍗�' AS itemName,
+        NULL AS version,
+        i.code AS itemIdentify,
+        i.id as src_id
+        FROM item_circulat_order i
+        JOIN project p ON p.id = ${projectId}
+        WHERE i.is_delete = 0
+        AND i.project_id = ${projectId}
+        <if test="ids!=null and ids!=''">
+            AND i.id not in (${ids})
         </if>
     </select>
-
+    <select id="selectList" 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
+        select_id,a.library_type
+        from config_item_warehouse_detail a
+        WHERE a.is_delete = 0
+        and a.project_id = ${projectId}
+        and a.select_id is NULL
+        <if test="ids!=null and ids!=''">
+            AND id not in (${ids})
+            and a.id NOT IN (select select_id from config_item_warehouse_detail where select_id is not null)
+        </if>
+        <if test="type!=null and type!=''">
+            and a.library_type=${type}
+        </if>
+    </select>
 </mapper>

--
Gitblit v1.9.1