From 438b6be5ea9ed484b50a45a0f210b80180473491 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期二, 11 二月 2025 11:51:45 +0800
Subject: [PATCH] dnc与mdc部门进行整合 使用Mdc部门进行处理  修改所属部门为所属车间  修改yml文件数据库地址

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml |   46 +++++++++++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml
index d281d41..3d25f8a 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml
@@ -1,24 +1,32 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="org.jeecg.modules.dnc.mapper.DocRelativeMapper">
-    <select id="findDeviceByDocId" resultType="org.jeecg.modules.dnc.entity.DeviceInfo" parameterType="String">
-         select d.device_id
-          , d.group_id
-          , d.device_no
-          , d.device_name
-          , d.control_system
-          , d.device_model
-          , d.link_ip
-          , d.link_port
-          , d.depart_id
-          , g.group_name
-          , s.depart_name
-          from nc_device_info d
-          inner join (select distinct attribution_id from nc_doc_relative where doc_id=#{docId} and delete_flag=0 and attribution_type=4) dp
-          on d.device_id=dp.attribution_id
-          inner join nc_device_group g
-          on d.group_id=g.group_id
-          inner join sys_department s
-          on d.depart_id=s.depart_id
+    <select id="findDeviceByDocId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment" parameterType="String">
+     SELECT
+      d.id,
+      d.equipment_id,
+      d.equipment_name,
+      d.control_system,
+      d.equipment_model,
+      d.equipment_type,
+      d.equipment_ip,
+      d.data_port,
+      p.production_name
+     FROM
+      mdc_equipment d
+       JOIN mdc_production_equipment g ON d.id = g.equipment_id
+       JOIN mdc_production p ON p.id = g.production_id
+     WHERE
+      EXISTS (
+       SELECT
+        1
+       FROM
+        nc_doc_relative nr
+       WHERE
+        nr.doc_id = #{docId}
+         AND nr.delete_flag = 0
+         AND nr.attribution_type = 4
+         AND nr.attribution_id = d.id
+      );
     </select>
 </mapper>

--
Gitblit v1.9.3