From 82d3504d93db29e2b04ed1137e541a19e0cba0f1 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期一, 23 六月 2025 09:08:14 +0800
Subject: [PATCH] 预警分析管理

---
 src/main/java/com/whyc/service/SubTablePageInfoService.java |  384 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 358 insertions(+), 26 deletions(-)

diff --git a/src/main/java/com/whyc/service/SubTablePageInfoService.java b/src/main/java/com/whyc/service/SubTablePageInfoService.java
index 17fd08c..23f6ad1 100644
--- a/src/main/java/com/whyc/service/SubTablePageInfoService.java
+++ b/src/main/java/com/whyc/service/SubTablePageInfoService.java
@@ -3,7 +3,9 @@
 import com.whyc.dto.AlmHis.BattAlmPar;
 import com.whyc.dto.AlmHis.DevAlmPar;
 import com.whyc.dto.AlmHis.PwrAlmPar;
+import com.whyc.dto.AnalysisAlm.ResAnalysis;
 import com.whyc.dto.Real.*;
+import com.whyc.dto.Statistic.QuarterPwr7Res;
 import com.whyc.mapper.CallBack;
 import com.whyc.pojo.db_alarm.BattalarmDataHistory;
 import com.whyc.pojo.db_alarm.DevalarmDataHistory;
@@ -11,13 +13,16 @@
 import com.whyc.pojo.db_data_history.BattRealdataId;
 import com.whyc.pojo.db_data_history.PwrdevHistorydataId;
 import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmHistory;
+import com.whyc.util.ActionUtil;
 import com.whyc.util.ThreadLocalUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.lang.reflect.Field;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class SubTablePageInfoService {
@@ -199,7 +204,7 @@
                     data.setProvice(rs.getString("provice"));
                     data.setCity(rs.getString("city"));
                     data.setCountry(rs.getString("country"));
-                    data.setBattGroupName(rs.getString("battgroup_name"));
+                    data.setBattgroupName(rs.getString("battgroup_name"));
                     list.add(data);
                 }
                 return list;
@@ -317,6 +322,7 @@
                     ph.setNum(rs.getLong("num"));
                     ph.setDevId(rs.getInt("dev_id"));
                     ph.setDevIp(rs.getString("dev_ip"));
+                    ph.setAlmId(rs.getInt("alm_id"));
                     ph.setAlmLevel(rs.getInt("alm_level"));
                     ph.setAlmStartTime(rs.getTimestamp("alm_start_time"));
                     ph.setAlmEndTime(rs.getTimestamp("alm_end_time"));
@@ -530,7 +536,7 @@
         });
        return list;
     }
-    //鎵捐繖娆℃斁鐢电殑鏈�鍚庝竴绗旀暟鎹�
+    //鎵捐繖娆℃斁鐢电殑鎸囧畾涓�绗旀暟鎹�
     public List<BatttestdataId> getLastDataByBattgroupId(Integer battgroupId, Integer testRecordCount, Integer recordNum) {
         String sql="select   distinct * from db_batt_testdata.tb_batttestdata_"+battgroupId
                 +" where test_record_count="+testRecordCount+" and record_num="+recordNum+ " order by mon_num asc";
@@ -559,11 +565,11 @@
         return list;
     }
     //绯荤粺姒傝鑾峰彇鍗婂皬鏃舵牳瀹硅澶囦俊鎭�(缁勭淇℃伅鍙栦竴涓崟浣撲俊鎭嵆鍙�)
-    public List<BattHisRealDto> getHalfHourBattDevData(String tableName,Integer granularity) {
-        String sql="select  distinct mon_num,record_time,group_vol,online_vol,group_curr,group_tmp " +
+    public List<BattHisRealDto> getHalfHourBattDevData(String tableName,Integer granularity,String halfHourAgoTime) {
+        String sql="select  distinct mon_num,record_time,group_vol,online_vol,group_curr,group_tmp,load_curr " +
                 "from (select a.*, (@i:= @i+1) as number " +
                 "     from (select * from "+tableName+" "+
-                "                    where record_time>date_sub(now(),interval 0.5 hour) and mon_num=1) a, " +
+                "                    where record_time>='"+halfHourAgoTime+"' and mon_num=1) a, " +
                 "                   (select @i:=0) b) c "+
                 " where c.number%"+granularity+"=0 or c.number=1 ";
         sql+=" order by record_time asc";
@@ -578,6 +584,7 @@
                     data.setOnlineVol(rs.getFloat("online_vol"));
                     data.setGroupCurr(rs.getFloat("group_curr"));
                     data.setGroupTmp(rs.getFloat("group_tmp"));
+                    data.setLoadCurr(rs.getFloat("load_curr"));
                     list.add(data);
                 }
                 return list;
@@ -586,14 +593,12 @@
         return list;
     }
     //绯荤粺姒傝鑾峰彇鍗婂皬鏃朵氦娴佽緭鍏ョ粺璁�
-    public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity) {
-        String sql="select  distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " +
-                ",acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc  " +
-                "from (select a.*, (@i:= @i+1) as number " +
-                "     from (select * from "+tableName+" "+
-                "                    where record_datetime>date_sub(now(),interval 0.5 hour)) a, " +
-                "                   (select @i:=0) b) c "+
-                " where c.number%"+granularity+"=0 or c.number=1 ";
+    public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity,Date recordDatetime,Date recordDatetime1) {
+        String sql=" select  distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " +
+                " ,acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc  " +
+                " from "+tableName+" where record_datetime>='"+ActionUtil.sdf.format(recordDatetime)+"'" +
+                "                    and record_datetime<='"+ActionUtil.sdf.format(recordDatetime1)+
+                "' and record_num%"+granularity+"=0 or record_num=1 or record_num=100 ";
         sql+=" order by record_datetime asc";
         List<PwrHisRealAcInDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
             @Override
@@ -622,13 +627,11 @@
         return list;
     }
 
-    public List<PwrHisRealDcoutInDto> getHalfHourPwrHisDcoutData(String tableName,Integer granularity) {
-        String sql="select  distinct record_datetime,dcout_vol,dcout_curr,battgroup1_vol,battgroup1_curr,battgroup2_vol,battgroup2_curr " +
-                "from (select a.*, (@i:= @i+1) as number " +
-                "     from (select * from "+tableName+" "+
-                "                    where record_datetime>date_sub(now(),interval 0.5 hour)) a, " +
-                "                   (select @i:=0) b) c "+
-                " where c.number%"+granularity+"=0 or c.number=1 ";
+    public List<PwrHisRealDcoutInDto> getHalfHourPwrHisDcoutData(String tableName,Integer granularity,Date recordDatetime,Date recordDatetime1) {
+        String sql="select  distinct * " +
+                " from "+tableName+" where record_datetime>='"+ActionUtil.sdf.format(recordDatetime)+"'" +
+                "                    and record_datetime<='"+ActionUtil.sdf.format(recordDatetime1)+
+                "' and record_num%"+granularity+"=0 or record_num=1 or record_num=100 ";
         sql+=" order by record_datetime asc";
         List<PwrHisRealDcoutInDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
             @Override
@@ -637,12 +640,341 @@
                 while (rs.next()){
                     PwrHisRealDcoutInDto data=new PwrHisRealDcoutInDto();
                     data.setRecordDatetime(rs.getTimestamp("record_datetime"));
-                    data.setDcoutVol(rs.getFloat("dcout_vol"));
-                    data.setDcoutCurr(rs.getFloat("dcout_curr"));
-                    data.setBattgroup1Vol(rs.getFloat("battgroup1_vol"));
-                    data.setBattgroup1Curr(rs.getFloat("battgroup1_curr"));
-                    data.setBattgroup2Vol(rs.getFloat("battgroup2_vol"));
-                    data.setBattgroup2Curr(rs.getFloat("battgroup2_curr"));
+                    data.setMOutputvol(rs.getFloat("m_outputvol"));
+                    data.setM1Outcurr(rs.getFloat("m1_outcurr"));
+                    data.setM2Outcurr(rs.getFloat("m2_outcurr"));
+                    data.setM3Outcurr(rs.getFloat("m3_outcurr"));
+                    data.setM4Outcurr(rs.getFloat("m4_outcurr"));
+                    data.setM5Outcurr(rs.getFloat("m5_outcurr"));
+                    data.setM6Outcurr(rs.getFloat("m6_outcurr"));
+                    data.setM7Outcurr(rs.getFloat("m7_outcurr"));
+                    data.setM8Outcurr(rs.getFloat("m8_outcurr"));
+                    data.setM9Outcurr(rs.getFloat("m9_outcurr"));
+                    data.setM10Outcurr(rs.getFloat("m10_outcurr"));
+                    data.setM11Outcurr(rs.getFloat("m11_outcurr"));
+                    data.setM12Outcurr(rs.getFloat("m12_outcurr"));
+                    data.setM13Outcurr(rs.getFloat("m13_outcurr"));
+                    data.setM14Outcurr(rs.getFloat("m14_outcurr"));
+                    data.setM15Outcurr(rs.getFloat("m15_outcurr"));
+                    data.setM16Outcurr(rs.getFloat("m16_outcurr"));
+                    data.setM1OutVol(rs.getFloat("m1_out_vol"));
+                    data.setM2OutVol(rs.getFloat("m2_out_vol"));
+                    data.setM3OutVol(rs.getFloat("m3_out_vol"));
+                    data.setM4OutVol(rs.getFloat("m4_out_vol"));
+                    data.setM5OutVol(rs.getFloat("m5_out_vol"));
+                    data.setM6OutVol(rs.getFloat("m6_out_vol"));
+                    data.setM7OutVol(rs.getFloat("m7_out_vol"));
+                    data.setM8OutVol(rs.getFloat("m8_out_vol"));
+                    data.setM9OutVol(rs.getFloat("m9_out_vol"));
+                    data.setM10OutVol(rs.getFloat("m10_out_vol"));
+                    data.setM11OutVol(rs.getFloat("m11_out_vol"));
+                    data.setM12OutVol(rs.getFloat("m12_out_vol"));
+                    data.setM13OutVol(rs.getFloat("m13_out_vol"));
+                    data.setM14OutVol(rs.getFloat("m14_out_vol"));
+                    data.setM15OutVol(rs.getFloat("m15_out_vol"));
+                    data.setM16OutVol(rs.getFloat("m16_out_vol"));
+                    list.add(data);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+    //鍘嗗彶娴嬭瘯璁板綍鍏蜂綋鏌愪竴娆℃斁鐢垫暟鎹鎯�
+    public List<BatttestdataId> getTinfDataWithTestRecordCount(String tableName, Integer testRecordCount, Integer recordNum, Integer granularity) {
+        String sql="select distinct * from "+tableName+" "+
+                " where test_record_count="+testRecordCount+" " +
+                " and  record_num%"+granularity+"=0 or record_num=1 or record_num="+recordNum;
+        sql+=" order by record_time asc";
+        List<BatttestdataId> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<BatttestdataId> list=new ArrayList<>();
+                while (rs.next()){
+                    BatttestdataId data=new BatttestdataId();
+                    data.setNum(rs.getInt("num"));
+                    data.setBattgroupId(rs.getInt("battgroup_id"));
+                    data.setTestRecordCount(rs.getInt("test_record_count"));
+                    data.setTestType(rs.getInt("test_type"));
+                    data.setRecordNum(rs.getInt("record_num"));
+                    data.setDataNew(rs.getInt("data_new"));
+                    data.setDataAvailable(rs.getInt("data_available"));
+                    data.setTestTimelong(rs.getInt("test_timelong"));
+                    data.setTestCurr(rs.getFloat("test_curr"));
+                    data.setTestCap(rs.getFloat("test_cap"));
+                    data.setMonNum(rs.getInt("mon_num"));
+                    data.setMonVol(rs.getFloat("mon_vol"));
+                    data.setMonTmp(rs.getFloat("mon_tmp"));
+                    data.setMonRes(rs.getFloat("mon_res"));
+                    data.setTestStarttime(rs.getTimestamp("test_starttime"));
+                    data.setRecordTime(rs.getTimestamp("record_time"));
+                    data.setGroupVol(rs.getFloat("group_vol"));
+                    data.setOnlineVol(rs.getFloat("online_vol"));
+                    list.add(data);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+    //鍒ゆ柇鐢垫睜缁勫巻鍙插疄鏃惰〃鏄惁瀛樺湪
+    public int judgeTable_realdata( String table){
+        String sql="select count(*) as tableNum " +
+                "        from INFORMATION_SCHEMA.TABLES " +
+                "        where TABLE_SCHEMA = 'db_data_history' " +
+                "          and TABLE_NAME = 'tb_batt_realdata_"+table+"'";
+        List list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                LinkedList<Object> temp = new LinkedList<>();
+                try {
+                    while (rs.next())
+                        temp.add(rs.getInt("tableNum"));
+                } catch (SQLException e) {
+                    e.printStackTrace();
+                }
+                return temp;
+            }
+        });
+        int tableNum =0;
+        if(list!=null){
+            tableNum= (int) list.get(0);
+        }
+        return tableNum;
+    }
+    //鍒ゆ柇鐢垫簮鍘嗗彶瀹炴椂琛ㄦ槸鍚﹀瓨鍦�
+    public int judgeTable_pwrhis( String table){
+        String sql="select count(*) as tableNum " +
+                "        from INFORMATION_SCHEMA.TABLES " +
+                "        where TABLE_SCHEMA = 'db_data_history' " +
+                "          and TABLE_NAME = 'tb_pwrdev_historydata_"+table+"'";
+        List list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                LinkedList<Object> temp = new LinkedList<>();
+                try {
+                    while (rs.next())
+                        temp.add(rs.getInt("tableNum"));
+                } catch (SQLException e) {
+                    e.printStackTrace();
+                }
+                return temp;
+            }
+        });
+        int tableNum =0;
+        if(list!=null){
+            tableNum= (int) list.get(0);
+        }
+        return tableNum;
+    }
+    //鐢垫睜鏁版嵁鍘嗗彶瀹炴椂澶勭悊
+    public List<RealDateDTO> getBattRealDataHis(BattRealdataId realdata, int granularity,Integer maxRecordNum,Integer minRecordNum) {
+        String sql=" select record_time, group_vol, online_vol,group_curr, mon_vol, mon_tmp, mon_res, mon_num,record_num  " +
+                "               from db_data_history.tb_batt_realdata_"+realdata.getTableName()+" " +
+                "               where record_time >= '"+ThreadLocalUtil.format(realdata.getRecordTime(),1)+"' " +
+                "               and record_time <= '"+ThreadLocalUtil.format(realdata.getRecordTime1(),1)+"' "+
+                "               and (record_num-"+minRecordNum+")%"+granularity+"=0 or record_num="+maxRecordNum+" or record_num="+minRecordNum ;
+        List<RealDateDTO> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<RealDateDTO> list=new ArrayList<>();
+                while (rs.next()){
+                    RealDateDTO ph=new RealDateDTO();
+                    ph.setRecordTime(rs.getTimestamp("record_time"));
+                    ph.setGroupVol(rs.getFloat("group_vol"));
+                    ph.setOnlineVol(rs.getFloat("online_vol"));
+                    ph.setGroupCurr(rs.getFloat("group_curr"));
+                    ph.setMonVol(rs.getFloat("mon_vol"));
+                    ph.setMonTmp(rs.getFloat("mon_tmp"));
+                    ph.setMonRes(rs.getFloat("mon_res"));
+                    ph.setMonNum(rs.getInt("mon_num"));
+                    ph.setRecordNum(rs.getInt("record_num"));
+                    list.add(ph);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+    //鐢垫睜鏁版嵁鍘嗗彶瀹炴椂澶勭悊(棰勮鍒嗘瀽)
+    public List<ResAnalysis> getBattHisRealInAlm(BattRealdataId realdata, Map<String,Object> battMap) {
+        String result = String.join(",", battMap.keySet());
+        String sql=" select record_time,"+result+" " +
+                "               from db_data_history.tb_batt_realdata_"+realdata.getTableName()+" " +
+                "               where record_time >= '"+ThreadLocalUtil.format(realdata.getRecordTime(),1)+"' " +
+                "               and record_time <= '"+ThreadLocalUtil.format(realdata.getRecordTime1(),1)+"' " +
+                "               order by record_time asc,mon_num asc";
+        List<ResAnalysis> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<ResAnalysis> list=new ArrayList<>();
+                while (rs.next()){
+                    ResAnalysis ph=new ResAnalysis();
+                    ph.setRecordTime(rs.getTimestamp("record_time"));
+                    int i=1;
+                    for (String key : battMap.keySet()) {
+                        Integer dataType = (Integer) battMap.get(key);
+                        try {
+                            String propertyType = "dataType"+(i);
+                            Field fieldType = ResAnalysis.class.getDeclaredField(propertyType);
+                            fieldType.setAccessible(true);
+                            fieldType.set(ph,dataType);
+
+                            Float value = rs.getFloat(key);
+                            String propertyName = "dataName"+(i);
+                            Field fieldName = ResAnalysis.class.getDeclaredField(propertyName);
+                            fieldName.setAccessible(true); // 濡傛灉瀛楁鏄鏈夌殑锛岄渶瑕佽缃负鍙闂�
+                            fieldName.set(ph,key);
+
+                            String propertyValue = "dataValue"+(i);
+                            Field fieldValue = ResAnalysis.class.getDeclaredField(propertyValue);
+                            fieldValue.setAccessible(true);
+                            fieldValue.set(ph,value);
+                        } catch (NoSuchFieldException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        }
+                        i++;
+                    }
+                    list.add(ph);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+
+    //鐢垫簮鏁版嵁鍘嗗彶瀹炴椂澶勭悊(棰勮鍒嗘瀽)
+    public List<ResAnalysis> getPwrHisRealInAlm(PwrdevHistorydataId pwrHis, Map<String,Object> pwrMap) {
+        String result = String.join(",", pwrMap.keySet());
+        String sql=" select record_datetime,"+result+"  " +
+                "               from db_data_history.tb_pwrdev_historydata_"+pwrHis.getTableName()+" " +
+                "               where record_datetime >= '"+ThreadLocalUtil.format(pwrHis.getRecordDatetime(),1)+"' " +
+                "               and record_datetime <= '"+ThreadLocalUtil.format(pwrHis.getRecordDatetime1(),1)+"' " +
+                "               order by record_datetime asc ";
+        List<ResAnalysis> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<ResAnalysis> list=new ArrayList<>();
+                while (rs.next()){
+                    ResAnalysis ph=new ResAnalysis();
+                    ph.setRecordTime(rs.getTimestamp("record_datetime"));
+                    int i=1;
+                    for (String key : pwrMap.keySet()) {
+                        Integer dataType = (Integer) pwrMap.get(key);
+                        try {
+                            String propertyType = "dataType"+(i);
+                            Field fieldType = ResAnalysis.class.getDeclaredField(propertyType);
+                            fieldType.setAccessible(true);
+                            fieldType.set(ph,dataType);
+
+                            Float value = rs.getFloat(key);
+                            String propertyName = "dataName"+(i);
+                            Field fieldName = ResAnalysis.class.getDeclaredField(propertyName);
+                            fieldName.setAccessible(true); // 濡傛灉瀛楁鏄鏈夌殑锛岄渶瑕佽缃负鍙闂�
+                            fieldName.set(ph,key);
+
+                            String propertyValue = "dataValue"+(i);
+                            Field fieldValue = ResAnalysis.class.getDeclaredField(propertyValue);
+                            fieldValue.setAccessible(true);
+                            fieldValue.set(ph,value);
+                        } catch (NoSuchFieldException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        }
+                        i++;
+                    }
+                    list.add(ph);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+    //鑾峰彇鎸囧畾鏃堕棿娈靛唴鏈�澶ф渶灏弐ecordNum纭繚鏁版嵁鐨勫畬鏁�
+    public List getMaxAndMinRecordNum(BattRealdataId realdata) {
+        String sql="select max(record_num) as maxRecordNum,min(record_num) as minRecordNum " +
+                " from db_data_history.tb_batt_realdata_" + realdata.getTableName()+" " +
+                " where record_time >= '"+ThreadLocalUtil.format(realdata.getRecordTime(),1)+"' " +
+                " and record_time <= '"+ThreadLocalUtil.format(realdata.getRecordTime1(),1)+"'  " +
+                " limit 1";
+        List list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List list = new ArrayList<>();
+                while (rs.next()) {
+                    list.add(rs.getInt("maxRecordNum"));
+                    list.add(rs.getInt("minRecordNum"));
+                }
+                return list;
+            }
+           });
+         return list;
+    }
+    //1.2.7浼樿壇鐢垫簮缁熻涓婁竴瀛e害鐨勭數婧愭煇涓�灞炴�у拰鍙傛暟闃堝�艰秴杩囩殑娆℃暟
+    public List<PwrdevHistorydataId> getPwrQuarter7(String tableName,List<String> propertyNameList) {
+        String result = propertyNameList.stream().collect(Collectors.joining(","));
+        String sql=" select  distinct record_datetime,"+result+" " +
+                " from "+tableName+" " ;
+        sql+=" order by record_datetime asc";
+        List<PwrdevHistorydataId> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<PwrdevHistorydataId> list=new ArrayList<>();
+                while (rs.next()){
+                    PwrdevHistorydataId data=new PwrdevHistorydataId();
+                    data.setRecordDatetime(rs.getTimestamp("record_datetime"));
+                    for (int i=0;i<propertyNameList.size();i++){
+                        try {
+                            Float value = rs.getFloat(propertyNameList.get(i));
+                            String propertyName = ActionUtil.toCamelCase(propertyNameList.get(i));
+                            Field fieldValue = PwrdevHistorydataId.class.getDeclaredField(propertyName);
+                            fieldValue.setAccessible(true);
+                            fieldValue.set(data,value);
+                        } catch (NoSuchFieldException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    list.add(data);
+                }
+                return list;
+            }
+        });
+        return list;
+    }
+    //鑾峰彇鍏蜂綋鐨勬斁鐢垫暟鎹�
+    public List<BatttestdataId> exportTinfDataByTestRecordCount(Integer battgroupId, Integer testRecordCount, String tableName) {
+        String sql="select distinct * from "+tableName+" "+
+                " where test_record_count="+testRecordCount;
+        sql+=" order by record_time asc";
+        List<BatttestdataId> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
+            @Override
+            public List getResults(ResultSet rs) throws SQLException {
+                List<BatttestdataId> list=new ArrayList<>();
+                while (rs.next()){
+                    BatttestdataId data=new BatttestdataId();
+                    data.setNum(rs.getInt("num"));
+                    data.setBattgroupId(rs.getInt("battgroup_id"));
+                    data.setTestRecordCount(rs.getInt("test_record_count"));
+                    data.setTestType(rs.getInt("test_type"));
+                    data.setRecordNum(rs.getInt("record_num"));
+                    data.setDataNew(rs.getInt("data_new"));
+                    data.setDataAvailable(rs.getInt("data_available"));
+                    data.setTestTimelong(rs.getInt("test_timelong"));
+                    data.setTestCurr(rs.getFloat("test_curr"));
+                    data.setTestCap(rs.getFloat("test_cap"));
+                    data.setMonNum(rs.getInt("mon_num"));
+                    data.setMonVol(rs.getFloat("mon_vol"));
+                    data.setMonTmp(rs.getFloat("mon_tmp"));
+                    data.setMonRes(rs.getFloat("mon_res"));
+                    data.setTestStarttime(rs.getTimestamp("test_starttime"));
+                    data.setRecordTime(rs.getTimestamp("record_time"));
+                    data.setGroupVol(rs.getFloat("group_vol"));
+                    data.setOnlineVol(rs.getFloat("online_vol"));
                     list.add(data);
                 }
                 return list;

--
Gitblit v1.9.1