song 5 months ago
parent
commit
80c8d142e6

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

@@ -25,20 +25,23 @@ public class AreaTask extends BaseTask {
25 25
     @Override
26 26
     @Transactional(rollbackFor = Exception.class)
27 27
     public void start() {
28
-        log.info(" *** 楼栋AreaTask转换开始 *** ");
29
-        StringBuffer sql = new StringBuffer("select 0 as version,IF(branch_id=4,3,branch_id) as hos_id,area as building_name,now() as operator_time, ");
30
-        sql.append(" delete_flag as _delete from itsm_uc_area");
31
-        List<Map<String, Object>> areaList = jdbcTemplateMdv2.queryForList(sql.toString());
32
-        FieldMapper mapper = new FieldMapper();
33
-        mapper.trans2JdbcRow(areaList);
34
-
35
-        FieldMapper areaMapper = this.loadCache();
36
-        RowsWrap rw = DataMigrationter.getRowsWrap(mapper,areaMapper);
37
-        JdbcUtil jdbcUtil = new JdbcUtil(jdbcTemplateHsms);
38
-        //科室只做更新 已有的科室不做处理
39
-        jdbcUtil.batchPageInsert("itsm_uc_building", rw.getInsertRows());
28
+        if ("xiangyang".equals(appName)) {
29
+            log.info(" *** 楼栋AreaTask转换开始 *** ");
30
+            StringBuffer sql = new StringBuffer("select 0 as version,IF(branch_id=4,3,branch_id) as hos_id,area as building_name,now() as operator_time, ");
31
+            sql.append(" delete_flag as _delete from itsm_uc_area");
32
+            List<Map<String, Object>> areaList = jdbcTemplateMdv2.queryForList(sql.toString());
33
+            FieldMapper mapper = new FieldMapper();
34
+            mapper.trans2JdbcRow(areaList);
35
+
36
+            FieldMapper areaMapper = this.loadCache();
37
+            RowsWrap rw = DataMigrationter.getRowsWrap(mapper,areaMapper);
38
+            JdbcUtil jdbcUtil = new JdbcUtil(jdbcTemplateHsms);
39
+            //科室只做更新 已有的科室不做处理
40
+            jdbcUtil.batchPageInsert("itsm_uc_building", rw.getInsertRows());
41
+
42
+            mapper.clear();
43
+        }
40 44
 
41
-        mapper.clear();
42 45
     }
43 46
 
44 47
     @Override

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

@@ -29,19 +29,21 @@ public class PlaceTask extends BaseTask {
29 29
     @Override
30 30
     @Transactional(rollbackFor = Exception.class)
31 31
     public void start() {
32
-        log.info(" *** 楼层PlaceTask转换开始 *** ");
33
-        StringBuffer sql = new StringBuffer("select 0 as version,area_id as build_id,SUBSTRING_INDEX(SUBSTRING_INDEX(place,'楼',1),'号',1) as floor_name,IF(branch_id=4,3,branch_id) as hos_id,now() as operator_time, ");
34
-        sql.append(" delete_flag as _delete from itsm_uc_place");
35
-        List<Map<String, Object>> placeList = jdbcTemplateMdv2.queryForList(sql.toString());
36
-        FieldMapper mapper = new FieldMapper();
37
-        mapper.addOperationReplace("build_id", areaTask.loadCache().getIdCache());
38
-        mapper.trans2JdbcRow(placeList);
32
+        if ("xiangyang".equals(appName)) {
33
+            log.info(" *** 楼层PlaceTask转换开始 *** ");
34
+            StringBuffer sql = new StringBuffer("select 0 as version,area_id as build_id,SUBSTRING_INDEX(SUBSTRING_INDEX(place,'楼',1),'号',1) as floor_name,IF(branch_id=4,3,branch_id) as hos_id,now() as operator_time, ");
35
+            sql.append(" delete_flag as _delete from itsm_uc_place");
36
+            List<Map<String, Object>> placeList = jdbcTemplateMdv2.queryForList(sql.toString());
37
+            FieldMapper mapper = new FieldMapper();
38
+            mapper.addOperationReplace("build_id", areaTask.loadCache().getIdCache());
39
+            mapper.trans2JdbcRow(placeList);
39 40
 
40
-        FieldMapper areaMapper = this.loadCache();
41
-        RowsWrap rw = DataMigrationter.getRowsWrap(mapper,areaMapper);
42
-        JdbcUtil jdbcUtil = new JdbcUtil(jdbcTemplateHsms);
43
-        //科室只做更新 已有的科室不做处理
44
-        jdbcUtil.batchPageInsert("itsm_uc_floor", rw.getInsertRows());
41
+            FieldMapper areaMapper = this.loadCache();
42
+            RowsWrap rw = DataMigrationter.getRowsWrap(mapper,areaMapper);
43
+            JdbcUtil jdbcUtil = new JdbcUtil(jdbcTemplateHsms);
44
+            //科室只做更新 已有的科室不做处理
45
+            jdbcUtil.batchPageInsert("itsm_uc_floor", rw.getInsertRows());
46
+        }
45 47
     }
46 48
 
47 49
     @Override