| | |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Pwrdev_Historydata_GW_Table+PowerDeviceId+"_"+Com.getDateTimeFormat(time, Com.DTF_YM)+ "( " +
|
| | | " `num` bigint(20) NOT NULL AUTO_INCREMENT," +
|
| | | " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '记录时间'," +
|
| | | " `PowerDeviceId` bigint(20) NOT NULL DEFAULT '0' COMMENT '电源id'," + |
| | | " `acIn1_volA` float NOT NULL DEFAULT '0' COMMENT '交流1路输入A相电压'," + |
| | | " `acIn1_volB` float NOT NULL DEFAULT '0' COMMENT '交流1路输入B相电压'," + |
| | | " `acIn1_volC` float NOT NULL DEFAULT '0' COMMENT '交流1路输入C相电压'," + |
| | | " `acIn2_volA` float NOT NULL DEFAULT '0' COMMENT '交流2路输入A相电压'," + |
| | | " `acIn2_volB` float NOT NULL DEFAULT '0' COMMENT '交流2路输入B相电压'," + |
| | | " `acIn2_volC` float NOT NULL DEFAULT '0' COMMENT '交流2路输入C相电压'," + |
| | | " `acIn1_currA` float NOT NULL DEFAULT '0' COMMENT '交流1路输入A相电流'," + |
| | | " `acIn1_currB` float NOT NULL DEFAULT '0' COMMENT '交流1路输入B相电流'," + |
| | | " `acIn1_currC` float NOT NULL DEFAULT '0' COMMENT '交流1路输入C相电流'," + |
| | | " `acIn2_currA` float NOT NULL DEFAULT '0' COMMENT '交流2路输入A相电流'," + |
| | | " `acIn2_currB` float NOT NULL DEFAULT '0' COMMENT '交流2路输入B相电流'," + |
| | | " `acIn2_currC` float NOT NULL DEFAULT '0' COMMENT '交流2路输入C相电流'," + |
| | | " `dcOut_vol` float NOT NULL DEFAULT '0' COMMENT '直流输出电压'," + |
| | | " `dcOut_curr` float NOT NULL DEFAULT '0' COMMENT '直流输出电流'," + |
| | | " `powerdeviceid` bigint(20) NOT NULL DEFAULT '0' COMMENT '电源id'," + |
| | | " `acin1_vola` float NOT NULL DEFAULT '0' COMMENT '交流1路输入A相电压'," + |
| | | " `acin1_volb` float NOT NULL DEFAULT '0' COMMENT '交流1路输入B相电压'," + |
| | | " `acin1_volc` float NOT NULL DEFAULT '0' COMMENT '交流1路输入C相电压'," + |
| | | " `acin2_vola` float NOT NULL DEFAULT '0' COMMENT '交流2路输入A相电压'," + |
| | | " `acin2_volb` float NOT NULL DEFAULT '0' COMMENT '交流2路输入B相电压'," + |
| | | " `acin2_volc` float NOT NULL DEFAULT '0' COMMENT '交流2路输入C相电压'," + |
| | | " `acin1_curra` float NOT NULL DEFAULT '0' COMMENT '交流1路输入A相电流'," + |
| | | " `acin1_currb` float NOT NULL DEFAULT '0' COMMENT '交流1路输入B相电流'," + |
| | | " `acin1_currc` float NOT NULL DEFAULT '0' COMMENT '交流1路输入C相电流'," + |
| | | " `acin2_curra` float NOT NULL DEFAULT '0' COMMENT '交流2路输入A相电流'," + |
| | | " `acin2_currb` float NOT NULL DEFAULT '0' COMMENT '交流2路输入B相电流'," + |
| | | " `acin2_currc` float NOT NULL DEFAULT '0' COMMENT '交流2路输入C相电流'," + |
| | | " `dcout_vol` float NOT NULL DEFAULT '0' COMMENT '直流输出电压'," + |
| | | " `dcout_curr` float NOT NULL DEFAULT '0' COMMENT '直流输出电流'," + |
| | | " `battgroup1_vol` float NOT NULL DEFAULT '0' COMMENT '电池组1电压'," +
|
| | | " `battgroup1_curr` float NOT NULL DEFAULT '0' COMMENT '电池组1电流'," +
|
| | | " `battgroup2_vol` float NOT NULL DEFAULT '0' COMMENT '电池组2电压'," +
|
| | |
| | | " `m14_out_vol` float NOT NULL DEFAULT '0' COMMENT '整流器14输出电压'," +
|
| | | " `m15_out_vol` float NOT NULL DEFAULT '0' COMMENT '整流器15输出电压'," +
|
| | | " `m16_out_vol` float NOT NULL DEFAULT '0' COMMENT '整流器16输出电压'," +
|
| | | " `m1_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器1输出电流'," + |
| | | " `m2_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器2输出电流'," + |
| | | " `m3_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器3输出电流'," + |
| | | " `m4_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器4输出电流'," + |
| | | " `m5_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器5输出电流'," + |
| | | " `m6_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器6输出电流'," + |
| | | " `m7_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器7输出电流'," + |
| | | " `m8_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器8输出电流'," + |
| | | " `m9_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器9输出电流'," + |
| | | " `m10_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器10输出电流'," + |
| | | " `m11_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器11输出电流'," + |
| | | " `m12_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器12输出电流'," + |
| | | " `m13_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器13输出电流'," + |
| | | " `m14_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器14输出电流'," + |
| | | " `m15_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器15输出电流'," + |
| | | " `m16_outCurr` float NOT NULL DEFAULT '0' COMMENT '整流器16输出电流'," + |
| | | " `m1_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器1输出电流'," + |
| | | " `m2_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器2输出电流'," + |
| | | " `m3_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器3输出电流'," + |
| | | " `m4_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器4输出电流'," + |
| | | " `m5_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器5输出电流'," + |
| | | " `m6_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器6输出电流'," + |
| | | " `m7_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器7输出电流'," + |
| | | " `m8_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器8输出电流'," + |
| | | " `m9_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器9输出电流'," + |
| | | " `m10_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器10输出电流'," + |
| | | " `m11_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器11输出电流'," + |
| | | " `m12_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器12输出电流'," + |
| | | " `m13_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器13输出电流'," + |
| | | " `m14_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器14输出电流'," + |
| | | " `m15_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器15输出电流'," + |
| | | " `m16_outcurr` float NOT NULL DEFAULT '0' COMMENT '整流器16输出电流'," + |
| | | " `m_temper1` float NOT NULL DEFAULT '0' COMMENT '1路环境温度'," +
|
| | | " `m_temper2` float NOT NULL DEFAULT '0' COMMENT '2路环境温度'," +
|
| | | " `m_humidity1` float NOT NULL DEFAULT '0' COMMENT '1路环境湿度'," +
|
| | | " `m_humidity2` float NOT NULL DEFAULT '0' COMMENT '2路环境湿度'," +
|
| | | " `userAcIn1_volA` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入A相电压'," + |
| | | " `userAcIn1_volB` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入B相电压'," + |
| | | " `userAcIn1_volC` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入C相电压'," + |
| | | " `userAcIn1_currA` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入A相电流'," + |
| | | " `userAcIn1_currB` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入B相电流'," + |
| | | " `userAcIn1_currC` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入C相电流'," + |
| | | " `userAcIn2_volA` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入A相电压'," + |
| | | " `userAcIn2_volB` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入B相电压'," + |
| | | " `userAcIn2_volC` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入C相电压'," + |
| | | " `userAcIn2_currA` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入A相电流'," + |
| | | " `userAcIn2_currB` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入B相电流'," + |
| | | " `userAcIn2_currC` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入C相电流'," + |
| | | " `useracin1_vola` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入A相电压'," + |
| | | " `useracin1_volb` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入B相电压'," + |
| | | " `useracin1_volc` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入C相电压'," + |
| | | " `useracin1_curra` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入A相电流'," + |
| | | " `useracin1_currb` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入B相电流'," + |
| | | " `useracin1_currc` float NOT NULL DEFAULT '0' COMMENT '采集1路交流输入C相电流'," + |
| | | " `useracin2_vola` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入A相电压'," + |
| | | " `useracin2_volb` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入B相电压'," + |
| | | " `useracin2_volc` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入C相电压'," + |
| | | " `useracin2_curra` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入A相电流'," + |
| | | " `useracin2_currb` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入B相电流'," + |
| | | " `useracin2_currc` float NOT NULL DEFAULT '0' COMMENT '采集2路交流输入C相电流'," + |
| | | " PRIMARY KEY (`num`)," +
|
| | | " KEY `index_powerdeviceid` (`PowerDeviceId`) USING BTREE," + |
| | | " KEY `index_powerdeviceid` (`powerdeviceid`) USING BTREE," + |
| | | " KEY `index_record_time` (`record_time`) USING BTREE" +
|
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='国网电源历史实时数据记录表';";
|
| | |
|
| | |
| | |
|
| | | String sql_str = " INSERT INTO " + Sql_Mysql.Pwrdev_Historydata_GW_Table + rtdata.PowerDevDeviceId + "_" + Com.getDateTimeFormat(time, Com.DTF_YM) + " ";
|
| | |
|
| | | String sql_str_target = " (PowerDeviceId,record_time,acIn1_volA,acIn1_volB,acIn1_volC,acIn2_volA,acIn2_volB,acIn2_volC,acIn1_currA,acIn1_currB,acIn1_currC,acIn2_currA,acIn2_currB,acIn2_currC,dcOut_vol,dcOut_curr,battgroup1_vol,battgroup1_curr,battgroup2_vol,battgroup2_curr,m1_out_vol,m2_out_vol,m3_out_vol,m4_out_vol,m5_out_vol,m6_out_vol,m7_out_vol,m8_out_vol,m9_out_vol,m10_out_vol,m11_out_vol,m12_out_vol,m13_out_vol,m14_out_vol,m15_out_vol,m16_out_vol,m1_outCurr,m2_outCurr,m3_outCurr,m4_outCurr,m5_outCurr,m6_outCurr,m7_outCurr,m8_outCurr,m9_outCurr,m10_outCurr,m11_outCurr,m12_outCurr,m13_outCurr,m14_outCurr,m15_outCurr,m16_outCurr,m_temper1,m_temper2,m_humidity1,m_humidity2,userAcIn1_volA,userAcIn1_volB,userAcIn1_volC,userAcIn1_currA,userAcIn1_currB,userAcIn1_currC,userAcIn2_volA,userAcIn2_volB,userAcIn2_volC,userAcIn2_currA,userAcIn2_currB,userAcIn2_currC) VALUES " ;
|
| | | String sql_str_target = " (powerdeviceid,record_time,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc,acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc,dcout_vol,dcout_curr,battgroup1_vol,battgroup1_curr,battgroup2_vol,battgroup2_curr,m1_out_vol,m2_out_vol,m3_out_vol,m4_out_vol,m5_out_vol,m6_out_vol,m7_out_vol,m8_out_vol,m9_out_vol,m10_out_vol,m11_out_vol,m12_out_vol,m13_out_vol,m14_out_vol,m15_out_vol,m16_out_vol,m1_outcurr,m2_outcurr,m3_outcurr,m4_outcurr,m5_outcurr,m6_outcurr,m7_outcurr,m8_outcurr,m9_outcurr,m10_outcurr,m11_outcurr,m12_outcurr,m13_outcurr,m14_outcurr,m15_outcurr,m16_outcurr,m_temper1,m_temper2,m_humidity1,m_humidity2,useracin1_vola,useracin1_volb,useracin1_volc,useracin1_curra,useracin1_currb,useracin1_currc,useracin2_vola,useracin2_volb,useracin2_volc,useracin2_curra,useracin2_currb,useracin2_currc) VALUES " ;
|
| | |
|
| | | String sql_values = "(" + rtdata.PowerDevDeviceId +"," + "'" + Com.getDateTimeFormat(new Date(),Com.DTF_YMDhms ) + "',";
|
| | |
|