Parcourir la source

删除多余DataSource

欧阳劲驰 il y a 1 mois
Parent
commit
26e325f0c5

Fichier diff supprimé car celui-ci est trop grand
+ 1344 - 1372
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimTapWaterBizFun.java


Fichier diff supprimé car celui-ci est trop grand
+ 445 - 433
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimWaterCollecationBizFun.java


+ 0 - 81
src/main/java/com/shkpr/service/aimodelpower/configuration/OrcaleDataSourceConfig.java

@@ -1,81 +0,0 @@
-package com.shkpr.service.aimodelpower.configuration;
-
-import com.zaxxer.hikari.HikariConfig;
-import com.zaxxer.hikari.HikariDataSource;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-import javax.sql.DataSource;
-
-/**
- * @ClassName OrcaleDataSourceConfig
- * @Description: TODO
- * @Author LX
- * @Date 2024/5/21
- * @Version V1.0
- **/
-@Configuration
-public class OrcaleDataSourceConfig {
-    @Bean(name = "primaryDataSource")
-    public DataSource primaryDataSource(@Value("${spring.datasource.primary.url}") String url,
-                                        @Value("${spring.datasource.primary.username}") String username,
-                                        @Value("${spring.datasource.primary.password}") String password,
-                                        @Value("${spring.datasource.primary.driver-class-name}") String driverClassName) {
-        HikariConfig config = new HikariConfig();
-        config.setJdbcUrl(url);
-        config.setUsername(username);
-        config.setPassword(password);
-        config.setDriverClassName(driverClassName);
-
-        // Oracle专用优化参数
-        config.setConnectionTestQuery("SELECT 1 FROM DUAL");  // Oracle心跳检测SQL
-        config.setConnectionTimeout(30000);  // 连接获取超时时间(毫秒)
-        config.setValidationTimeout(5000);   // 连接验证超时时间(毫秒)
-
-        // 连接池大小设置(根据Oracle服务器性能调整)
-        config.setMaximumPoolSize(20);       // 最大连接数(默认10)
-        config.setMinimumIdle(5);            // 最小空闲连接数
-
-        // 连接生命周期控制
-        config.setIdleTimeout(600000);       // 空闲连接超时(10分钟)
-        config.setMaxLifetime(1800000);      // 连接最大存活时间(30分钟)
-
-        // Oracle推荐关闭自动提交(根据业务需求)
-//        config.setAutoCommit(false);         // 建议手动控制事务
-
-        // 连接泄露检测(生产环境建议开启)
-        config.setLeakDetectionThreshold(60000); // 60秒未关闭则报泄露
-
-        // 初始化失败超时(避免无限等待)
-        config.setInitializationFailTimeout(60000); // 60秒超时
-        return new HikariDataSource(config);
-    }
-
-//    @Bean(name = "secondaryDataSource")
-//    public DataSource secondaryDataSource(@Value("${spring.datasource.secondary.url}") String url,
-//                                          @Value("${spring.datasource.secondary.username}") String username,
-//                                          @Value("${spring.datasource.secondary.password}") String password,
-//                                          @Value("${spring.datasource.secondary.driver-class-name}") String driverClassName) {
-//        HikariConfig config = new HikariConfig();
-//        config.setJdbcUrl(url);
-//        config.setUsername(username);
-//        config.setPassword(password);
-//        config.setDriverClassName(driverClassName);
-//        return new HikariDataSource(config);
-//    }
-
-    @Bean(name = "oneTemplate")
-    public JdbcTemplate primaryJdbcTemplate(@Qualifier("primaryDataSource") DataSource dataSource) {
-        return new JdbcTemplate(dataSource);
-    }
-
-//    @Bean(name = "twoTemplate")
-//    public JdbcTemplate secondaryJdbcTemplate(@Qualifier("secondaryDataSource") DataSource dataSource) {
-//        return new JdbcTemplate(dataSource);
-//    }
-
-}

+ 0 - 32
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/TestDao.java

@@ -1,32 +0,0 @@
-package com.shkpr.service.aimodelpower.dbdao.shizilaishuiDataSource;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @ClassName TestDao
- * @Description: TODO
- * @Author LX
- * @Date 2024/5/21
- * @Version V1.0
- **/
-@Slf4j
-@Repository
-public class TestDao {
-    @Resource
-    private JdbcTemplate oneTemplate;
-
-    public List<Map<String,Object>> getTest(){
-        String sql = "select " +
-                " a.* from ( select t.*,rownum AS rownumber from cqda.V_SHIZILAISHUI_HISTORY2  t where rownum <= 2000) a " +
-                " where rownumber >0";
-        List<Map<String, Object>> tableData = oneTemplate.queryForList(sql);
-        log.info("这是在database1中获取的数据:{}",tableData);
-        return tableData;
-    }
-}

+ 314 - 320
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/WaterZILAISHUIDao.java

@@ -1,16 +1,13 @@
 package com.shkpr.service.aimodelpower.dbdao.shizilaishuiDataSource;
 
-import com.shkpr.service.aimodelpower.bizmgr.KprAimWaterCollecationBizFun;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.dao.DataAccessException;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Repository;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
 
-import javax.annotation.Resource;
 import javax.sql.DataSource;
 import java.util.ArrayList;
 import java.util.List;
@@ -26,362 +23,359 @@ import java.util.Map;
 @Slf4j
 @Repository
 public class WaterZILAISHUIDao {
-    @Resource
-    private JdbcTemplate oneTemplate;
-
     @Autowired
     @Qualifier("childDatasource")
     private DataSource childDataSource;
 
-    //TODO orcale相关
-    //TODO 获取满足条件的历史水量数据总数
-    public Integer getTabWaterHistoryCount(String extend){
-        int maxAttempts = 10; // 最大重试次数
-        int attempt = 0;
-        long delay = 1000; // 初始延迟时间(毫秒)
-        while (attempt < maxAttempts) {
-            try {
-                String sql = "select count(1)  from cqda.V_SHIZILAISHUI_HISTORY2 ";
-                if ("water_volume_prediction_jiangjin2".equals(KprAimWaterCollecationBizFun.databaseName)) {
-                    sql = "select count(1)  from cqda.V_JIANGJIN_HISTORY";
-                }
-                if (!StringUtils.isEmpty(extend)) {
-                    sql += extend;
-                }
-                int count = oneTemplate.queryForObject(sql, Integer.class);
-                return count;
-            } catch (Exception ex) {
-                // 捕获连接获取失败异常
-                attempt++;
-                if (attempt >= maxAttempts) {
-                    return null;
-                }
-                try {
-                    Thread.sleep(delay); // 延迟重试
-                } catch (InterruptedException e) {
-                    Thread.currentThread().interrupt();
-                }
-                delay *= 2; // 指数退避策略
-            }
-        }
-        return null;
-    }
+//    //TODO orcale相关
+//    //TODO 获取满足条件的历史水量数据总数
+//    public Integer getTabWaterHistoryCount(String extend){
+//        int maxAttempts = 10; // 最大重试次数
+//        int attempt = 0;
+//        long delay = 1000; // 初始延迟时间(毫秒)
+//        while (attempt < maxAttempts) {
+//            try {
+//                String sql = "select count(1)  from cqda.V_SHIZILAISHUI_HISTORY2 ";
+//                if ("water_volume_prediction_jiangjin2".equals(KprAimWaterCollecationBizFun.databaseName)) {
+//                    sql = "select count(1)  from cqda.V_JIANGJIN_HISTORY";
+//                }
+//                if (!StringUtils.isEmpty(extend)) {
+//                    sql += extend;
+//                }
+//                int count = oneTemplate.queryForObject(sql, Integer.class);
+//                return count;
+//            } catch (Exception ex) {
+//                // 捕获连接获取失败异常
+//                attempt++;
+//                if (attempt >= maxAttempts) {
+//                    return null;
+//                }
+//                try {
+//                    Thread.sleep(delay); // 延迟重试
+//                } catch (InterruptedException e) {
+//                    Thread.currentThread().interrupt();
+//                }
+//                delay *= 2; // 指数退避策略
+//            }
+//        }
+//        return null;
+//    }
     //TODO 分页获取历史水量数据
-    public List<Map<String,Object>> getPageZILAISHUI_HISTORY2(int limit,int offset,String extend){
-        int maxAttempts = 10; // 最大重试次数
-        int attempt = 0;
-        long delay = 1000; // 初始延迟时间(毫秒)
-        while (attempt < maxAttempts) {
-            try {
-                String tableName = "cqda.V_SHIZILAISHUI_HISTORY2";
-                String filedOrgName = "NAME";
-                if ("water_volume_prediction_jiangjin2".equals(KprAimWaterCollecationBizFun.databaseName)) {
-                    tableName = "cqda.V_JIANGJIN_HISTORY ";
-                    filedOrgName = "ORG_NAME";
-                }
-                String sql = "select " +
-                        " a.TAG_CODE,a." + filedOrgName + ",a.VAL,TO_CHAR(a.QCQUISITION_TIME,'yyyy-mm-dd hh24:mi:ss') AS QCQUISITION_TIME," +
-                        " TO_CHAR(a.UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS UPDATE_TIME " +
-                        " from ( select t.*,rownum AS rownumber from " + tableName + "  t where rownum <= " + limit + ") a " +
-                        " where rownumber > " + offset;
-                if (!StringUtils.isEmpty(extend)) {
-                    sql = "select " +
-                            " a.TAG_CODE,a." + filedOrgName + ",a.VAL,TO_CHAR(a.QCQUISITION_TIME,'yyyy-mm-dd hh24:mi:ss') AS QCQUISITION_TIME," +
-                            " TO_CHAR(a.UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS UPDATE_TIME " +
-                            " from ( select t.*,rownum AS rownumber from " + tableName + "  t where rownum <= " + limit + " " + extend + ") a " +
-                            " where rownumber >" + offset;
-                }
-                List<Map<String, Object>> tableData = oneTemplate.queryForList(sql);
-                return tableData;
-            } catch (Exception ex) {
-                // 捕获连接获取失败异常
-                attempt++;
-                if (attempt >= maxAttempts) {
-                    return null;
-                }
-                try {
-                    Thread.sleep(delay); // 延迟重试
-                } catch (InterruptedException e) {
-                    Thread.currentThread().interrupt();
-                }
-                delay *= 2; // 指数退避策略
-            }
-        }
-        return null;
-    }
+//    public List<Map<String,Object>> getPageZILAISHUI_HISTORY2(int limit,int offset,String extend){
+//        int maxAttempts = 10; // 最大重试次数
+//        int attempt = 0;
+//        long delay = 1000; // 初始延迟时间(毫秒)
+//        while (attempt < maxAttempts) {
+//            try {
+//                String tableName = "cqda.V_SHIZILAISHUI_HISTORY2";
+//                String filedOrgName = "NAME";
+//                if ("water_volume_prediction_jiangjin2".equals(KprAimWaterCollecationBizFun.databaseName)) {
+//                    tableName = "cqda.V_JIANGJIN_HISTORY ";
+//                    filedOrgName = "ORG_NAME";
+//                }
+//                String sql = "select " +
+//                        " a.TAG_CODE,a." + filedOrgName + ",a.VAL,TO_CHAR(a.QCQUISITION_TIME,'yyyy-mm-dd hh24:mi:ss') AS QCQUISITION_TIME," +
+//                        " TO_CHAR(a.UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS UPDATE_TIME " +
+//                        " from ( select t.*,rownum AS rownumber from " + tableName + "  t where rownum <= " + limit + ") a " +
+//                        " where rownumber > " + offset;
+//                if (!StringUtils.isEmpty(extend)) {
+//                    sql = "select " +
+//                            " a.TAG_CODE,a." + filedOrgName + ",a.VAL,TO_CHAR(a.QCQUISITION_TIME,'yyyy-mm-dd hh24:mi:ss') AS QCQUISITION_TIME," +
+//                            " TO_CHAR(a.UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS UPDATE_TIME " +
+//                            " from ( select t.*,rownum AS rownumber from " + tableName + "  t where rownum <= " + limit + " " + extend + ") a " +
+//                            " where rownumber >" + offset;
+//                }
+//                List<Map<String, Object>> tableData = oneTemplate.queryForList(sql);
+//                return tableData;
+//            } catch (Exception ex) {
+//                // 捕获连接获取失败异常
+//                attempt++;
+//                if (attempt >= maxAttempts) {
+//                    return null;
+//                }
+//                try {
+//                    Thread.sleep(delay); // 延迟重试
+//                } catch (InterruptedException e) {
+//                    Thread.currentThread().interrupt();
+//                }
+//                delay *= 2; // 指数退避策略
+//            }
+//        }
+//        return null;
+//    }
 
     //TODO pgsql water_volume_prediction数据库相关
     //TODO 查询设备关系表信息·不分页
-    public List<Map<String,Object>> getWaterCollectionConfigList(String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionConfigList(String extend) {
+        try {
             String sql = "SELECT * FROM water_collection_config ";
-            if(!StringUtils.isEmpty(extend)){
-                sql+=extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水历史记录表·分页
-    public List<Map<String,Object>> getWaterCollectionRecordList(int limit,int offset,String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionRecordList(int limit, int offset, String extend) {
+        try {
             String sql = "SELECT * FROM water_collecation_record ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
-            sql += " LIMIT " + limit + " OFFSET "+ offset;
+            sql += " LIMIT " + limit + " OFFSET " + offset;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水15分钟用水量记录表·分页
-    public List<Map<String,Object>> getWaterCollectionRecordAllListNew(int limit,int offset,String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionRecordAllListNew(int limit, int offset, String extend) {
+        try {
             String sql = "SELECT * FROM water_collecation_record_all_new ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
-            sql += " LIMIT " + limit + " OFFSET "+ offset;
+            sql += " LIMIT " + limit + " OFFSET " + offset;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水15分钟用水量记录表·不分页
-    public List<Map<String,Object>> getWaterCollectionRecordAllListAllNew(String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionRecordAllListAllNew(String extend) {
+        try {
             String sql = "SELECT * FROM water_collecation_record_all_new ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水小时用水量记录表·分页
-    public List<Map<String,Object>> getWaterCollectionRecordAllList(int limit,int offset,String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionRecordAllList(int limit, int offset, String extend) {
+        try {
             String sql = "SELECT * FROM water_collecation_record_all ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
-            sql += " LIMIT " + limit + " OFFSET "+ offset;
+            sql += " LIMIT " + limit + " OFFSET " + offset;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水小时用水量记录表·不分页
-    public List<Map<String,Object>> getWaterCollectionRecordAllListAll(String extend){
-        try{
+    public List<Map<String, Object>> getWaterCollectionRecordAllListAll(String extend) {
+        try {
             String sql = "SELECT * FROM water_collecation_record_all ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
 
-    public List<Map<String,Object>> getPumpCollectionRecordAllListAll(String extend){
-        try{
+    public List<Map<String, Object>> getPumpCollectionRecordAllListAll(String extend) {
+        try {
             String sql = "SELECT * FROM water_pump_record_all ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 插入自来水历史记录表
-    public int insertWaterCollectionRecord(String extend){
-        try{
+    public int insertWaterCollectionRecord(String extend) {
+        try {
             String sql = "INSERT INTO water_collecation_record " +
                     "(collcation_tag,org_name,time,value,update_time) VALUES ";
-            if(StringUtils.isEmpty(extend)){
+            if (StringUtils.isEmpty(extend)) {
                 return -1;
             }
-            sql+=extend;
+            sql += extend;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 插入自来水15分钟用水量记录表
-    public int insertWaterCollectionRecordAllNew(String extend){
-        try{
+    public int insertWaterCollectionRecordAllNew(String extend) {
+        try {
             String sql = "INSERT INTO water_collecation_record_all_new " +
                     "(org_name,time,value,value_tag,collcation_tag_array) VALUES ";
-            if(StringUtils.isEmpty(extend)){
+            if (StringUtils.isEmpty(extend)) {
                 return -1;
             }
-            sql+=extend;
+            sql += extend;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 修改自来水15分钟用水量记录表value
-    public int updateWaterCollectionRecordAllNew(String value,String extend){
-        try{
+    public int updateWaterCollectionRecordAllNew(String value, String extend) {
+        try {
             String sql = "UPDATE water_collecation_record_all_new " +
-                    " SET \"value\" =  "+value+" " +
+                    " SET \"value\" =  " + value + " " +
                     " ";
-            if(!StringUtils.isEmpty(extend)){
-                sql = sql +extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql = sql + extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
 
     //TODO 插入自来水小时用水量记录表
-    public int insertWaterCollectionRecordAll(String extend){
-        try{
+    public int insertWaterCollectionRecordAll(String extend) {
+        try {
             String sql = "INSERT INTO water_collecation_record_all " +
                     "(org_name,time,value,value_tag,collcation_tag_array) VALUES ";
-            if(StringUtils.isEmpty(extend)){
+            if (StringUtils.isEmpty(extend)) {
                 return -1;
             }
-            sql+=extend;
+            sql += extend;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 修改自来水小时用水量记录表value
-    public int updateWaterCollectionRecordAll(String value,String extend){
-        try{
+    public int updateWaterCollectionRecordAll(String value, String extend) {
+        try {
             String sql = "UPDATE water_collecation_record_all " +
-                    " SET \"value\" =  "+value+" " +
+                    " SET \"value\" =  " + value + " " +
                     " ";
-            if(!StringUtils.isEmpty(extend)){
-                sql = sql +extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql = sql + extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 插入自来水日用水预测数据
-    public int insertTbmWater(String extend){
-        try{
+    public int insertTbmWater(String extend) {
+        try {
             String sql = "INSERT INTO tb_m_water " +
                     "('Date','Month','Week','ActualWaterWithdrawals','ActualWaterSupply'," +
                     " 'ForecastWaterWithdrawals','ForecastActualWaterSupply','isAbnormal','isForecast','LastModifyTime','orgId' ) " +
                     " VALUES ";
-            if(StringUtils.isEmpty(extend)){
+            if (StringUtils.isEmpty(extend)) {
                 return -1;
             }
-            sql+=extend;
+            sql += extend;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 修改自来水日用水预测数据
-    public int updateTbmWater(String[] value,String extend){
-        try{
+    public int updateTbmWater(String[] value, String extend) {
+        try {
             String sql = "UPDATE tb_m_water " +
-                    " SET \"Date\" =  "+value[0]+" " +
-                    " AND \"Month\" =  "+value[1]+" " +
-                    " AND \"Week\" =  "+value[2]+" " +
-                    " AND \"ActualWaterWithdrawals\" =  "+value[3]+" " +
-                    " AND \"ActualWaterSupply\" =  "+value[4]+" " +
-                    " AND \"ForecastWaterWithdrawals\" =  "+value[5]+" " +
-                    " AND \"ForecastActualWaterSupply\" =  "+value[6]+" " +
-                    " AND \"isAbnormal\" =  "+value[7]+" " +
-                    " AND \"isForecast\" =  "+value[8]+" " +
-                    " AND \"LastModifyTime\" =  "+value[9]+" " +
-                    " AND \"orgId\" =  "+value[10]+" " +
+                    " SET \"Date\" =  " + value[0] + " " +
+                    " AND \"Month\" =  " + value[1] + " " +
+                    " AND \"Week\" =  " + value[2] + " " +
+                    " AND \"ActualWaterWithdrawals\" =  " + value[3] + " " +
+                    " AND \"ActualWaterSupply\" =  " + value[4] + " " +
+                    " AND \"ForecastWaterWithdrawals\" =  " + value[5] + " " +
+                    " AND \"ForecastActualWaterSupply\" =  " + value[6] + " " +
+                    " AND \"isAbnormal\" =  " + value[7] + " " +
+                    " AND \"isForecast\" =  " + value[8] + " " +
+                    " AND \"LastModifyTime\" =  " + value[9] + " " +
+                    " AND \"orgId\" =  " + value[10] + " " +
                     " ";
-            if(!StringUtils.isEmpty(extend)){
-                sql = sql +extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql = sql + extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 添加或修改日预测数据
-    public int insertOrUpdateTbmWater(Map<String,Object> value){
-        try{
+    public int insertOrUpdateTbmWater(Map<String, Object> value) {
+        try {
             String sql = "INSERT INTO tb_m_water " +
                     "(\"Date\",\"Month\",\"Week\"";
-            if(!ObjectUtils.isEmpty(value.get("ActualWaterWithdrawals"))){
-                sql +=  " , \"ActualWaterWithdrawals\" ";
+            if (!ObjectUtils.isEmpty(value.get("ActualWaterWithdrawals"))) {
+                sql += " , \"ActualWaterWithdrawals\" ";
             }
 //            if(!ObjectUtils.isEmpty(value.get("ActualWaterSupply"))){
-                sql +=  " ,\"ActualWaterSupply\"";
+            sql += " ,\"ActualWaterSupply\"";
 //            }
-            if(!ObjectUtils.isEmpty(value.get("ForecastWaterWithdrawals"))){
-                sql +=  " , \"ForecastWaterWithdrawals\"";
+            if (!ObjectUtils.isEmpty(value.get("ForecastWaterWithdrawals"))) {
+                sql += " , \"ForecastWaterWithdrawals\"";
             }
-            if(!ObjectUtils.isEmpty(value.get("ForecastActualWaterSupply"))){
-                sql +=  " , \"ForecastActualWaterSupply\"";
+            if (!ObjectUtils.isEmpty(value.get("ForecastActualWaterSupply"))) {
+                sql += " , \"ForecastActualWaterSupply\"";
             }
-            sql +=",\"isAbnormal\",\"isForecast\",\"LastModifyTime\",\"orgId\" ) VALUES ";
-            sql +=" ( ";
+            sql += ",\"isAbnormal\",\"isForecast\",\"LastModifyTime\",\"orgId\" ) VALUES ";
+            sql += " ( ";
             int i = 1;
-            for (Object key : value.keySet()){
-                if(i==value.keySet().size()){
-                    if(ObjectUtils.isEmpty(value.get(key))){
+            for (Object key : value.keySet()) {
+                if (i == value.size()) {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "'";
                     }
-                }else {
-                    if(ObjectUtils.isEmpty(value.get(key))) {
+                } else {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ,";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "',";
                     }
                 }
@@ -390,65 +384,65 @@ public class WaterZILAISHUIDao {
             sql += " )";
             sql += " ON CONFLICT (\"Date\",\"orgId\") " +
                     " DO UPDATE " +
-                    " SET \"Date\" =  '"+value.get("Date")+"' " +
-                    " , \"Month\" =  '"+value.get("Month")+"' " +
-                    " , \"Week\" =  '"+value.get("Week")+"' ";
-            if(!ObjectUtils.isEmpty(value.get("ActualWaterWithdrawals"))){
-                sql +=  " , \"ActualWaterWithdrawals\" =  '"+value.get("ActualWaterWithdrawals")+"' ";
+                    " SET \"Date\" =  '" + value.get("Date") + "' " +
+                    " , \"Month\" =  '" + value.get("Month") + "' " +
+                    " , \"Week\" =  '" + value.get("Week") + "' ";
+            if (!ObjectUtils.isEmpty(value.get("ActualWaterWithdrawals"))) {
+                sql += " , \"ActualWaterWithdrawals\" =  '" + value.get("ActualWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("ActualWaterSupply"))){
-                sql +=  " ,\"ActualWaterSupply\" =  '"+value.get("ActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("ActualWaterSupply"))) {
+                sql += " ,\"ActualWaterSupply\" =  '" + value.get("ActualWaterSupply") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("ForecastWaterWithdrawals"))){
-                sql +=  " , \"ForecastWaterWithdrawals\" =  '"+value.get("ForecastWaterWithdrawals")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("ForecastWaterWithdrawals"))) {
+                sql += " , \"ForecastWaterWithdrawals\" =  '" + value.get("ForecastWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("ForecastActualWaterSupply"))){
-                sql +=  " , \"ForecastActualWaterSupply\" =  '"+value.get("ForecastActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("ForecastActualWaterSupply"))) {
+                sql += " , \"ForecastActualWaterSupply\" =  '" + value.get("ForecastActualWaterSupply") + "' ";
             }
 
-                sql += " , \"isAbnormal\" =  '"+value.get("isAbnormal")+"' " +
-                    " , \"isForecast\" =  '"+value.get("isForecast")+"' " +
-                    " , \"LastModifyTime\" =  '"+value.get("LastModifyTime")+"' " +
-                    " , \"orgId\" =  '"+value.get("orgId")+"' ";
+            sql += " , \"isAbnormal\" =  '" + value.get("isAbnormal") + "' " +
+                    " , \"isForecast\" =  '" + value.get("isForecast") + "' " +
+                    " , \"LastModifyTime\" =  '" + value.get("LastModifyTime") + "' " +
+                    " , \"orgId\" =  '" + value.get("orgId") + "' ";
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 添加或修改日小时预测数据
-    public int insertOrUpdateTbmHourWater(Map<String,Object> value){
-        try{
+    public int insertOrUpdateTbmHourWater(Map<String, Object> value) {
+        try {
             String sql = "INSERT INTO tb_m_hourwater " +
                     "(\"Date\",\"Hour\"";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))){
-                sql +=  " , \"HourForecastWaterWithdrawals\" ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))) {
+                sql += " , \"HourForecastWaterWithdrawals\" ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  " ,\"HourForecastActualWaterSupply\"";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += " ,\"HourForecastActualWaterSupply\"";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))){
-                sql +=  " , \"HourActualWaterWithdrawals\"";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))) {
+                sql += " , \"HourActualWaterWithdrawals\"";
             }
 //            if(!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))){
-                sql +=  " , \"HourActualWaterSupply\"";
+            sql += " , \"HourActualWaterSupply\"";
 //            }
-            sql+= ",\"LastModifyTime\",\"orgId\" ) VALUES ";
-            sql +=" ( ";
+            sql += ",\"LastModifyTime\",\"orgId\" ) VALUES ";
+            sql += " ( ";
             int i = 1;
-            for (Object key : value.keySet()){
-                if(i==value.keySet().size()){
-                    if(ObjectUtils.isEmpty(value.get(key))){
+            for (Object key : value.keySet()) {
+                if (i == value.size()) {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "'";
                     }
-                }else {
-                    if(ObjectUtils.isEmpty(value.get(key))) {
+                } else {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ,";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "',";
                     }
                 }
@@ -457,62 +451,62 @@ public class WaterZILAISHUIDao {
             sql += " )";
             sql += " ON CONFLICT (\"Date\",\"orgId\",\"Hour\") " +
                     " DO UPDATE " +
-                    " SET \"Date\" =  '"+value.get("Date")+"' " +
-                    " , \"Hour\" =  '"+value.get("Hour")+"' ";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))){
-                sql +=  " , \"HourForecastWaterWithdrawals\" =  '"+value.get("HourForecastWaterWithdrawals")+"' ";
+                    " SET \"Date\" =  '" + value.get("Date") + "' " +
+                    " , \"Hour\" =  '" + value.get("Hour") + "' ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))) {
+                sql += " , \"HourForecastWaterWithdrawals\" =  '" + value.get("HourForecastWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  " ,\"HourForecastActualWaterSupply\" =  '"+value.get("HourForecastActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += " ,\"HourForecastActualWaterSupply\" =  '" + value.get("HourForecastActualWaterSupply") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))){
-                sql +=  " , \"HourActualWaterWithdrawals\" =  '"+value.get("HourActualWaterWithdrawals")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))) {
+                sql += " , \"HourActualWaterWithdrawals\" =  '" + value.get("HourActualWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))){
-                sql +=  " , \"HourActualWaterSupply\" =  '"+value.get("HourActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))) {
+                sql += " , \"HourActualWaterSupply\" =  '" + value.get("HourActualWaterSupply") + "' ";
             }
 
-                sql += " , \"LastModifyTime\" =  '"+value.get("LastModifyTime")+"' " +
-                    " , \"orgId\" =  '"+value.get("orgId")+"' ";
+            sql += " , \"LastModifyTime\" =  '" + value.get("LastModifyTime") + "' " +
+                    " , \"orgId\" =  '" + value.get("orgId") + "' ";
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 添加或修改15分钟预测数据
-    public int insertOrUpdateTbmHourWaterNew(Map<String,Object> value){
-        try{
+    public int insertOrUpdateTbmHourWaterNew(Map<String, Object> value) {
+        try {
             String sql = "INSERT INTO tb_m_hourwater_new " +
                     "(\"Date\",\"Hour\"";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))){
-                sql +=  " , \"HourForecastWaterWithdrawals\" ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))) {
+                sql += " , \"HourForecastWaterWithdrawals\" ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  " ,\"HourForecastActualWaterSupply\"";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += " ,\"HourForecastActualWaterSupply\"";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))){
-                sql +=  " , \"HourActualWaterWithdrawals\"";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))) {
+                sql += " , \"HourActualWaterWithdrawals\"";
             }
 //            if(!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))){
-            sql +=  " , \"HourActualWaterSupply\"";
+            sql += " , \"HourActualWaterSupply\"";
 //            }
-            sql+= ",\"LastModifyTime\",\"orgId\" ) VALUES ";
-            sql +=" ( ";
+            sql += ",\"LastModifyTime\",\"orgId\" ) VALUES ";
+            sql += " ( ";
             int i = 1;
-            for (Object key : value.keySet()){
-                if(i==value.keySet().size()){
-                    if(ObjectUtils.isEmpty(value.get(key))){
+            for (Object key : value.keySet()) {
+                if (i == value.size()) {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "'";
                     }
-                }else {
-                    if(ObjectUtils.isEmpty(value.get(key))) {
+                } else {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ,";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "',";
                     }
                 }
@@ -521,53 +515,53 @@ public class WaterZILAISHUIDao {
             sql += " )";
             sql += " ON CONFLICT (\"Date\",\"orgId\",\"Hour\") " +
                     " DO UPDATE " +
-                    " SET \"Date\" =  '"+value.get("Date")+"' " +
-                    " , \"Hour\" =  '"+value.get("Hour")+"' ";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))){
-                sql +=  " , \"HourForecastWaterWithdrawals\" =  '"+value.get("HourForecastWaterWithdrawals")+"' ";
+                    " SET \"Date\" =  '" + value.get("Date") + "' " +
+                    " , \"Hour\" =  '" + value.get("Hour") + "' ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastWaterWithdrawals"))) {
+                sql += " , \"HourForecastWaterWithdrawals\" =  '" + value.get("HourForecastWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  " ,\"HourForecastActualWaterSupply\" =  '"+value.get("HourForecastActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += " ,\"HourForecastActualWaterSupply\" =  '" + value.get("HourForecastActualWaterSupply") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))){
-                sql +=  " , \"HourActualWaterWithdrawals\" =  '"+value.get("HourActualWaterWithdrawals")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterWithdrawals"))) {
+                sql += " , \"HourActualWaterWithdrawals\" =  '" + value.get("HourActualWaterWithdrawals") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))){
-                sql +=  " , \"HourActualWaterSupply\" =  '"+value.get("HourActualWaterSupply")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("HourActualWaterSupply"))) {
+                sql += " , \"HourActualWaterSupply\" =  '" + value.get("HourActualWaterSupply") + "' ";
             }
 
-            sql += " , \"LastModifyTime\" =  '"+value.get("LastModifyTime")+"' " +
-                    " , \"orgId\" =  '"+value.get("orgId")+"' ";
+            sql += " , \"LastModifyTime\" =  '" + value.get("LastModifyTime") + "' " +
+                    " , \"orgId\" =  '" + value.get("orgId") + "' ";
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
 
     //TODO 添加或修改日小时开泵预测表
-    public int insertOrUpdateTbmHourwaterWatersupply(Map<String,Object> value){
-        try{
+    public int insertOrUpdateTbmHourwaterWatersupply(Map<String, Object> value) {
+        try {
             String sql = "INSERT INTO tb_m_hourwater_watersupply " +
                     "(\"Date\",\"Hour\",\"PumpID\",\"PumpStatus\",";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  "\"HourForecastActualWaterSupply\" ,";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += "\"HourForecastActualWaterSupply\" ,";
             }
-            sql+= "\"PumpWater\",\"RealPumpStatus\",\"PumpEnergy\",\"RealPumpEnergy\",\"LastModifyTime\",\"orgId\" ) VALUES ";
-            sql +=" ( ";
+            sql += "\"PumpWater\",\"RealPumpStatus\",\"PumpEnergy\",\"RealPumpEnergy\",\"LastModifyTime\",\"orgId\" ) VALUES ";
+            sql += " ( ";
             int i = 1;
-            for (Object key : value.keySet()){
-                if(i==value.keySet().size()){
-                    if(ObjectUtils.isEmpty(value.get(key))){
+            for (Object key : value.keySet()) {
+                if (i == value.size()) {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "'";
                     }
-                }else {
-                    if(ObjectUtils.isEmpty(value.get(key))) {
+                } else {
+                    if (ObjectUtils.isEmpty(value.get(key))) {
                         sql += " NULL ,";
-                    }else {
+                    } else {
                         sql += "'" + value.get(key) + "',";
                     }
                 }
@@ -576,32 +570,32 @@ public class WaterZILAISHUIDao {
             sql += " )";
             sql += " ON CONFLICT (\"Date\",\"orgId\",\"Hour\",\"PumpID\") " +
                     " DO UPDATE " +
-                    " SET \"Date\" =  '"+value.get("Date")+"' " +
-                    " , \"Hour\" =  '"+value.get("Hour")+"' "+
-                    " , \"PumpID\" =  '"+value.get("PumpID")+"' "+
-                    " , \"PumpStatus\" =  "+value.get("PumpStatus")+" ";
-            if(!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))){
-                sql +=  " ,\"HourForecastActualWaterSupply\" =  '"+value.get("HourForecastActualWaterSupply")+"' ";
+                    " SET \"Date\" =  '" + value.get("Date") + "' " +
+                    " , \"Hour\" =  '" + value.get("Hour") + "' " +
+                    " , \"PumpID\" =  '" + value.get("PumpID") + "' " +
+                    " , \"PumpStatus\" =  " + value.get("PumpStatus") + " ";
+            if (!ObjectUtils.isEmpty(value.get("HourForecastActualWaterSupply"))) {
+                sql += " ,\"HourForecastActualWaterSupply\" =  '" + value.get("HourForecastActualWaterSupply") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("PumpWater"))){
-                sql +=  " , \"PumpWater\" =  '"+value.get("PumpWater")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("PumpWater"))) {
+                sql += " , \"PumpWater\" =  '" + value.get("PumpWater") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("RealPumpStatus"))){
-                sql +=  " , \"RealPumpStatus\" =  "+value.get("RealPumpStatus")+" ";
+            if (!ObjectUtils.isEmpty(value.get("RealPumpStatus"))) {
+                sql += " , \"RealPumpStatus\" =  " + value.get("RealPumpStatus") + " ";
             }
-            if(!ObjectUtils.isEmpty(value.get("PumpEnergy"))){
-                sql +=  " , \"PumpEnergy\" =  '"+value.get("PumpEnergy")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("PumpEnergy"))) {
+                sql += " , \"PumpEnergy\" =  '" + value.get("PumpEnergy") + "' ";
             }
-            if(!ObjectUtils.isEmpty(value.get("RealPumpEnergy"))){
-                sql +=  " , \"RealPumpEnergy\" =  '"+value.get("RealPumpEnergy")+"' ";
+            if (!ObjectUtils.isEmpty(value.get("RealPumpEnergy"))) {
+                sql += " , \"RealPumpEnergy\" =  '" + value.get("RealPumpEnergy") + "' ";
             }
 
-                sql += " , \"LastModifyTime\" =  '"+value.get("LastModifyTime")+"' " +
-                    " , \"orgId\" =  '"+value.get("orgId")+"' ";
+            sql += " , \"LastModifyTime\" =  '" + value.get("LastModifyTime") + "' " +
+                    " , \"orgId\" =  '" + value.get("orgId") + "' ";
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }
@@ -610,61 +604,61 @@ public class WaterZILAISHUIDao {
      * TODO 泵组优化相关
      */
     //TODO 获取泵数据采集配置
-    public List<Map<String,Object>> getWaterPumpCollectionConfigList(String extend){
-        try{
+    public List<Map<String, Object>> getWaterPumpCollectionConfigList(String extend) {
+        try {
             String sql = "SELECT * FROM water_pump_collection_config ";
-            if(!StringUtils.isEmpty(extend)){
-                sql+=extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水小时泵数据记录表·分页
-    public List<Map<String,Object>> getWaterPumpRecordAllList(int limit,int offset,String extend){
-        try{
+    public List<Map<String, Object>> getWaterPumpRecordAllList(int limit, int offset, String extend) {
+        try {
             String sql = "SELECT * FROM water_pump_record_all ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
-            sql += " LIMIT " + limit + " OFFSET "+ offset;
+            sql += " LIMIT " + limit + " OFFSET " + offset;
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
     //TODO 查询市自来水小时泵数据记录表·不分页
-    public List<Map<String,Object>> getWaterPumpRecordAllListAll(String extend){
-        try{
+    public List<Map<String, Object>> getWaterPumpRecordAllListAll(String extend) {
+        try {
             String sql = "SELECT * FROM water_pump_record_all ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
 
-    public List<Map<String,Object>> getWatertPumpEnergy(String extend){
-        try{
+    public List<Map<String, Object>> getWatertPumpEnergy(String extend) {
+        try {
             String sql = "SELECT * FROM tb_m_pump_energy ";
-            if(!StringUtils.isEmpty(extend)){
+            if (!StringUtils.isEmpty(extend)) {
                 sql += extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
-            List<Map<String,Object>> tableData = pgJdbc.queryForList(sql);
+            List<Map<String, Object>> tableData = pgJdbc.queryForList(sql);
             return tableData;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return null;
         }
     }
@@ -753,18 +747,18 @@ public class WaterZILAISHUIDao {
 
 
     //TODO 修改自来水小时泵数据记录表value
-    public int updateWaterPumpRecordAll(String value,String extend){
-        try{
+    public int updateWaterPumpRecordAll(String value, String extend) {
+        try {
             String sql = "UPDATE water_level_record_all " +
-                    " SET \"value\" =  "+value+" " +
+                    " SET \"value\" =  " + value + " " +
                     " ";
-            if(!StringUtils.isEmpty(extend)){
-                sql = sql +extend;
+            if (!StringUtils.isEmpty(extend)) {
+                sql = sql + extend;
             }
             JdbcTemplate pgJdbc = new JdbcTemplate(childDataSource);
             Integer resCode = pgJdbc.update(sql);
             return resCode;
-        }catch(Exception ex){
+        } catch (Exception ex) {
             return -1;
         }
     }

+ 40 - 40
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/service/WaterTapWaterServiceImpl.java

@@ -22,47 +22,47 @@ public class WaterTapWaterServiceImpl implements WaterTapWaterService {
     @Autowired
     private WaterZILAISHUIDao waterZILAISHUIDao;
 
-    @Override
-    public Integer getTabWaterHistoryCount(String extend) {
-        int nCode = 0;
-        String strMsg = "Success";
-        Integer arrRes = null;
-        try {
-            arrRes = waterZILAISHUIDao.getTabWaterHistoryCount(extend);
-        }catch (Exception e){
-            nCode = LogLevelFlag.LOG_ERROR.ordinal();
-            strMsg = e.getLocalizedMessage();
-        }finally {
-//            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.valueFromInt(nCode)
-//                    , LogFlagBusiType.BUSI_CHILD_DB_TAP_WATER.toStrValue()
-//                    , mStrClassName
-//                    , String.format("Batch Query TabWaterCount:{%s},{%s} from database, code:{%s} msg:{%s} ..."
-//                            , arrRes
-//                            ,extend
-//                            , nCode, strMsg));
-        }
-        return arrRes;
-    }
+//    @Override
+//    public Integer getTabWaterHistoryCount(String extend) {
+//        int nCode = 0;
+//        String strMsg = "Success";
+//        Integer arrRes = null;
+//        try {
+//            arrRes = waterZILAISHUIDao.getTabWaterHistoryCount(extend);
+//        }catch (Exception e){
+//            nCode = LogLevelFlag.LOG_ERROR.ordinal();
+//            strMsg = e.getLocalizedMessage();
+//        }finally {
+////            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.valueFromInt(nCode)
+////                    , LogFlagBusiType.BUSI_CHILD_DB_TAP_WATER.toStrValue()
+////                    , mStrClassName
+////                    , String.format("Batch Query TabWaterCount:{%s},{%s} from database, code:{%s} msg:{%s} ..."
+////                            , arrRes
+////                            ,extend
+////                            , nCode, strMsg));
+//        }
+//        return arrRes;
+//    }
 
-    @Override
-    public List<Map<String, Object>> getPageZILAISHUI_HISTORY2(int limit, int offset, String extend) {
-        int nCode = 0;
-        String strMsg = "Success";
-        List<Map<String, Object>> arrRes = null;
-        try {
-            arrRes = waterZILAISHUIDao.getPageZILAISHUI_HISTORY2(limit,offset,extend);
-        }catch (Exception e){
-            nCode = LogLevelFlag.LOG_ERROR.ordinal();
-            strMsg = e.getLocalizedMessage();
-        }finally {
-//            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.valueFromInt(nCode)
-//                    , LogFlagBusiType.BUSI_CHILD_DB_TAP_WATER.toStrValue()
-//                    , mStrClassName
-//                    , String.format("Batch Query TabWaterHistory from database, code:{%d} msg:{%s} ..."
-//                            , nCode, strMsg));
-        }
-        return arrRes;
-    }
+//    @Override
+//    public List<Map<String, Object>> getPageZILAISHUI_HISTORY2(int limit, int offset, String extend) {
+//        int nCode = 0;
+//        String strMsg = "Success";
+//        List<Map<String, Object>> arrRes = null;
+//        try {
+//            arrRes = waterZILAISHUIDao.getPageZILAISHUI_HISTORY2(limit,offset,extend);
+//        }catch (Exception e){
+//            nCode = LogLevelFlag.LOG_ERROR.ordinal();
+//            strMsg = e.getLocalizedMessage();
+//        }finally {
+////            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.valueFromInt(nCode)
+////                    , LogFlagBusiType.BUSI_CHILD_DB_TAP_WATER.toStrValue()
+////                    , mStrClassName
+////                    , String.format("Batch Query TabWaterHistory from database, code:{%d} msg:{%s} ..."
+////                            , nCode, strMsg));
+//        }
+//        return arrRes;
+//    }
 
     @Override
     public List<Map<String,Object>> getWaterCollectionConfigList(String extend) {

+ 2 - 2
src/main/java/com/shkpr/service/aimodelpower/dbdao/shizilaishuiDataSource/service/intef/WaterTapWaterService.java

@@ -6,10 +6,10 @@ import java.util.Map;
 public interface WaterTapWaterService {
 
     //TODO orcale 获取市自来水历史用水记录总数
-    public Integer getTabWaterHistoryCount(String extend);
+//    public Integer getTabWaterHistoryCount(String extend);
 
     //TODO orcale 获取市自来水历史用水记录·分页
-    public List<Map<String,Object>> getPageZILAISHUI_HISTORY2(int limit, int offset, String extend);
+//    public List<Map<String,Object>> getPageZILAISHUI_HISTORY2(int limit, int offset, String extend);
 
     //TODO pgsql 获取市自来水历史用水配置关系记录
     public List<Map<String,Object>> getWaterCollectionConfigList(String extend);

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 202
src/main/java/com/shkpr/service/aimodelpower/globalmgr/ScheduleTaskMgr.java


+ 0 - 5
src/main/resources/application.properties

@@ -58,11 +58,6 @@ global.max.tomcat.accept.queue=200
 #global.redis.config.path=./redis.properties
 #===================数据库配置===========================
 global.sql.config.path=./sql.properties
-# oracle数据源
-spring.datasource.primary.url=jdbc:oracle:thin:@10.127.16.117:1521/ORCLPDB1
-spring.datasource.primary.username=v_cqzls
-spring.datasource.primary.password=CQzls#2025
-spring.datasource.primary.driver-class-name=oracle.jdbc.driver.OracleDriver
 #spring.datasource.primary.username=v_shizilaishui
 #spring.datasource.primary.password=ShiZiLaiShui@0811
 #spring.datasource.primary.driver-class-name=oracle.jdbc.driver.OracleDriver