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}