From 5bb0a66e75606dd990fe1ab4d130af3c29710a6f Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 17 Nov 2023 15:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cm/population/pojo/dtos/house/BatchHouseDTO.java | 10 ++++++++++ .../service/house/impl/HouseServiceImpl.java | 3 +++ .../mybatis/mapper/population/population-mapper.xml | 1 + 3 files changed, 14 insertions(+) diff --git a/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java index d9984b0..d6e6cfb 100644 --- a/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java @@ -104,6 +104,8 @@ public class BatchHouseDTO { private String gmtCreate; @ApiModelProperty(name = "isCreator", value = "是否时创建人") private Integer isCreator; + @ApiModelProperty(name = "populationCount", value = "房内人数") + private Integer populationCount; public String getHouseId() { return houseId; @@ -136,6 +138,14 @@ public class BatchHouseDTO { public void setIsCreator(Integer isCreator) { this.isCreator = isCreator; } + + public Integer getPopulationCount() { + return populationCount; + } + + public void setPopulationCount(Integer populationCount) { + this.populationCount = populationCount; + } } } diff --git a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java index 363d31d..65d9133 100644 --- a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java +++ b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java @@ -295,6 +295,9 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { if (i == houseDTO.getAffiliationFloors()) { if (null != houseDTO.getAffiliatedUnit()) { if (j == houseDTO.getAffiliationUnit()) { + // 获取当前房屋内的人数 + Integer count = populationService.count(params); + house.setPopulationCount(count); house.setIsCreator(0); house.setHouseId(houseDTO.getHouseId()); house.setName(houseDTO.getHouseNum().toString()); diff --git a/src/main/resources/mybatis/mapper/population/population-mapper.xml b/src/main/resources/mybatis/mapper/population/population-mapper.xml index cd05caf..5f3fee4 100644 --- a/src/main/resources/mybatis/mapper/population/population-mapper.xml +++ b/src/main/resources/mybatis/mapper/population/population-mapper.xml @@ -377,6 +377,7 @@ house_population t1 WHERE t1.is_delete = 0 + AND (t1.out_house != 1 OR t1.out_house IS NOT NULL) AND t1.house_id = #{houseId}