song 5 months ago
parent
commit
ee8e86a5b1

+ 3 - 3
src/main/java/com/dashitech/migration/task/uc/AreaTask.java

@@ -46,12 +46,12 @@ public class AreaTask extends BaseTask {
46 46
         log.info(" *** 加载楼栋area缓存 *** ");
47 47
         StringBuffer sql = new StringBuffer("select id,hos_id,building_name from itsm_uc_building ");
48 48
         List<Map<String, Object>> buildingList = jdbcTemplateHsms.queryForList(sql.toString());
49
-        sql = new StringBuffer("select id,IF(branch_id=4,3,branch_id) as branch_id,area from itsm_uc_area ");
49
+        sql = new StringBuffer("select id,IF(branch_id=4,3,branch_id) as hos_id,area as building_name  from itsm_uc_area ");
50 50
         List<Map<String, Object>> areaList = jdbcTemplateMdv2.queryForList(sql.toString());
51 51
 
52 52
         FieldMapper mapper = new FieldMapper();
53
-        mapper.addFieldMapper("building_name", "area");
54
-        mapper.addFieldMapper("hos_id", "branch_id");
53
+        mapper.addFieldMapper("building_name", "building_name");
54
+        mapper.addFieldMapper("hos_id", "hos_id");
55 55
 
56 56
         DataMigrationter.loadCache(buildingList, areaList, mapper);
57 57
 

+ 4 - 4
src/main/java/com/dashitech/migration/task/uc/PlaceTask.java

@@ -49,13 +49,13 @@ public class PlaceTask extends BaseTask {
49 49
         log.info(" *** 加载楼层place缓存 *** ");
50 50
         StringBuffer sql = new StringBuffer("select id,hos_id,build_id,floor_name from itsm_uc_floor ");
51 51
         List<Map<String, Object>> floorList = jdbcTemplateHsms.queryForList(sql.toString());
52
-        sql = new StringBuffer("select id,IF(branch_id=4,3,branch_id) as branch_id,area_id,SUBSTRING_INDEX(SUBSTRING_INDEX(place,'楼',1),'号',1) as place from itsm_uc_place ");
52
+        sql = new StringBuffer("select id,IF(branch_id=4,3,branch_id) as hos_id,area_id as build_id,SUBSTRING_INDEX(SUBSTRING_INDEX(place,'楼',1),'号',1) as floor_name from itsm_uc_place ");
53 53
         List<Map<String, Object>> placeList = jdbcTemplateMdv2.queryForList(sql.toString());
54 54
 
55 55
         FieldMapper mapper = new FieldMapper();
56
-        mapper.addFieldMapper("floor_name", "place");
57
-        mapper.addFieldMapper("build_id", "area_id");
58
-        mapper.addFieldMapper("hos_id", "branch_id");
56
+        mapper.addFieldMapper("floor_name", "floor_name");
57
+        mapper.addFieldMapper("build_id", "build_id");
58
+        mapper.addFieldMapper("hos_id", "hos_id");
59 59
 
60 60
         DataMigrationter.loadCache(floorList, placeList, mapper);
61 61