From 5a6af9762dfb9e3ed75422303a795b2bb8c21885 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 28 九月 2022 17:49:52 +0800
Subject: [PATCH] 市平台接口

---
 ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml b/ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml
index d21673b..ba16227 100644
--- a/ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml
@@ -53,19 +53,24 @@
         d2.`name` AS typeFirst,
         d3.`name` AS typeSecond,
         d4.`name` AS typeThird
-        FROM
-        `ums_data_dictionary` AS d1
-        JOIN ums_data_dictionary AS d2 ON d1.parent_id = d2.id
-        JOIN ums_data_dictionary AS d3 ON d2.parent_id = d3.id
-        JOIN ums_data_dictionary AS d4 ON d3.parent_id = d4.id
+        FROM `ums_data_dictionary` AS d1
+        LEFT JOIN ums_data_dictionary AS d2 ON d1.id = d2.parent_id
+        LEFT JOIN ums_data_dictionary AS d3 ON d2.id = d3.parent_id
+        LEFT JOIN ums_data_dictionary AS d4 ON d3.id = d4.parent_id
         <where>
-            d1.`level` = '4'
+            d1.parent_id = 0
             AND d1.type_code = '01'
             <if test="keyWord !=null and keyWord !=''">
-                AND d1.`name` LIKE  '%${keyWord}%'
+                AND (d1.`name` LIKE  '%${keyWord}%'
+                or d2.`name` LIKE  '%${keyWord}%'
+                or d3.`name` LIKE  '%${keyWord}%'
+                or d4.`name` LIKE  '%${keyWord}%'
+                )
             </if>
 
         </where>
+
+        ORDER BY d1.parent_id,d2.parent_id,d3.parent_id,d4.parent_id
     </select>
 
 </mapper>

--
Gitblit v1.8.0