|
@@ -449,10 +449,10 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
449
|
449
|
Info.eq("building_id",tpLevel.getBuildingId());
|
450
|
450
|
Info.eq("unit_id", tpLevel.getUnitId());
|
451
|
451
|
Info.eq("level_id", tpLevel.getId());
|
|
452
|
+ Info.eq("level_name", tpLevel.getName());
|
452
|
453
|
tpRoomNoMapper.delete(Info);
|
453
|
454
|
tpLevelMapper.deleteById(id);
|
454
|
455
|
}
|
455
|
|
-
|
456
|
456
|
//删除单元
|
457
|
457
|
if(type.equals("level")){
|
458
|
458
|
TpUnit tpUnit= tpUnitMapper.selectById(id);
|
|
@@ -465,7 +465,6 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
465
|
465
|
//删除单元-楼层-下的房间
|
466
|
466
|
//查询楼层ID
|
467
|
467
|
Integer tpLevelID=null;
|
468
|
|
-
|
469
|
468
|
List<TpLevel> levelevelList = tpLevelMapper.selectList(tpLevel);
|
470
|
469
|
for (TpLevel levelevel:levelevelList) {
|
471
|
470
|
QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
|
@@ -483,7 +482,6 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
483
|
482
|
tpLevelMapper.delete(tpLevel);
|
484
|
483
|
//删除此单元
|
485
|
484
|
tpUnitMapper.deleteById(id);
|
486
|
|
-
|
487
|
485
|
}
|
488
|
486
|
//删除楼栋
|
489
|
487
|
if (type.equals("unit")){
|
|
@@ -493,17 +491,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
493
|
491
|
tpUnit.eq("community_id", tpBuilding.getCommunityId());
|
494
|
492
|
tpUnit.eq("phase_id", tpBuilding.getPhaseId());
|
495
|
493
|
tpUnit.eq("building_id", tpBuilding.getId());
|
496
|
|
-
|
497
|
|
- //删除单元-楼层-下的房间
|
498
|
|
- TpLevel tpLevelToo= tpLevelMapper.selectById(id);
|
499
|
|
- QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
500
|
|
- Info.eq("community_id", tpLevelToo.getCommunityId());
|
501
|
|
- Info.eq("phase_id", tpLevelToo.getPhaseId());
|
502
|
|
- Info.eq("building_id",tpLevelToo.getBuildingId());
|
503
|
|
- Info.eq("unit_id", tpLevelToo.getUnitId());
|
504
|
|
- Info.eq("level_id", tpLevelToo.getId());
|
505
|
|
- //先删除所有房间
|
506
|
|
- tpRoomNoMapper.delete(Info);
|
|
494
|
+ tpUnit.eq("building_name", tpBuilding.getName());
|
507
|
495
|
//先查询楼层
|
508
|
496
|
List<TpUnit> unitList= tpUnitMapper.selectList(tpUnit);
|
509
|
497
|
QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
|
|
@@ -513,6 +501,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
513
|
501
|
tpLevel.eq("community_id", unit.getCommunityId());
|
514
|
502
|
tpLevel.eq("building_id", unit.getBuildingId());
|
515
|
503
|
tpLevel.eq("unit_id", unit.getId());
|
|
504
|
+ tpLevel.eq("unit_name", unit.getName());
|
516
|
505
|
//查询房间
|
517
|
506
|
List<TpLevel> levelList= tpLevelMapper.selectList(tpLevel);
|
518
|
507
|
QueryWrapper<TpRoomNo> tpRoomNoQueryWrapper = new QueryWrapper<>();
|
|
@@ -523,12 +512,12 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
523
|
512
|
tpRoomNoQueryWrapper.eq("building_id", level.getBuildingId());
|
524
|
513
|
tpRoomNoQueryWrapper.eq("unit_id", level.getUnitId());
|
525
|
514
|
tpRoomNoQueryWrapper.eq("level_id", level.getId());
|
|
515
|
+ tpRoomNoQueryWrapper.eq("level_name", level.getName());
|
526
|
516
|
//先删除所有房间
|
527
|
517
|
tpRoomNoMapper.delete(tpRoomNoQueryWrapper);
|
528
|
518
|
}
|
529
|
519
|
}
|
530
|
520
|
}
|
531
|
|
-
|
532
|
521
|
}
|
533
|
522
|
//删除所有楼层
|
534
|
523
|
tpLevelMapper.delete(tpLevel);
|
|
@@ -537,52 +526,57 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
537
|
526
|
//删除栋
|
538
|
527
|
tpBuildingMapper.deleteById(id);
|
539
|
528
|
}
|
540
|
|
-
|
541
|
529
|
if (type.equals("building")){
|
542
|
530
|
TpPhase phase= tpPhaseMapper.selectById(id);
|
543
|
531
|
|
544
|
|
- TpBuilding tpBuilding= tpBuildingMapper.selectById(phase.getId());
|
|
532
|
+ QueryWrapper<TpBuilding> building= new QueryWrapper<>();
|
|
533
|
+ building.eq("phase_id", phase.getId());
|
|
534
|
+ building.eq("community_id", phase.getCommunityId());
|
|
535
|
+ building.eq("name", phase.getName());
|
|
536
|
+ List<TpBuilding> tpBuildingList= tpBuildingMapper.selectList(building);
|
|
537
|
+ for (TpBuilding tpBuilding:tpBuildingList){
|
545
|
538
|
//删除单元-楼层-房间
|
546
|
539
|
QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
|
|
540
|
+ List<TpUnit> unitList=null;
|
547
|
541
|
if (null!=tpBuilding) {
|
548
|
542
|
tpUnit.eq("community_id", tpBuilding.getCommunityId());
|
549
|
543
|
tpUnit.eq("phase_id", tpBuilding.getPhaseId());
|
550
|
544
|
tpUnit.eq("building_id", tpBuilding.getId());
|
|
545
|
+ tpUnit.eq("building_name", tpBuilding.getName());
|
|
546
|
+ unitList= tpUnitMapper.selectList(tpUnit);
|
551
|
547
|
}
|
552
|
548
|
//先查询楼层
|
553
|
|
- List<TpUnit> unitList= tpUnitMapper.selectList(tpUnit);
|
554
|
549
|
QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
|
555
|
550
|
if (null!=unitList) {
|
556
|
|
- for (TpUnit unit:unitList) {
|
|
551
|
+ for (TpUnit unit : unitList) {
|
557
|
552
|
tpLevel.eq("phase_id", unit.getPhaseId());
|
558
|
553
|
tpLevel.eq("community_id", unit.getCommunityId());
|
559
|
554
|
tpLevel.eq("building_id", unit.getBuildingId());
|
560
|
555
|
tpLevel.eq("unit_id", unit.getId());
|
561
|
|
-
|
|
556
|
+ tpLevel.eq("unit_name", unit.getName());
|
562
|
557
|
//查询房间
|
563
|
|
- List<TpLevel> levelList= tpLevelMapper.selectList(tpLevel);
|
564
|
|
- if (null!=levelList) {
|
565
|
|
- for (TpLevel level :levelList) {
|
|
558
|
+ List<TpLevel> levelList = tpLevelMapper.selectList(tpLevel);
|
|
559
|
+ if (null != levelList) {
|
|
560
|
+ for (TpLevel level : levelList) {
|
566
|
561
|
QueryWrapper<TpRoomNo> tpRoomNoQueryWrapper = new QueryWrapper<>();
|
567
|
562
|
tpRoomNoQueryWrapper.eq("phase_id", level.getPhaseId());
|
568
|
563
|
tpRoomNoQueryWrapper.eq("community_id", level.getCommunityId());
|
569
|
564
|
tpRoomNoQueryWrapper.eq("building_id", level.getBuildingId());
|
570
|
565
|
tpRoomNoQueryWrapper.eq("unit_id", level.getUnitId());
|
571
|
566
|
tpRoomNoQueryWrapper.eq("level_id", level.getId());
|
|
567
|
+ tpRoomNoQueryWrapper.eq("level_name", level.getName());
|
572
|
568
|
//先删除所有房间
|
573
|
569
|
tpRoomNoMapper.delete(tpRoomNoQueryWrapper);
|
574
|
570
|
}
|
575
|
|
- }
|
|
571
|
+ }
|
576
|
572
|
//再删除所有楼层
|
577
|
573
|
tpLevelMapper.delete(tpLevel);
|
578
|
|
- }
|
|
574
|
+ }
|
579
|
575
|
}
|
580
|
576
|
//删除此单元
|
581
|
577
|
tpUnitMapper.delete(tpUnit);
|
|
578
|
+ }
|
582
|
579
|
//删除栋
|
583
|
|
- QueryWrapper<TpBuilding> building= new QueryWrapper<>();
|
584
|
|
- tpLevel.eq("phase_id", phase.getId());
|
585
|
|
- tpLevel.eq("community_id", phase.getCommunityId());
|
586
|
580
|
tpBuildingMapper.delete(building);
|
587
|
581
|
//删除整个期
|
588
|
582
|
tpPhaseMapper.deleteById(id);
|