From d0b0e00e40226700a0ffa1f1671a8dc273610f67 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 18 Dec 2023 14:28:10 +0800
Subject: [PATCH] 菜单分类优化

---
 src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
index b08e12d..11fe4a6 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -89,8 +89,31 @@
         </collection>
     </resultMap>
 
+    <resultMap id="householdPageAndLabelMap" type="org.springblade.modules.house.vo.HouseholdVO" autoMapping="true">
+        <id property="id" column="id"/>
+        <collection property="householdLabelList" javaType="java.util.List" select="selectHouseLabelPage"  column="id"
+                    ofType="org.springblade.modules.house.vo.HouseholdLabelVO" autoMapping="true">
+        </collection>
+    </resultMap>
+
+    <select id="selectHouseLabelPage" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
+        select
+        id,
+        house_code,
+        label_id,
+        label_name,
+        color,
+        remark cremark,
+        user_id,
+        lable_type,
+        household_id
+        from
+        jczz_user_house_label
+        where household_id = #{id} and lable_type = 1
+    </select>
+
     <!--自定义分页数据查询-->
-    <select id="selectHouseholdPage" resultType="org.springblade.modules.house.vo.HouseholdVO">
+    <select id="selectHouseholdPage" resultMap="householdPageAndLabelMap">
         select
         jh.*,
         jhs.district_name aoiName,

--
Gitblit v1.9.3