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 5cb91c3..5bad204 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 @@ -11,6 +11,7 @@ import com.cm.common.utils.UUIDUtil; import com.cm.population.dao.house.IHouseDao; import com.cm.population.dao.population.IPopulationDao; import com.cm.population.pojo.bos.house.HouseBO; +import com.cm.population.pojo.bos.population.PopulationBO; import com.cm.population.pojo.dtos.building.BuildingDTO; import com.cm.population.pojo.dtos.house.AutoHouseDTO; import com.cm.population.pojo.dtos.house.BatchHouseDTO; @@ -30,8 +31,10 @@ import org.apache.commons.lang3.StringUtils; import org.apache.pdfbox.contentstream.operator.state.Save; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; @@ -243,6 +246,11 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { public List listByPopulationInfoId(String populationInfoId) { Map params = getHashMap(2); params.put("populationInfoId", populationInfoId); + List populationBOS = populationdao.listBO(params); + if(!CollectionUtils.isEmpty(populationBOS)) { + params.put("cardNum", populationBOS.get(0).getCardNum()); + params.remove("populationInfoId"); + } return list(params); } diff --git a/src/main/resources/mybatis/mapper/house/house-mapper.xml b/src/main/resources/mybatis/mapper/house/house-mapper.xml index d7176e0..ec14e6e 100644 --- a/src/main/resources/mybatis/mapper/house/house-mapper.xml +++ b/src/main/resources/mybatis/mapper/house/house-mapper.xml @@ -847,7 +847,7 @@ #{houseIds[${index}]} - + AND t1.house_id IN ( SELECT @@ -855,7 +855,13 @@ FROM house_population hp WHERE - hp.population_info_id = #{populationInfoId} + 1 = 1 + + AND hp.population_info_id = #{populationInfoId} + + + AND hp.card_num = #{cardNum} + ) ORDER BY (affiliation_unit + 0), (affiliation_floors + 0), (house_num + 0) ASC diff --git a/src/main/resources/mybatis/mapper/population/population-mapper.xml b/src/main/resources/mybatis/mapper/population/population-mapper.xml index ec94ec2..e141a20 100644 --- a/src/main/resources/mybatis/mapper/population/population-mapper.xml +++ b/src/main/resources/mybatis/mapper/population/population-mapper.xml @@ -363,10 +363,12 @@ t1.is_delete = 0 AND ( - t1.id LIKE CONCAT('%', #{keywords}, '%') ) + + AND t1.population_info_id = #{populationInfoId} + AND LEFT(t1.gmt_create, 10) = ]]> #{startTime}