From 017419e79a2634125b888c0fc485084adbd67bc1 Mon Sep 17 00:00:00 2001
From: Renpc-kilig <308442850@qq.com>
Date: Wed, 13 Oct 2021 17:40:01 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=A5=BC=E5=AE=87=E7=AE=A1=E7=90=86bug?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mybatis/mapper/citybuilding/citybuilding-mapper.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml b/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
index 5314142..5089163 100644
--- a/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
+++ b/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
@@ -140,6 +140,7 @@
AND
t1.building_name = #{buildingName}
+ LIMIT 0, 1
From 0cc01615efc784c523d90898276f539a4568d0e0 Mon Sep 17 00:00:00 2001
From: Renpc-kilig <308442850@qq.com>
Date: Wed, 13 Oct 2021 18:12:59 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5bug=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/citybuilding/ICityBuildingService.java | 3 ++-
.../service/citybuilding/impl/CityBuildingServiceImpl.java | 3 ++-
.../java/com/cm/systemcity/utils/ImportExcelHelper.java | 3 ++-
.../mybatis/mapper/citybuilding/citybuilding-mapper.xml | 6 +++++-
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/cm/systemcity/service/citybuilding/ICityBuildingService.java b/src/main/java/com/cm/systemcity/service/citybuilding/ICityBuildingService.java
index a907948..027b2af 100644
--- a/src/main/java/com/cm/systemcity/service/citybuilding/ICityBuildingService.java
+++ b/src/main/java/com/cm/systemcity/service/citybuilding/ICityBuildingService.java
@@ -25,11 +25,12 @@ public interface ICityBuildingService {
/**
* 根据名称获取
+ * @param districtName
* @param buildingName
* @return
* @throws SearchException
*/
- CityBuildingDTO getCityBuildingByName(String buildingName) throws SearchException;
+ CityBuildingDTO getCityBuildingByName(String districtName, String buildingName) throws SearchException;
/**
* 获取小区的楼宇
* @param districtIds
diff --git a/src/main/java/com/cm/systemcity/service/citybuilding/impl/CityBuildingServiceImpl.java b/src/main/java/com/cm/systemcity/service/citybuilding/impl/CityBuildingServiceImpl.java
index 6278ac5..0be0dcf 100644
--- a/src/main/java/com/cm/systemcity/service/citybuilding/impl/CityBuildingServiceImpl.java
+++ b/src/main/java/com/cm/systemcity/service/citybuilding/impl/CityBuildingServiceImpl.java
@@ -383,8 +383,9 @@ public class CityBuildingServiceImpl extends AbstractService implements ICityBui
}
@Override
- public CityBuildingDTO getCityBuildingByName(String buildingName) throws SearchException {
+ public CityBuildingDTO getCityBuildingByName(String districtName, String buildingName) throws SearchException {
Map params = super.getHashMap(1);
+ params.put("districtName", districtName);
params.put("buildingName", buildingName);
return cityBuildingDao.getCityBuilding(params);
}
diff --git a/src/main/java/com/cm/systemcity/utils/ImportExcelHelper.java b/src/main/java/com/cm/systemcity/utils/ImportExcelHelper.java
index 493ad08..5724fb6 100644
--- a/src/main/java/com/cm/systemcity/utils/ImportExcelHelper.java
+++ b/src/main/java/com/cm/systemcity/utils/ImportExcelHelper.java
@@ -120,11 +120,12 @@ public class ImportExcelHelper {
}
Map param = new HashMap<>();
param.put("districtName", buildingHouseModel.getDistrictName());
+ param.put("buildingName", buildingHouseModel.getCityBuildingName());
CityDistrictDTO cityDistrictDTO = cityDistrictService.getCityDistrictByName(buildingHouseModel.getDistrictName());
if(null != cityDistrictDTO) {
buildingHouseModel.setDistrictId(cityDistrictDTO.getCityDistrictId());
}
- CityBuildingDTO cityBuildingDTO = cityBuildingService.getCityBuildingByName(buildingHouseModel.getCityBuildingName());
+ CityBuildingDTO cityBuildingDTO = cityBuildingService.getCityBuildingByName(buildingHouseModel.getDistrictName(), buildingHouseModel.getCityBuildingName());
if(null != cityBuildingDTO) {
buildingHouseModel.setCityBuildingId(cityBuildingDTO.getCityBuildingId());
}
diff --git a/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml b/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
index 5089163..8e20d99 100644
--- a/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
+++ b/src/main/resources/mybatis/mapper/citybuilding/citybuilding-mapper.xml
@@ -137,11 +137,15 @@
AND
t1.city_building_id = #{cityBuildingId}
+
+ AND
+ t1.district_name = #{districtName}
+
AND
t1.building_name = #{buildingName}
- LIMIT 0, 1
+ LIMIT 0, 1