From 06c5736e13f1a5e53041153759dca8476a381f8f Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 14 Dec 2023 17:56:41 +0800
Subject: [PATCH] 管理后台优化

---
 src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml |   55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml b/src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml
index 9098df6..cfed231 100644
--- a/src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml
+++ b/src/main/java/org/springblade/modules/grid/mapper/GridMapper.xml
@@ -87,19 +87,48 @@
 
     <!--网格树-->
     <select id="getGridTree" resultType="org.springblade.common.node.TreeStringNode">
-        SELECT
-        code as id,
-        parent_code as parentId,
-        name
-        FROM blade_region where district_code = '361102'
+        SELECT code        as id,
+               parent_code as parentId,
+               name
+        FROM blade_region
+        where district_code = '361102'
         union all
-        (
-        select
-        id,
-        community_code as parentId,
-        grid_name as name
-        from jczz_grid
-        where is_deleted = 0
-        )
+        (select id,
+                community_code as parentId,
+                grid_name      as name
+         from jczz_grid
+         where is_deleted = 0)
     </select>
+    <select id="gridInfo" resultType="org.springblade.modules.grid.entity.GridmanEntity">
+        SELECT jg.id,
+               jg.grid_name,
+               jgm.pic_url,
+               jgm.mobile,
+               jgm.gridman_name
+        FROM jczz_grid jg
+                 LEFT JOIN jczz_gridman jgm ON jgm.grid_id = jg.id
+                 LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+        WHERE jgr.house_code = #{houseCode}
+          AND jg.is_deleted = '0'
+          AND jgm.is_deleted = '0'
+    </select>
+
+
+    <select id="gridAoiName"
+            resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity">
+        SELECT aoi_name,
+               GROUP_CONCAT(building_name) building_name
+        FROM (SELECT DISTINCT aoi_name,
+                              building_name
+              FROM jczz_doorplate_address
+              WHERE address_code IN (SELECT jgr.house_code
+                                     FROM jczz_grid jg
+                                              LEFT JOIN jczz_gridman jgm ON jgm.grid_id = jg.id
+                                              LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+                                     WHERE jg.id = #{id})) a
+        GROUP BY aoi_name
+
+    </select>
+
+
 </mapper>

--
Gitblit v1.9.3