iec_61850_forFoShanAES/src/com/battdata_rt/BattData_RT_SQL.java
@@ -6,6 +6,7 @@
import java.util.Date;
import com.base.Com;
import com.dec.fbs9100.BattResStorePro_Thread;
import com.dec.fbs9100.MysqlConnPool;
import com.dec.fbs9100.Sql_Mysql;
@@ -172,6 +173,7 @@
               + " batt_rest_power1_time=" + bd_rt.getBattRestTime()
               + " WHERE BattGroupId=" + bd_rt.BattGroupId;
         
         bd_rt.mTestData.updateNewDataRCTime(new Date());
         //System.out.println(sql_str);
         sql.sqlMysqlExecute(sql_str);
      } catch (SQLException e) {
@@ -563,6 +565,97 @@
      return sql_str;
   }
   
   /**
    *
    *    @lijun 2021-08-16向tb_batttestdata_inf表中添加数据或者更新数据
    * @param rt_data
    * @return
    */
   public static String getInsertOrUpdateBattTestDataInfStr(MysqlConnPool pool,BattData_RT rt_data, int test_stoptype_t)
   {
      String sql_str = " ";
      BattStatData tmp_test_data = rt_data.mTestData.clone();
      tmp_test_data.test_stoptype = test_stoptype_t;
      if(false == rt_data.MysqlRecordInf_Exist)
      {
         sql_str = "INSERT INTO " + Sql_Mysql.BattTestDataInf_Table
               + " (BattGroupId, "
               + "test_record_count, "
               + "test_type, "
               + "record_time_interval, "
               + "data_new, "
               + "data_available, "
               + "record_num, "
               + "test_starttime, "
               + "test_starttype, "
               + "record_time, "
               + "test_timelong, "
               + "test_stoptype, "
               + "group_vol, "
               + "test_curr, "
               + "test_cap, "
               + "max_monnum, "
               + "max_monvol, "
               + "min_monnum, "
               + "min_monvol) "
               + " VALUES "
               + "("+ rt_data.BattGroupId + ", "
               + tmp_test_data.testRecordCount + ", "
               + tmp_test_data.battTestType_For_DataSave + ", "
               + rt_data.mSaveDataTimeInterval + ", "
               + true + ", "
               + true + ", "
               + (tmp_test_data.recordNum + 1) + ", "
               + "'" + Com.getDateTimeFormat(tmp_test_data.startTestTime, Com.DTF_YMDhms) + "', "
               + tmp_test_data.testLoaderType + ", "
               + "'" + Com.getDateTimeFormat(tmp_test_data.recordTime, Com.DTF_YMDhms) + "', "
               + tmp_test_data.testTimeLong + ", "
               + tmp_test_data.test_stoptype + ", "
               + tmp_test_data.groupVol + ", "
               + tmp_test_data.testCurr + ", "
               + tmp_test_data.testCap + ", "
               + rt_data.mMaxMonNum + ", "
               + rt_data.mMaxMonVol + ", "
               + rt_data.mMinMonNum + ", "
               + rt_data.mMinMonVol + ") ";
         /**
          * 2021-08-16 @lijun   向插入batttestdata_inf表中插入历史数据时记录当前电池组的内阻数据
          *
          */
         BattResStorePro_Thread.insertMonDataToResTable(pool, rt_data, tmp_test_data.startTestTime, BattStatData.BATTDATA_RES);
      }
      else
      {
         sql_str = "UPDATE " + Sql_Mysql.BattTestDataInf_Table
               + " SET "
               + "test_type=" + tmp_test_data.battTestType_For_DataSave + ", "
               + "record_time_interval=" + rt_data.mSaveDataTimeInterval + ", "
               + "data_new=" + true + ", "
               + "data_available=" + true + ", "
               + "record_num=" + (tmp_test_data.recordNum + 1) + ", "
               + "test_starttime='" +  Com.getDateTimeFormat(tmp_test_data.startTestTime, Com.DTF_YMDhms) + "', "
               + "test_starttype=" + tmp_test_data.testLoaderType + ", "
               + "record_time='" +  Com.getDateTimeFormat(tmp_test_data.recordTime, Com.DTF_YMDhms) + "', "
               + "test_timelong=" + tmp_test_data.testTimeLong + ", "
               + "test_stoptype=" + tmp_test_data.test_stoptype + ", "
               + "group_vol=" + tmp_test_data.groupVol + ", "
               + "test_curr=" + tmp_test_data.testCurrAbsMax + ", "
               + "test_cap=" + tmp_test_data.testCap + ", "
               + "max_monnum=" + rt_data.mMaxMonNum + ", "
               + "max_monvol=" + rt_data.mMaxMonVol + ", "
               + "min_monnum=" + rt_data.mMinMonNum + ", "
               + "min_monvol=" + rt_data.mMinMonVol + " "
               + " WHERE "
               + " BattGroupId=" + rt_data.BattGroupId
               + " AND "
               + " test_starttime='" + Com.getDateTimeFormat(tmp_test_data.startTestTime, Com.DTF_YMDhms) + "'";
               //+ " test_record_count=" + tmp_test_data.testRecordCount;
      }
      return sql_str;
   }
   
   /**
    * ��������������������rt_data����������������������������������������tb_batttestdata_id,tb_testdatastop_id,tb_batttestdata_inf��������������������������SQL���������������