From a7ad8c17aa069e723aa0a813cf198d07e67b5fb5 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 14 三月 2025 14:19:08 +0800
Subject: [PATCH] 新增刀具、设备类信息管理,新增结构树优化,优化权限分配,新增双控设备结构书 修改flow模块 删除部分废弃yml配置

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

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/PermissionStreamNewMapper.xml b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/PermissionStreamNewMapper.xml
index 45a8357..de844de 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/PermissionStreamNewMapper.xml
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/PermissionStreamNewMapper.xml
@@ -2,15 +2,45 @@
 <!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.PermissionStreamNewMapper">
     <select id="loadProductMix" resultType="org.jeecg.modules.dnc.entity.ProductMix">
-        SELECT
-            mix.*
+        SELECT DISTINCT
+            mix.id,
+            mix.tree_code 'code',
+                mix.name,
+            mix.parent_id,
+            mix.tree_type AS 'type',
+                mix.extend
         FROM
-            nc_product_mix mix
-                LEFT JOIN nc_permission_stream_new nps ON mix.id = nps.business_id
-                AND nps.user_id = #{userId}
-                AND nps.delete_flag = '0'
+            nc_product_mix mix -- 杩炴帴鏉冮檺琛紝绛涢�夐儴闂ㄧ浉鍏宠褰�
+                LEFT JOIN nc_permission_stream_new nps_depart ON mix.id = nps_depart.business_id
+                AND nps_depart.delete_flag = '0'
+                        <if test="productIdList != null and productIdList.size() > 0">
+                            AND nps_depart.depart_id IN
+                            <foreach collection="productIdList" item="productId" index="index" open="(" close=")" separator=",">
+                                #{productId}
+                            </foreach>
+                        </if>
+                AND nps_depart.user_id IS NULL -- 杩炴帴鏉冮檺琛紝绛涢�夌敤鎴风浉鍏宠褰�
+                LEFT JOIN nc_permission_stream_new nps_user ON mix.id = nps_user.business_id
+                AND nps_user.user_id = #{userId}
+                AND nps_user.delete_flag = '0'
         WHERE
-            nps.business_id IS NOT NULL
-           OR nps.business_id IS NULL
+            nps_depart.business_id IS NOT NULL
+          AND nps_user.business_id IS NOT NULL;
+    </select>
+    <select id="loadProductMixAll" resultType="org.jeecg.modules.dnc.entity.ProductMix">
+        SELECT DISTINCT
+        mix.id,
+        mix.tree_code 'code',
+        mix.name,
+        mix.parent_id,
+        mix.tree_type AS 'type',
+        mix.extend
+        FROM
+        nc_product_mix mix -- 杩炴帴鏉冮檺琛紝绛涢�夐儴闂ㄧ浉鍏宠褰�
+        LEFT JOIN nc_permission_stream_new nps_user ON mix.id = nps_user.business_id
+        AND nps_user.user_id = #{userId}
+        AND nps_user.delete_flag = '0'
+        WHERE
+         nps_user.business_id IS NOT NULL;
     </select>
 </mapper>

--
Gitblit v1.9.3