diff --git a/src/main/java/com/cm/population/dao/population/IPopulationDao.java b/src/main/java/com/cm/population/dao/population/IPopulationDao.java index 0401673..789db99 100644 --- a/src/main/java/com/cm/population/dao/population/IPopulationDao.java +++ b/src/main/java/com/cm/population/dao/population/IPopulationDao.java @@ -120,9 +120,9 @@ public interface IPopulationDao { /** * 通过房屋ID删除人员信息 * - * @param populationId + * @param houseId * @throws UpdateException */ - void deleteById(String populationId) throws RemoveException; + void deleteByHouseId(String houseId) throws RemoveException; } \ No newline at end of file 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 4c29a13..382cac0 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 @@ -152,7 +152,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { } } - populationdao.deleteById(houseId); + populationdao.deleteByHouseId(houseId); for (PopulationVO populationVO : populationVOList) { if(!"1".equals(populationVO.getOutHouse())) { populationService.save(token, populationVO); diff --git a/src/main/resources/mybatis/mapper/population/population-mapper.xml b/src/main/resources/mybatis/mapper/population/population-mapper.xml index 4f88d2a..582bd78 100644 --- a/src/main/resources/mybatis/mapper/population/population-mapper.xml +++ b/src/main/resources/mybatis/mapper/population/population-mapper.xml @@ -110,11 +110,11 @@ - + DELETE FROM house_population WHERE - population_id = #{population_id} + house_id = #{houseId} AND out_house != 1