tjf пре 4 месеци
родитељ
комит
03be3391dd

+ 1 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ResidentInfoServiceImpl.java

@@ -2,10 +2,9 @@ package com.ruoyi.system.service.impl;
 
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.ResidentInfo;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.core.domain.entity.ResidentInfo;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.mapper.ResidentInfoMapper;
 import com.ruoyi.system.mapper.SysRoleMapper;
@@ -56,7 +55,6 @@ public class ResidentInfoServiceImpl implements IResidentInfoService
     @Override
     public List<ResidentInfo> selectResidentInfoList(ResidentInfo residentInfo)
     {
-        //todo 计算每个人的年龄
         return residentInfoMapper.selectResidentInfoList(residentInfo);
     }
 

+ 38 - 4
ruoyi-system/src/main/resources/mapper/system/HouseInfoMapper.xml

@@ -30,6 +30,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <collection property="residentInfoList" javaType="java.util.List" resultMap="ResidentInfoResult"  />
     </resultMap>
 
+    <resultMap type="HouseInfo" id="HouseInfoResultResident">
+        <result property="houseId"    column="h_house_id"    />
+        <result property="ownerName"    column="owner_name"    />
+        <result property="location"    column="location"    />
+        <result property="rightType"    column="right_type"    />
+        <result property="area"    column="area"    />
+        <result property="documentNumber"    column="document_number"    />
+        <result property="propertyUnitNumber"    column="property_unit_number"    />
+        <result property="coOwnership"    column="co_ownership"    />
+        <result property="usageType"    column="usage_type"    />
+        <result property="usagePeriod"    column="usage_period"    />
+        <result property="registrationDate"    column="registration_date"    />
+        <result property="coOwner"    column="co_owner"    />
+        <result property="detailedAddress"    column="h_detailed_address"    />
+        <result property="hasParkingSpace"    column="has_parking_space"    />
+        <result property="parkingNumber"    column="parking_number"    />
+        <result property="communityName"    column="community_name"    />
+        <result property="houseStatus"    column="house_status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <collection property="residentInfoList" javaType="java.util.List" resultMap="ResidentInfoResult"  />
+    </resultMap>
+
     <resultMap type="ResidentInfo" id="ResidentInfoResult">
         <result property="residentId"    column="resident_id"    />
         <result property="houseId"    column="house_id"    />
@@ -58,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark"    column="remark"    />
     </resultMap>
     <sql id="selectHouseInfoVo">
-        select house_id, owner_name, location, right_type, area, parking_number,document_number, property_unit_number, co_ownership, usage_type, usage_period, registration_date, co_owner, detailed_address, has_parking_space, community_name, house_status, create_by, create_time, update_by, update_time, remark from house_info
+        select house_id , owner_name, location, right_type, area, parking_number,document_number, property_unit_number, co_ownership, usage_type, usage_period, registration_date, co_owner, detailed_address, has_parking_space, community_name, house_status, create_by, create_time, update_by, update_time, remark from house_info
     </sql>
 
     <select id="selectHouseInfoList" parameterType="HouseInfo" resultMap="HouseInfoResult">
@@ -87,11 +113,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectHouseInfoVo"/>
         where house_id = #{houseId}
     </select>
-    <select id="selectHouseInfoListAndResidentInfo" parameterType="ResidentInfo" resultMap="HouseInfoResult">
+    <select id="selectHouseInfoListAndResidentInfo" parameterType="ResidentInfo" resultMap="HouseInfoResultResident">
         SELECT
-            h.house_id,
-            h.detailed_address,
+            h.house_id AS h_house_id,
+            h.detailed_address AS h_detailed_address,
             h.house_status,
+            h.location,
+            h.owner_name,
+            h.area,
+            h.has_parking_space,
+            h.community_name,
             r.resident_id,
             r.resident_name,
             r.resident_id_card,
@@ -108,7 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="residentName != null  and residentName != ''"> and r.resident_name like concat('%', #{residentName}, '%')</if>
             <if test="residentAppearance != null  and residentAppearance != ''"> and r.resident_appearance = #{residentAppearance}</if>
             <if test="residentAppearance != null  and residentAppearance != ''"> and r.user_id = #{userId}</if>
+            <if test="houseId != null"> and h.house_id = #{houseId}</if>
+            <if test="houseId != null"> and r.resident_phone = #{residentPhone}</if>
         </where>
+        order by h.create_time DESC
     </select>
 
     <insert id="insertHouseInfo" parameterType="HouseInfo" useGeneratedKeys="true" keyProperty="houseId">