Jelajahi Sumber

导入的时候 查询数据时,名称查询不能模糊匹配,要完全匹配

王苗苗 2 bulan lalu
induk
melakukan
26aba13f5b

+ 3 - 3
slibra-admin/src/main/java/com/slibra/web/controller/listener/MoreDataListener.java

@@ -77,7 +77,7 @@ public class MoreDataListener extends AnalysisEventListener<MoreExcelInfo> {
             //         如果没有添加过,新增泵站,然后再通过小区和楼号查询对应的数据,绑定关系)
             for (MoreExcelInfo bzxqlhInfo : list) {
                 String pumpingStationName = bzxqlhInfo.getPumpingStationName();
-                List<TPumpingStation> pumpingStations = this.tPumpingStationMapper.selectTPumpingStationList(TPumpingStation.builder().name(pumpingStationName).build());
+                List<TPumpingStation> pumpingStations = this.tPumpingStationMapper.selectTPumpingStationList(TPumpingStation.builder().fullName(pumpingStationName).build());
                 Long pumpingStationId = null;
                 if(CollectionUtils.isEmpty(pumpingStations)){
                     log.info("A第一次添加泵站信息,泵站名称是{}", pumpingStationName);
@@ -92,11 +92,11 @@ public class MoreDataListener extends AnalysisEventListener<MoreExcelInfo> {
                 //有了泵站信息,处理其他逻辑
                 //再通过小区和楼号查询对应的数据,绑定关系
                 //2024年12月31日18:28:22 这里不能直接通过楼号去查询,因为楼号很多都是重复的 通过小区查询、,因为小区名字是唯一的。
-                List<TNeighborhood> tNeighborhoods = this.tNeighborhoodMapper.selectTNeighborhoodList(TNeighborhood.builder().name(bzxqlhInfo.getNeighbourName()).build());
+                List<TNeighborhood> tNeighborhoods = this.tNeighborhoodMapper.selectTNeighborhoodList(TNeighborhood.builder().fullName(bzxqlhInfo.getNeighbourName()).build());
                 if(!CollectionUtils.isEmpty(tNeighborhoods)){
                     TNeighborhood tNeighborhood = tNeighborhoods.get(0);
                     //通过小区ID和楼号名称【2者组合是唯一的】
-                    List<TNeighborhoodBuilding> tNeighborhoodBuildings = this.tNeighborhoodBuildingMapper.selectTNeighborhoodBuildingList(TNeighborhoodBuilding.builder().neighborhoodId(tNeighborhood.getId()).name(bzxqlhInfo.getBuildingName()).build());
+                    List<TNeighborhoodBuilding> tNeighborhoodBuildings = this.tNeighborhoodBuildingMapper.selectTNeighborhoodBuildingList(TNeighborhoodBuilding.builder().neighborhoodId(tNeighborhood.getId()).fullName(bzxqlhInfo.getBuildingName()).build());
                     if(!CollectionUtils.isEmpty(tNeighborhoodBuildings)){
                         TNeighborhoodBuilding tNeighborhoodBuilding = tNeighborhoodBuildings.get(0);
                         //泵关联小区楼号对象

+ 2 - 0
slibra-system/src/main/java/com/slibra/business/domain/TNeighborhood.java

@@ -89,6 +89,8 @@ public class TNeighborhood extends BaseEntity
     //请求参数
     private Long pumpingStationId;
 
+    //2025年01月13日13:40:22 新增字段,查询使用:名字,完全匹配,因为Excel导入的时候,不可以模糊匹配
+    private String fullName;
 
 
 

+ 3 - 0
slibra-system/src/main/java/com/slibra/business/domain/TNeighborhoodBuilding.java

@@ -45,4 +45,7 @@ public class TNeighborhoodBuilding extends BaseEntity
     @Excel(name = "乐观锁")
     private Long revision;
 
+    //2025年01月13日13:40:22 新增字段,查询使用:名字,完全匹配,因为Excel导入的时候,不可以模糊匹配
+    private String fullName;
+
 }

+ 3 - 0
slibra-system/src/main/java/com/slibra/business/domain/TPumpingStation.java

@@ -72,4 +72,7 @@ public class TPumpingStation extends BaseEntity
 
     //区县的名字
     private String countryName;
+
+    //2025年01月13日13:40:22 新增字段,查询使用:名字,完全匹配,因为Excel导入的时候,不可以模糊匹配
+    private String fullName;
 }

+ 1 - 0
slibra-system/src/main/resources/mapper/business/TNeighborhoodBuildingMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="revision != null "> and revision = #{revision}</if>
+            <if test="fullName != null  and fullName != ''"> and name = #{fullName}</if>
         </where>
         and del_flag = 0 order by id desc
     </select>

+ 1 - 0
slibra-system/src/main/resources/mapper/business/TNeighborhoodMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="address != null  and address != ''"> and address = #{address}</if>
             <if test="sort != null  and sort != ''"> and sort = #{sort}</if>
             <if test="revision != null "> and revision = #{revision}</if>
+            <if test="fullName != null  and fullName != ''"> and name = #{fullName}</if>
         </where>
         and del_flag = 0 order by id desc
     </select>

+ 1 - 0
slibra-system/src/main/resources/mapper/business/TPumpingStationMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="address != null  and address != ''"> and address = #{address}</if>
             <if test="sort != null  and sort != ''"> and sort = #{sort}</if>
             <if test="revision != null "> and revision = #{revision}</if>
+            <if test="fullName != null  and fullName != ''"> and name = #{fullName}</if>
         </where>
         and del_flag = 0 order by id desc
     </select>