From ebede85283906f52dd45d0755d22140538038ac3 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 27 十二月 2024 13:27:47 +0800
Subject: [PATCH] 完成6.6供应商模块

---
 cnas-server/src/main/resources/mapper/DataConfigMapper.xml |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/cnas-server/src/main/resources/mapper/DataConfigMapper.xml b/cnas-server/src/main/resources/mapper/DataConfigMapper.xml
index 135e544..cb73e83 100644
--- a/cnas-server/src/main/resources/mapper/DataConfigMapper.xml
+++ b/cnas-server/src/main/resources/mapper/DataConfigMapper.xml
@@ -12,4 +12,36 @@
         <result column="y" property="y" />
     </resultMap>
 
+    <select id="selectDataConfigList" resultType="com.yuanchu.mom.dto.DeviceConfigDtoPage">
+        SELECT d.device_name,
+               d.file_type,
+               d.collect_url,
+               d.storage_url,
+               d.ip,
+               d.entrust_code,
+               d.sample_code,
+               d.db_file_name,
+               ip.inspection_item,
+               if(ip.inspection_item_subclass is not null and ip.inspection_item_subclass != '',
+                  ip.inspection_item_subclass, ip.inspection_item)                            inspection_item_subclass,
+               TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(ip.sample, '[["', ''), '"]]', 1)) sample,
+               ddc.formula,
+               ddc.referx,
+               ddc.refery,
+               ddc.x,
+               ddc.y,
+               ddc.id,
+               ip.id                                                                          structureItemParameterId
+        FROM device d
+                 left join structure_item_parameter ip on FIND_IN_SET(ip.id, d.ins_product_ids)
+                 left join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id
+        where d.id = #{deviceId}
+    </select>
+
+    <select id="deleteDataConfig" resultType="integer">
+        SELECT ddc.id
+        FROM device d
+                 left join structure_item_parameter ip on not FIND_IN_SET(ip.id, d.ins_product_ids)
+                 inner join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id
+    </select>
 </mapper>

--
Gitblit v1.9.3