From 1a47d5fe54230e312aa8486aad7fb30ada1f7b2b Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 06 Dec 2023 09:03:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml |   46 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 43 insertions(+), 3 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 cb71fb9..43016bb 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -99,6 +99,9 @@
         <if test="household.name!=null and household.name !=''">
             and jh.name like concat('%',#{household.name},'%')
         </if>
+        <if test="household.houseCode!=null and household.houseCode !=''">
+            and jh.house_code = #{household.houseCode}
+        </if>
         <if test="household.phoneNumber!=null and household.phoneNumber !=''">
             and jh.phone_number like concat('%',#{household.phoneNumber},'%')
         </if>
@@ -114,7 +117,7 @@
     </select>
 
     <!--查询房屋集合信息-->
-    <select id="selectHouseNodeList" resultType="org.springblade.common.node.TreeNode" >
+    <select id="selectHouseNodeList" resultType="org.springblade.common.node.TreeStringNode" >
         select jh.house_code    as id,
                jh.house_code    as houseCode,
                jda.address_name as name,
@@ -153,6 +156,7 @@
     <!--导出数据-->
     <select id="export" resultType="org.springblade.modules.house.excel.HouseHoldExcel">
         select
+        jh.house_code houseCode,
         jh.name,jh.phone_number phoneNumber,jh.role_type roleType,jh.relationship relationship,
         jh.is_primary_contact isPrimaryContact,jh.residential_status residentialStatus,jh.gender,
         jh.birthday,jh.id_card idCard,jh.hkmt_pass hkmtPass,jh.passport,jh.ethnicity,jh.education,
@@ -180,18 +184,54 @@
 
 
     <select id="statistics" resultType="java.lang.Integer">
-
         SELECT
             count(1)
         FROM
             jczz_grid_range jgr
                 LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id
+                LEFT JOIN jczz_gridman jgm on jg.id = jgm.grid_id
                 LEFT JOIN jczz_household jh on jh.house_code=jgr.house_code
         WHERE
             jg.is_deleted = 0
           and jh.confirm_flag = 0
-          AND jg.user_id = #{userId}
+          AND jgm.user_id = #{userId}
+    </select>
 
+    <!--查询物业-->
+    <select id="getProperty" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
+        SELECT
+            jpcd.property_company_id as code,
+            jpcd.principal as name,
+            jpcd.principal_phone as phone
+        FROM
+            jczz_doorplate_address jda
+        LEFT JOIN jczz_district jd ON jd.aoi_code = jda.aoi_code
+        LEFT JOIN jczz_property_company_district jpcd on jpcd.district_id=jd.id
+        WHERE 1=1
+        AND jda.address_code = #{household.houseCode}
+    </select>
+
+    <!--查询网格-->
+    <select id="getGrid" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
+        SELECT
+            jg.id as code,
+            jgm.gridman_name as name,jgm.mobile as phone
+        FROM
+            jczz_grid_range jgr
+        LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id and jg.is_deleted = 0
+        LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id and jgm.is_deleted = 0
+        WHERE 1=1
+        AND jgr.house_code = #{household.houseCode}
+    </select>
+
+    <!--查询公安信息-->
+    <select id="getSecurity" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
+        SELECT
+            address_code as code,policeman as name,policeman_phone as phone
+        FROM
+            jczz_doorplate_address
+        WHERE
+          address_code = #{household.houseCode}
     </select>
 
 

--
Gitblit v1.9.3