package com.database_util; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Date; import com.base.Com; import com.battdata_rt.BattData_RT_RamDB_Thread_SQL; import com.sql.MysqlConnPool; import com.sql.Sql_Mysql; public class DB_Ram_db { public static void init(MysqlConnPool pool, boolean recreate) { System.out.println(" Db_Ram_Db init start at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); createDb_Ram_Db(pool); createFBS9100s_fod_state(pool,recreate); //´´½¨³ýÁò״̬±ítb_fbs9100s_fod_state createFBS9100SetDLParam_Table(pool,recreate); //´´½¨³ýÁò²ÎÊý±í createFBS9100_NiBian_State_Table(pool, recreate); //´´½¨Äæ±äÐÅÏ¢±í createSocketClientStateTable(pool, recreate); createServerState_Table(pool, recreate); createLd9_Updatestatue_Table(pool, recreate); createLd9_State_Table(pool, recreate); createLd9_Setparam_Table(pool, recreate); createLd9_Concentratestate_Table(pool, recreate); createLd9_Concentrateparam_Table(pool, recreate); createHardDevSmsState_Table(pool, recreate); createFBS9600State_Table(pool, recreate); createFBS9100S_DFUState_Table(pool, recreate); createFBS9100S_DcDcState_Table(pool, recreate); createFBS9100SysParam_Table(pool, recreate); createFBS9100State_Table(pool, recreate); createFBS9100SetParam_Table(pool, recreate); createFBS9100_offlineyhplan_Table(pool, recreate); createFBS9100BattParam_Table(pool, recreate); createBTSStationState_Table(pool, recreate); createBTSGPRSState_Table(pool, recreate); createBMP7100State_Table(pool, recreate); createBattRtState_Table(pool, recreate); createBattRtData_Table(pool, recreate); create61850_JHState_Table(pool, recreate); createRamDB_CMCC_POWER_Data_Table(pool, recreate); createFBS9100_CollectionstateTable(pool, recreate); createFBS9100_InsulatstateTable(pool, recreate); createFBS9100_ChargerstateTable(pool, recreate); createTb_Lithium_DataTable(pool, recreate); //ÄϾ©ËͼìÌØÓÐ createTb_Batt_RTAlarm_Table(pool, recreate); //ÄϾ©ËͼìÌØÓÐ createTb_Batt_RSAlarm_Table(pool, recreate); //´´½¨¸É½Úµã״̬±í createFBS9100s_stemnode_state_Table(pool, recreate); //´´½¨Ä¸Áª¿ª¹Ø×´Ì¬±í createFBS9100s_buscouple_state_Table(pool, recreate); //´´½¨FGCD³ä·ÅµçÒ»Ìå»úÏÂÔØ¿ØÖƱí createFgcd_filedownload_Table(pool, recreate); //´´½¨Ë«ÏòDCDC¹¤×÷²ÎÊý±í createTb_li9130_dcdc_param(pool, recreate); //´´½¨Ë«ÏòDCDCÄÚ²¿Êý¾Ý±í createTb_li9130_dcdc_data(pool, recreate); //´´½¨ï®µç³ØBMSÄ£ÄâÁ¿±í createTb_li9130_bms_state(pool, recreate); //´´½¨ï®µç³ØBMS¸æ¾¯Á¿±í createTb_li9130_bms_alm(pool, recreate); createTb_li9130_setparam_plan(pool, recreate); /** * db_ram_db.tb_ess3100_sysstate */ createTb_ess3100_sysstate(pool, recreate); /** * db_ram_db.tb_ess3100_pcs_state */ createTb_ess3100_pcs_state(pool, recreate); //´´½¨É½Î÷´¢ÄÜÉ豸ʵʱÐÅÏ¢±í createTB_Batt_Gtstate_Table(pool,recreate); //´´½¨Ô¶³ÌÖØÆô×°ÖÃ״̬ÐÅÏ¢±í createTB_Dev61851_State_Table(pool,recreate); //µç²Ù¿ª¹ØÒ£ÐÅʵʱ״̬±í createDEV60870_Inverter_State(pool, recreate); //´´½¨µç²Ù¿ª¹ØÒ£²âʵʱ״̬±í createDEV60870_Inverter_Info(pool, recreate); //´´½¨²¢ÁªBTSÍØÆË״̬ÐÅÏ¢±í createFBS9140_Topology_State(pool, recreate); //´´½¨²¢ÁªBTS9×é²ÎÊý±í createFBS9149_SetParam(pool,recreate); //´´½¨³ä·ÅµçÒ»Ìå»úÀëÏß¼ì²â±í createCheck_Dialog_Table(pool,recreate); //´´½¨ÖÇÄÜĸÁªÊµÊ±×´Ì¬ÐÅÏ¢±í createIntelligentBusbar_State_Table(pool, recreate); //´´½¨BTS6185Ïà¹ØÉ豸¸æ¾¯ãÐÖµÒ£µ÷±í createDev_6185_AlmpPram_Table(pool, recreate); //´´½¨ ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£²âʵʱ״̬±í createDev6159_Power_Yc_Table(pool, recreate); //´´½¨ ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£²âʵʱ״̬±í createDev6159_Power_Yx_Table(pool, recreate); //´´½¨ ½»Ö±Á÷¼à¿ØÆÁʵʱÊý¾Ý±í createAcdc_Secuity_Table(pool, recreate); System.out.println(" Db_Ram_Db init end at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); } /** * ´´½¨½»Ö±Á÷¼à¿ØÆÁʵʱÊý¾Ý±í * @param pool * @param recreate */ private static void createAcdc_Secuity_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Acdc_Secuity_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Acdc_Secuity_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '1' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + " `acin1_vola` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷AÏàÊäÈëµçѹ'," + " `acin1_volb` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷BÏàÊäÈëµçѹ'," + " `acin1_volc` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷CÏàÊäÈëµçѹ'," + " `acin1_curra` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷AÏàÊäÈëµçÁ÷'," + " `acin1_currb` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷BÏàÊäÈëµçÁ÷'," + " `acin1_currc` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷CÏàÊäÈëµçÁ÷'," + " `acin1_freq` float NOT NULL DEFAULT '0' COMMENT 'µÚһ·½»Á÷ÊäÈëÆµÂÊ'," + " `acin2_vola` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷AÏàÊäÈëµçѹ'," + " `acin2_volb` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷BÏàÊäÈëµçѹ'," + " `acin2_volc` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷CÏàÊäÈëµçѹ'," + " `acin2_curra` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷AÏàÊäÈëµçÁ÷'," + " `acin2_currb` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷BÏàÊäÈëµçÁ÷'," + " `acin2_currc` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷CÏàÊäÈëµçÁ÷'," + " `acin2_freq` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·½»Á÷ÊäÈëÆµÂÊ'," + " `dc_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³öµçѹ'," + " `load_curr` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçÁ÷'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `idx_dev_id` (`dev_id`) USING BTREE," + " KEY `idx_record_time` (`record_time`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='½»Ö±Á÷¼à¿ØÆÁʵʱÊý¾Ý±í';"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨³ä·ÅµçÒ»Ìå»úÀëÏß¼ì²â±í * @param pool * @param recreate */ private static void createCheck_Dialog_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Check_Dialog_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Check_Dialog_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(64) NOT NULL DEFAULT '910000001'," + " `test_start_time` datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨³ä·ÅµçÒ»Ìå»úÀëÏß¼ì²â±í * @param pool * @param recreate */ private static void createIntelligentBusbar_State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.IntelligentBusbar_State_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.IntelligentBusbar_State_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `dcdc1_temp` float NOT NULL DEFAULT '0' COMMENT 'DCDC1_ʵʱζÈ'," + " `dcdc2_temp` float NOT NULL DEFAULT '0' COMMENT 'DCDC2ʵʱζÈ'," + " `dcdc1_outputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC1ʵʱÊä³öµçѹ'," + " `dcdc2_outputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC2ʵʱÊä³öµçѹ'," + " `dcdc1_outputcurr` float NOT NULL DEFAULT '0' COMMENT 'DCDC1ʵʱÊä³öµçÁ÷'," + " `dcdc2_outputcurr` float NOT NULL DEFAULT '0' COMMENT 'DCDC2ʵʱÊä³öµçÁ÷'," + " `dcdc1_inputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC1ʵʱÊäÈëµçѹ'," + " `dcdc2_inputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC2ʵʱÊäÈëµçѹ'," + " `dcdc1_inputcurr` float NOT NULL DEFAULT '0' COMMENT 'DCDC1ʵʱÊäÈëµçÁ÷'," + " `dcdc2_inputcurr` float unsigned NOT NULL DEFAULT '0' COMMENT 'DCDC1ʵʱÊäÈëµçÁ÷'," + " `dcdc1_errcode` int(11) NOT NULL DEFAULT '0' COMMENT 'DCDC1 Òì³£´úÂë-״̬'," + " `dcdc2_errcode` int(11) NOT NULL DEFAULT '0' COMMENT 'DCDC2 Òì³£´úÂë-״̬'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ÖÇÄÜĸÁªÊµÊ±×´Ì¬±í';"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ BTS6185Ïà¹ØÉ豸¸æ¾¯ãÐÖµÒ£µ÷±í * @param pool * @param recreate */ private static void createDev_6185_AlmpPram_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Dev_6185_AlmpPram_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Dev_6185_AlmpPram_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT '²Ù×÷ÃüÁî'," + " `groupvol_high_val` float NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ¸ßãÐÖµ'," + " `groupvol_low_val` float NOT NULL DEFAULT '0' COMMENT '×é¶ËµçѹµÍãÐÖµ'," + " `monvol_high_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµçѹ¸ßãÐÖµ'," + " `monvol_low_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹµÍãÐÖµ'," + " `montmp_high_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåζȸßãÐÖµ'," + " `montmp_low_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåζȵÍãÐÖµ'," + " `monres_high_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÄÚ×è¸ßãÐÖµ'," + " `monres_low_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÄÚ×èµÍãÐÖµ'," + " `moncap_high_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÈÝÁ¿¸ßãÐÖµ'," + " `moncap_low_val` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÈÝÁ¿µÍãÐÖµ'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='BTS6185Ïà¹ØÉ豸¸æ¾¯ãÐÖµÒ£µ÷±í';" + ";"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£²âʵʱ״̬±í * @param pool * @param recreate */ private static void createDev6159_Power_Yc_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Dev6159_Power_Yc_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Dev6159_Power_Yc_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¸üÐÂʱ¼ä'," + " `acin1_vola_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàÊäÈëµçѹ-ACSWIB'," + " `acin1_volb_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàÊäÈëµçѹ-ACSWIB'," + " `acin1_volc_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàÊäÈëµçѹ-ACSWIB'," + " `acin1_curra_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàÊäÈëµçÁ÷-ACSWIB'," + " `acin1_currb_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàÊäÈëµçÁ÷-ACSWIB'," + " `acin1_currc_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàÊäÈëµçÁ÷-ACSWIB'," + " `acin2_vola_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàÊäÈëµçѹ-ACSWIB'," + " `acin2_volb_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàÊäÈëµçѹ-ACSWIB'," + " `acin2_volc_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàÊäÈëµçѹ-ACSWIB'," + " `acin2_curra_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàÊäÈëµçÁ÷-ACSWIB'," + " `acin2_currb_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàÊäÈëµçÁ÷-ACSWIB'," + " `acin2_currc_ac` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàÊäÈëµçÁ÷-ACSWIB'," + " `ac_vol_highlimit_ac` float NOT NULL DEFAULT '0' COMMENT '½»Á÷µçѹ¸æ¾¯ãÐÖµÉÏÏÞ-ACSWIB'," + " `ac_vol_lowlimit_ac` float NOT NULL DEFAULT '0' COMMENT '½»Á÷µçѹ¸æ¾¯ãÐÖµÏÂÏÞ-ACSWIB'," + " `ac_dev_temp_ac` float NOT NULL DEFAULT '0' COMMENT '½»Á÷Åäµç¹ñζÈÖµ-ACSWIB'," + " `acin1_vola_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàÊäÈëµçѹ-CPSS'," + " `acin1_volb_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàÊäÈëµçѹ-CPSS'," + " `acin1_volc_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàÊäÈëµçѹ-CPSS'," + " `ac_vol_higlimit_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷µçѹ¸æ¾¯ãÐÖµÉÏÏÞ-CPSS'," + " `ac_vol_lowlimit_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷µçѹ¸æ¾¯ãÐÖµÏÂÏÞ-CPSS'," + " `acin2_vola_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàÊäÈëµçѹ-CPSS'," + " `acin2_volb_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàÊäÈëµçѹ-CPSS'," + " `acin2_volc_cpss` float NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàÊäÈëµçѹ-CPSS'," + " `ac_vola_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàÊä³öµçѹ-CPSS'," + " `ac_volb_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàÊä³öµçѹ-CPSS'," + " `ac_volc_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàÊä³öµçѹ-CPSS'," + " `ac_outcurra_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàÊä³öµçÁ÷-CPSS'," + " `ac_outcurrb_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàÊä³öµçÁ÷-CPSS'," + " `ac_outcurrc_cpss` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàÊä³öµçÁ÷-CPSS'," + " `dc_outvol_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³öµçѹ-CPSS'," + " `load_curr_cpss` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçÁ÷-CPSS'," + " `dc_outvol_highlimit_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³öµçѹ¸æ¾¯ãÐÖµÉÏÏÞ-CPSS'," + " `dc_outvol_lowlimit_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³öµçѹ¸æ¾¯ãÐÖµÏÂÏÞ-CPSS'," + " `batt1_vol_cpss` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø¶Ë1µçѹ-CPSS'," + " `batt_chargecurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ðîµç³Ø×é³äµçµçÁ÷-CPSS'," + " `jun_charge_vol_cpss` float NOT NULL DEFAULT '0' COMMENT '¾ù³äµçѹ-CPSS'," + " `float_charge_vol_cpss` float NOT NULL DEFAULT '0' COMMENT '¸¡³äµçѹ-CPSS'," + " `batt_charcurr_limit_cpss` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø³äµçÏÞÁ÷Öµ-CPSS'," + " `batt2_vol_cpss` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø¶Ë2µçѹ-CPSS'," + " `dev_temp_cpss` float NOT NULL DEFAULT '0' COMMENT '¸ßƵ¿ª¹ØµçÔ´¹ñζÈ-CPSS'," + " `m1_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1Êä³öµçÁ÷-CPSS'," + " `m2_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2Êä³öµçÁ÷-CPSS'," + " `m3_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3Êä³öµçÁ÷-CPSS'," + " `m4_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4Êä³öµçÁ÷-CPSS'," + " `m5_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5Êä³öµçÁ÷-CPSS'," + " `m6_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6Êä³öµçÁ÷-CPSS'," + " `m7_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7Êä³öµçÁ÷-CPSS'," + " `m8_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8Êä³öµçÁ÷-CPSS'," + " `m9_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9Êä³öµçÁ÷-CPSS'," + " `m10_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10Êä³öµçÁ÷-CPSS'," + " `m11_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11Êä³öµçÁ÷-CPSS'," + " `m12_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12Êä³öµçÁ÷-CPSS'," + " `m13_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13Êä³öµçÁ÷-CPSS'," + " `m14_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14Êä³öµçÁ÷-CPSS'," + " `m15_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15Êä³öµçÁ÷-CPSS'," + " `m16_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16Êä³öµçÁ÷-CPSS'," + " `m17_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17Êä³öµçÁ÷-CPSS'," + " `m18_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18Êä³öµçÁ÷-CPSS'," + " `m19_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19Êä³öµçÁ÷-CPSS'," + " `m20_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20Êä³öµçÁ÷-CPSS'," + " `m21_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21Êä³öµçÁ÷-CPSS'," + " `m22_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22Êä³öµçÁ÷-CPSS'," + " `m23_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23Êä³öµçÁ÷-CPSS'," + " `m24_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24Êä³öµçÁ÷-CPSS'," + " `m25_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25Êä³öµçÁ÷-CPSS'," + " `m26_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26Êä³öµçÁ÷-CPSS'," + " `m27_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27Êä³öµçÁ÷-CPSS'," + " `m28_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28Êä³öµçÁ÷-CPSS'," + " `m29_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29Êä³öµçÁ÷-CPSS'," + " `m30_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30Êä³öµçÁ÷-CPSS'," + " `m31_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31Êä³öµçÁ÷-CPSS'," + " `m32_outcurr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32Êä³öµçÁ÷-CPSS'," + " `acin_usecount_cpss` int(11) NOT NULL DEFAULT '0' COMMENT 'ÔÚÓý»Á÷·Êý-CPSS'," + " `dcin1_vol_dc` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·ֱÁ÷ÊäÈëµçѹ-DCSWIB'," + " `dcin2_vol_dc` float NOT NULL DEFAULT '0' COMMENT 'µÚ1·ֱÁ÷ÊäÈëµçѹ-DCSWIB'," + " `dcout1_vol_dc` float NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷ĸÏßÊä³öµçѹ-DCSWIB'," + " `dcout1_curr_dc` float NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷ĸÏßÊä³öµçÁ÷-DCSWIB'," + " `dcvol_highlimit_dc` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ¸æ¾¯ãÐÖµÉÏÏÞ-DCSWIB'," + " `dcvol_lowlimit_dc` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ¸æ¾¯ãÐÖµÏÂÏÞ-DCSWIB'," + " `dcout2_vol_dc` float NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷ĸÏßÊä³öµçѹ-DCSWIB'," + " `dcout2_curr_dc` float NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷ĸÏßÊä³öµçÁ÷-DCSWIB'," + " `dev_temp_dc` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Åäµç¹ñζÈ-DCSWIB'," + " `ac_power_freq1_ac` float NOT NULL DEFAULT '0' COMMENT 'µçԴƵÂÊ1-ACSWIB'," + " `ac_power_freq2_ac` float NOT NULL DEFAULT '0' COMMENT 'µçԴƵÂÊ2-ACSWIB'," + " `model_curr_cpss` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿éµçÁ÷-CPSS'," + " `power_curr1` float NOT NULL DEFAULT '0' COMMENT 'KBÉÏ·½×ó²àµçÁ÷'," + " `power_curr2` float NOT NULL DEFAULT '0' COMMENT 'KBÉÏ·½ÓÒ²àµçÁ÷'," + " `ac_freq_ac` float NOT NULL DEFAULT '0' COMMENT '½»Á÷ƵÂÊ'," + " `batt1_curr` float NOT NULL DEFAULT '0' COMMENT 'µç³ØµçÁ÷1'," + " `batt2_curr` float NOT NULL DEFAULT '0' COMMENT 'µç³ØµçÁ÷2'," + " `model_total_curr` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é×ܵçÁ÷'," + " `batt_temp` float NOT NULL DEFAULT '0' COMMENT 'µç³ØÎ¶È'," + " `envir_temp` float NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È'," + " `extend_temp` float NOT NULL DEFAULT '0' COMMENT 'À©Õ¹Î¶È'," + " `envir_humid` float NOT NULL DEFAULT '0' COMMENT '»·¾³Êª¶È'," + " `batt_cap` float NOT NULL DEFAULT '0' COMMENT 'µç³ØÈÝÁ¿'," + " `load1_curr` float NOT NULL DEFAULT '0' COMMENT '¸ºÔØ1µçÁ÷'," + " `load2_curr` float NOT NULL DEFAULT '0' COMMENT '¸ºÔØ2µçÁ÷'," + " `load3_curr` float NOT NULL DEFAULT '0' COMMENT '¸ºÔØ3µçÁ÷'," + " `load4_curr` float NOT NULL DEFAULT '0' COMMENT '¸ºÔØ4µçÁ÷'," + " `model_online_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿éÔÚÏßÊý'," + " `model_limitcurr` float unsigned zerofill NOT NULL DEFAULT '000000000000' COMMENT 'Ä£¿éÏÞÁ÷µã'," + " `model_overvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é¹ýѹµã'," + " `energy_funct` int(11) NOT NULL DEFAULT '0' COMMENT '½ÚÄܹ¦ÄÜ'," + " `dormant_ratio` float NOT NULL DEFAULT '0' COMMENT 'ÐÝÃßϵÊý'," + " `awaken_ratio` float NOT NULL DEFAULT '0' COMMENT '»½ÐÑϵÊý'," + " `rotation_cycle` float NOT NULL DEFAULT '0' COMMENT 'ÂÖ»»ÖÜÆÚ'," + " `model_base` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é»ùÊý'," + " `energy_test` int(11) NOT NULL DEFAULT '0' COMMENT '½ÚÄܲâÊÔ'," + " `model_rated_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é¶î¶¨ÊýÁ¿'," + " `m1_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1ÔÚÏß״̬'," + " `m2_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2ÔÚÏß״̬'," + " `m3_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3ÔÚÏß״̬'," + " `m4_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4ÔÚÏß״̬'," + " `m5_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5ÔÚÏß״̬'," + " `m6_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6ÔÚÏß״̬'," + " `m7_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7ÔÚÏß״̬'," + " `m8_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8ÔÚÏß״̬'," + " `m9_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9ÔÚÏß״̬'," + " `m10_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10ÔÚÏß״̬'," + " `m11_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11ÔÚÏß״̬'," + " `m12_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12ÔÚÏß״̬'," + " `m13_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13ÔÚÏß״̬'," + " `m14_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14ÔÚÏß״̬'," + " `m15_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15ÔÚÏß״̬'," + " `m16_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16ÔÚÏß״̬'," + " `m17_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17ÔÚÏß״̬'," + " `m18_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18ÔÚÏß״̬'," + " `m19_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19ÔÚÏß״̬'," + " `m20_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20ÔÚÏß״̬'," + " `m21_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21ÔÚÏß״̬'," + " `m22_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22ÔÚÏß״̬'," + " `m23_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23ÔÚÏß״̬'," + " `m24_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24ÔÚÏß״̬'," + " `m25_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25ÔÚÏß״̬'," + " `m26_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26ÔÚÏß״̬'," + " `m27_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27ÔÚÏß״̬'," + " `m28_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28ÔÚÏß״̬'," + " `m29_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29ÔÚÏß״̬'," + " `m30_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30ÔÚÏß״̬'," + " `m31_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31ÔÚÏß״̬'," + " `m32_online_st` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32ÔÚÏß״̬'," + " `m1_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1Êä³öµçѹ'," + " `m2_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2Êä³öµçѹ'," + " `m3_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3Êä³öµçѹ'," + " `m4_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4Êä³öµçѹ'," + " `m5_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5Êä³öµçѹ'," + " `m6_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6Êä³öµçѹ'," + " `m7_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7Êä³öµçѹ'," + " `m8_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8Êä³öµçѹ'," + " `m9_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9Êä³öµçѹ'," + " `m10_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10Êä³öµçѹ'," + " `m11_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11Êä³öµçѹ'," + " `m12_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12Êä³öµçѹ'," + " `m13_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13Êä³öµçѹ'," + " `m14_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14Êä³öµçѹ'," + " `m15_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15Êä³öµçѹ'," + " `m16_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16Êä³öµçѹ'," + " `m17_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17Êä³öµçѹ'," + " `m18_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18Êä³öµçѹ'," + " `m19_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19Êä³öµçѹ'," + " `m20_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20Êä³öµçѹ'," + " `m21_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21Êä³öµçѹ'," + " `m22_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22Êä³öµçѹ'," + " `m23_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23Êä³öµçѹ'," + " `m24_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24Êä³öµçѹ'," + " `m25_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25Êä³öµçѹ'," + " `m26_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26Êä³öµçѹ'," + " `m27_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27Êä³öµçѹ'," + " `m28_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28Êä³öµçѹ'," + " `m29_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29Êä³öµçѹ'," + " `m30_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30Êä³öµçѹ'," + " `m31_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31Êä³öµçѹ'," + " `m32_outvol` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32Êä³öµçѹ'," + " `m1_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1·çÉÈ1תËÙ'," + " `m1_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1·çÉÈ2תËÙ'," + " `m2_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2·çÉÈ1תËÙ'," + " `m2_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2·çÉÈ2תËÙ'," + " `m3_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3·çÉÈ1תËÙ'," + " `m3_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3·çÉÈ2תËÙ'," + " `m4_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4·çÉÈ1תËÙ'," + " `m4_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4·çÉÈ2תËÙ'," + " `m5_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5·çÉÈ1תËÙ'," + " `m5_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5·çÉÈ2תËÙ'," + " `m6_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6·çÉÈ1תËÙ'," + " `m6_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6·çÉÈ2תËÙ'," + " `m7_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7·çÉÈ1תËÙ'," + " `m7_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7·çÉÈ2תËÙ'," + " `m8_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8·çÉÈ1תËÙ'," + " `m8_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8·çÉÈ2תËÙ'," + " `m9_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9·çÉÈ1תËÙ'," + " `m9_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9·çÉÈ2תËÙ'," + " `m10_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10·çÉÈ1תËÙ'," + " `m10_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10·çÉÈ2תËÙ'," + " `m11_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11·çÉÈ1תËÙ'," + " `m11_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11·çÉÈ2תËÙ'," + " `m12_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12·çÉÈ1תËÙ'," + " `m12_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12·çÉÈ2תËÙ'," + " `m13_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13·çÉÈ1תËÙ'," + " `m13_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13·çÉÈ2תËÙ'," + " `m14_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14·çÉÈ1תËÙ'," + " `m14_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14·çÉÈ2תËÙ'," + " `m15_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15·çÉÈ1תËÙ'," + " `m15_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15·çÉÈ2תËÙ'," + " `m16_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16·çÉÈ1תËÙ'," + " `m16_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16·çÉÈ2תËÙ'," + " `m17_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17·çÉÈ1תËÙ'," + " `m17_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17·çÉÈ2תËÙ'," + " `m18_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18·çÉÈ1תËÙ'," + " `m18_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18·çÉÈ2תËÙ'," + " `m19_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19·çÉÈ1תËÙ'," + " `m19_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19·çÉÈ2תËÙ'," + " `m20_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20·çÉÈ1תËÙ'," + " `m20_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20·çÉÈ2תËÙ'," + " `m21_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21·çÉÈ1תËÙ'," + " `m21_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21·çÉÈ2תËÙ'," + " `m22_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22·çÉÈ1תËÙ'," + " `m22_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22·çÉÈ2תËÙ'," + " `m23_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23·çÉÈ1תËÙ'," + " `m23_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23·çÉÈ2תËÙ'," + " `m24_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24·çÉÈ1תËÙ'," + " `m24_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24·çÉÈ2תËÙ'," + " `m25_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25·çÉÈ1תËÙ'," + " `m25_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25·çÉÈ2תËÙ'," + " `m26_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26·çÉÈ1תËÙ'," + " `m26_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26·çÉÈ2תËÙ'," + " `m27_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27·çÉÈ1תËÙ'," + " `m27_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27·çÉÈ2תËÙ'," + " `m28_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28·çÉÈ1תËÙ'," + " `m28_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28·çÉÈ2תËÙ'," + " `m29_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29·çÉÈ1תËÙ'," + " `m29_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29·çÉÈ2תËÙ'," + " `m30_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30·çÉÈ1תËÙ'," + " `m30_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30·çÉÈ2תËÙ'," + " `m31_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31·çÉÈ1תËÙ'," + " `m31_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31·çÉÈ2תËÙ'," + " `m32_fan1_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32·çÉÈ1תËÙ'," + " `m32_fan2_speed` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32·çÉÈ2תËÙ'," + " `m1_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1Ä£¿éζÈ'," + " `m2_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2Ä£¿éζÈ'," + " `m3_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3Ä£¿éζÈ'," + " `m4_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4Ä£¿éζÈ'," + " `m5_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5Ä£¿éζÈ'," + " `m6_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6Ä£¿éζÈ'," + " `m7_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7Ä£¿éζÈ'," + " `m8_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8Ä£¿éζÈ'," + " `m9_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9Ä£¿éζÈ'," + " `m10_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10Ä£¿éζÈ'," + " `m11_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11Ä£¿éζÈ'," + " `m12_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12Ä£¿éζÈ'," + " `m13_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13Ä£¿éζÈ'," + " `m14_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14Ä£¿éζÈ'," + " `m15_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15Ä£¿éζÈ'," + " `m16_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16Ä£¿éζÈ'," + " `m17_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17Ä£¿éζÈ'," + " `m18_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18Ä£¿éζÈ'," + " `m19_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19Ä£¿éζÈ'," + " `m20_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20Ä£¿éζÈ'," + " `m21_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21Ä£¿éζÈ'," + " `m22_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22Ä£¿éζÈ'," + " `m23_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23Ä£¿éζÈ'," + " `m24_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24Ä£¿éζÈ'," + " `m25_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25Ä£¿éζÈ'," + " `m26_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26Ä£¿éζÈ'," + " `m27_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27Ä£¿éζÈ'," + " `m28_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28Ä£¿éζÈ'," + " `m29_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29Ä£¿éζÈ'," + " `m30_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30Ä£¿éζÈ'," + " `m31_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31Ä£¿éζÈ'," + " `m32_model_temp` float NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32Ä£¿éζÈ'," + " `m1_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1ÕûÁ÷Æ÷¸æ¾¯'," + " `m2_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é2ÕûÁ÷Æ÷¸æ¾¯'," + " `m3_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é3ÕûÁ÷Æ÷¸æ¾¯'," + " `m4_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é4ÕûÁ÷Æ÷¸æ¾¯'," + " `m5_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é5ÕûÁ÷Æ÷¸æ¾¯'," + " `m6_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é6ÕûÁ÷Æ÷¸æ¾¯'," + " `m7_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é7ÕûÁ÷Æ÷¸æ¾¯'," + " `m8_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é8ÕûÁ÷Æ÷¸æ¾¯'," + " `m9_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é9ÕûÁ÷Æ÷¸æ¾¯'," + " `m10_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é10ÕûÁ÷Æ÷¸æ¾¯'," + " `m11_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é11ÕûÁ÷Æ÷¸æ¾¯'," + " `m12_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é12ÕûÁ÷Æ÷¸æ¾¯'," + " `m13_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é13ÕûÁ÷Æ÷¸æ¾¯'," + " `m14_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é14ÕûÁ÷Æ÷¸æ¾¯'," + " `m15_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é15ÕûÁ÷Æ÷¸æ¾¯'," + " `m16_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é16ÕûÁ÷Æ÷¸æ¾¯'," + " `m17_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é17ÕûÁ÷Æ÷¸æ¾¯'," + " `m18_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é18ÕûÁ÷Æ÷¸æ¾¯'," + " `m19_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é19ÕûÁ÷Æ÷¸æ¾¯'," + " `m20_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é20ÕûÁ÷Æ÷¸æ¾¯'," + " `m21_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é21ÕûÁ÷Æ÷¸æ¾¯'," + " `m22_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é22ÕûÁ÷Æ÷¸æ¾¯'," + " `m23_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é23ÕûÁ÷Æ÷¸æ¾¯'," + " `m24_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é24ÕûÁ÷Æ÷¸æ¾¯'," + " `m25_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25ÕûÁ÷Æ÷¸æ¾¯'," + " `m26_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é26ÕûÁ÷Æ÷¸æ¾¯'," + " `m27_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é27ÕûÁ÷Æ÷¸æ¾¯'," + " `m28_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é28ÕûÁ÷Æ÷¸æ¾¯'," + " `m29_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é29ÕûÁ÷Æ÷¸æ¾¯'," + " `m30_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é30ÕûÁ÷Æ÷¸æ¾¯'," + " `m31_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é31ÕûÁ÷Æ÷¸æ¾¯'," + " `m32_rectifier_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é32ÕûÁ÷Æ÷¸æ¾¯'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `idx_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£²âʵʱ״̬±í';" + ";"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); // res = null; // //ÐÂÔö×Ö¶ÎbattTestTimeLong1 // res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" // + " WHERE table_schema='db_ram_db'" // + " AND table_name='tb_dev6159_power_yc'" // + " AND column_name='battTestTimeLong1'"); // if(!res.next()){ // sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Dev6159_Power_Yc_Table // + " ADD COLUMN `battTestTimeLong1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø1²âÊÔʱ³¤';"); // } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£ÐÅʵʱ״̬±í * @param pool * @param recreate */ private static void createDev6159_Power_Yx_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Dev6159_Power_Yx_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Dev6159_Power_Yx_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¸üÐÂʱ¼ä'," + " `ac1_overvola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏà¹ýѹ-ACSWIB'," + " `ac1_undervola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàǷѹ-ACSWIB'," + " `ac1_lessvola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàȱÏà-ACSWIB'," + " `ac1_overvolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏà¹ýѹ-ACSWIB'," + " `ac1_undervolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàǷѹ-ACSWIB'," + " `ac1_lessvolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàȱÏà-ACSWIB'," + " `ac1_overvolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏà¹ýѹ-ACSWIB'," + " `ac1_undervolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàǷѹ-ACSWIB'," + " `ac1_lessvolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàȱÏà-ACSWIB'," + " `acin1_thunder_fault_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë1·ÀÀׯ÷¹ÊÕÏ-ACSWIB'," + " `ac2_overvola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏà¹ýѹ-ACSWIB'," + " `ac2_undervola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàǷѹ-ACSWIB'," + " `ac2_lessvola_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàȱÏà-ACSWIB'," + " `ac2_overvolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏà¹ýѹ-ACSWIB'," + " `ac2_undervolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàǷѹ-ACSWIB'," + " `ac2_lessvolb_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàȱÏà-ACSWIB'," + " `ac2_overvolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏà¹ýѹ-ACSWIB'," + " `ac2_undervolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàǷѹ-ACSWIB'," + " `ac2_lessvolc_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàȱÏà-ACSWIB'," + " `acin2_thunder_fault_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë2·ÀÀׯ÷¹ÊÕÏ-ACSWIB'," + " `ac_dev_temp_alm_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷Åäµç¹ñζȸ澯-ACSWIB'," + " `acin1_powerdown_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë1Í£µç-ACSWIB'," + " `acin2_powerdown_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë2Í£µç-ACSWIB'," + " `ac_monitorerr_fault_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷¼à¿Øµ¥Ôª¹ÊÕÏ-ACSWIB'," + " `acin1_trip_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷ÊäÈ뿪¹ØÌøÕ¢-ACSWIB'," + " `acin2_trip_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷ÊäÈ뿪¹ØÌøÕ¢-ACSWIB'," + " `fsw1_sw1trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '1¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø0-25ÌøÕ¢[bit0-¿ª¹Ø1 ... bit24 - ¿ª¹Ø25]-ACSWIB'," + " `fsw1_sw2trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '1¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø26-50ÌøÕ¢[bit0-¿ª¹Ø26 ... bit24 - ¿ª¹Ø50]-ACSWIB'," + " `fsw1_sw3trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '1¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø51-64ÌøÕ¢[bit0-¿ª¹Ø51 ... bit13 - ¿ª¹Ø64]-ACSWIB'," + " `fsw2_sw1trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '2¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø0-25ÌøÕ¢[bit0-¿ª¹Ø1 ... bit24 - ¿ª¹Ø25]-ACSWIB'," + " `fsw2_sw2trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '2¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø26-50ÌøÕ¢[bit0-¿ª¹Ø26 ... bit24 - ¿ª¹Ø50]-ACSWIB'," + " `fsw2_sw3trip_ac` int(11) NOT NULL DEFAULT '0' COMMENT '2¶Î½»Á÷ĸÏßÊä³ö¿ª¹Ø51-64ÌøÕ¢[bit0-¿ª¹Ø51 ... bit13 - ¿ª¹Ø64]-ACSWIB'," + " `ac_total_alm_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷Åäµç¹ñ×ܸ澯-ACSWIB'," + " `ac1_overvola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏà¹ýѹ-CPSS'," + " `ac1_undervola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàǷѹ-CPSS'," + " `ac1_lessvola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷AÏàȱÏà-CPSS'," + " `ac1_overvolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏà¹ýѹ-CPSS'," + " `ac1_undervolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàǷѹ-CPSS'," + " `ac1_lessvolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷BÏàȱÏà-CPSS'," + " `ac1_overvolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏà¹ýѹ-CPSS'," + " `ac1_undervolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàǷѹ-CPSS'," + " `ac1_lessvolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷CÏàȱÏà-CPSS'," + " `acin1_powerdown_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë1Í£µç-CPSS'," + " `acin1_thunder_fault_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë1·ÀÀׯ÷¹ÊÕÏ-CPSS'," + " `ac2_overvola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏà¹ýѹ-CPSS'," + " `ac2_undervola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàǷѹ-CPSS'," + " `ac2_lessvola_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷AÏàȱÏà-CPSS'," + " `ac2_overvolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏà¹ýѹ-CPSS'," + " `ac2_undervolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàǷѹ-CPSS'," + " `ac2_lessvolb_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷BÏàȱÏà-CPSS'," + " `ac2_overvolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏà¹ýѹ-CPSS'," + " `ac2_undervolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàǷѹ-CPSS'," + " `ac2_lessvolc_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷CÏàȱÏà-CPSS'," + " `acin2_powerdown_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë2Í£µç-CPSS'," + " `acin2_thunder_fault_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊäÈë2·ÀÀׯ÷¹ÊÕÏ-CPSS'," + " `monitorerr_fault_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '¼à¿Øµ¥Ôª¹ÊÕÏ-CPSS'," + " `dc_outvol_over_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³ö¹ýѹ-CPSS'," + " `dc_outvol_under_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Êä³öǷѹ-CPSS'," + " `batt_powerdown_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éϵ籣»¤¸æ¾¯-CPSS'," + " `mod_fault1_cpss` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1-25¹ÊÕÏ[bit0-Ä£¿é1... bit24-Ä£¿é25]-CPSS'," + " `mod_fault2_cpss` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25-32¹ÊÕÏ[bit0-Ä£¿é26... bit6-Ä£¿é32]-CPSS'," + " `mod_close1_cpss` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é1-25¹Ø»ú[bit0-Ä£¿é1... bit24-Ä£¿é25]-CPSS'," + " `mod_close2_cpss` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é25-32¹Ø»ú[bit0-Ä£¿é26... bit6-Ä£¿é32]-CPSS'," + " `acin1_trip_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·½»Á÷ÊäÈ뿪¹ØÌøÕ¢-CPSS'," + " `acin2_trip_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·½»Á÷ÊäÈ뿪¹ØÌøÕ¢-CPSS'," + " `dev_total_alm_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '¸ßƵ¿ª¹ØµçÔ´¹ñ×ܸ澯-CPSS'," + " `loader_fuse_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '¸ºÔØÈÛ˿״̬-CPSS'," + " `batt1_fuse_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1ÈÛË¿¸æ¾¯-CPSS'," + " `batt2_fuse_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2ÈÛË¿¸æ¾¯-CPSS'," + " `dcvol1_over_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·ֱÁ÷¹ýѹ-DCSWIB'," + " `dcvol1_under_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·ֱÁ÷Ƿѹ-DCSWIB'," + " `dcvol2_over_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·ֱÁ÷¹ýѹ-DCSWIB'," + " `dcvol2_under_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·ֱÁ÷Ƿѹ-DCSWIB'," + " `monitor_fault_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT '¼à¿Øµ¥Ôª¹ÊÕÏ-DCSWIB'," + " `dev_temp_alm_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Åäµç¹ñζȸ澯-DCSWIB'," + " `dcin1_swtrip_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ1·ÊäÈ뿪¹ØÌøÕ¢-DCSWIB'," + " `dcin2_swtrip_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µÚ2·ÊäÈ뿪¹ØÌøÕ¢-DCSWIB'," + " `fsw1_sw1_trip` int(11) NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷µÚ1-25·¿ª¹ØÌøÕ¢[bit0-µÚ1· ... bit24-µÚ25·]-DCSWIB'," + " `fsw1_sw2_trip` int(11) NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷µÚ26-50·¿ª¹ØÌøÕ¢[bit0-µÚ26· ... bit24-µÚ50·]-DCSWIB'," + " `fsw1_sw3_trip` int(11) NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷µÚ51-75·¿ª¹ØÌøÕ¢[bit0-µÚ51· ... bit24-µÚ75·]-DCSWIB'," + " `fsw1_sw4_trip` int(11) NOT NULL DEFAULT '0' COMMENT '1¶ÎÖ±Á÷µÚ76-100·¿ª¹ØÌøÕ¢[bit0-µÚ76· ... bit24-µÚ100·]-DCSWIB'," + " `fsw2_sw1_trip` int(11) NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷µÚ1-25·¿ª¹ØÌøÕ¢[bit0-µÚ1· ... bit24-µÚ25·]-DCSWIB'," + " `fsw2_sw2_trip` int(11) NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷µÚ26-50·¿ª¹ØÌøÕ¢[bit0-µÚ26· ... bit24-µÚ50·]-DCSWIB'," + " `fsw2_sw3_trip` int(11) NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷µÚ51-75·¿ª¹ØÌøÕ¢[bit0-µÚ51· ... bit24-µÚ75·]-DCSWIB'," + " `fsw2_sw4_trip` int(11) NOT NULL DEFAULT '0' COMMENT '2¶ÎÖ±Á÷µÚ76-100·¿ª¹ØÌøÕ¢[bit0-µÚ76· ... bit24-µÚ100·]-DCSWIB'," + " `dev_total_alm_dc` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷Åäµç¹ñ×ܸ澯-DCSWIB'," + " `power_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ͨÐŵçԴ״̬'," + " `acin1_thunder_switch_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½øÏß1·ÀÀׯ÷¿Õ¿ª×´Ì¬-ACSWIB'," + " `acin2_thunder_switch_ac` tinyint(4) NOT NULL DEFAULT '0' COMMENT '½øÏß2·ÀÀׯ÷¿Õ¿ª×´Ì¬-ACSWIB'," + " `batt_chardis_state_cpss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '³ä·Åµç״̬'," + " `k1_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K1״̬'," + " `k2_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'k2״̬'," + " `kb_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'KB״̬'," + " `kc_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'kc״̬[³£¿ª²»×öµãλÅжÏ]'," + " `kc1_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'kc1״̬'," + " `kd_state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '³£±Õ½Ó´¥Æ÷²»×öµãλÅжÏ'," + " `kd1_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'kd1״̬'," + " `kd2_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'kd2״̬'," + " `k11_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K11״̬'," + " `k12_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K12״̬'," + " `k13_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K13״̬'," + " `k14_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K14״̬'," + " `k15_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K16״̬'," + " `k16_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K16״̬'," + " `k17_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K17״̬'," + " `k18_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'K18״̬'," + " `batt_state` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×´Ì¬'," + " `load_powerdown_st` int(4) NOT NULL DEFAULT '0' COMMENT '¸ºÔØÒ»´Îϵç״̬'," + " `dk11_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK11 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk12_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK12 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk13_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK13 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk14_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK14 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk15_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK15 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk16_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK16 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk17_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK17 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + " `dk18_allow_ctl` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'DK18 ÊÇ·ñÔ¶³Ì¿ØÖÆ£¨0-Ô¶³Ì1-ÊÖ¶¯£©'," + "PRIMARY KEY (`num`)," + " UNIQUE KEY `idx_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ͨÐŵçÔ´ºËÈÝÒ»Ìå»úÒ£ÐÅʵʱ״̬±í';" + ";"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨µç²Ù¿ª¹ØÒ£²âʵʱ״̬±í * @param pool * @param recreate */ private static void createDEV60870_Inverter_Info(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.DEV60870_Inverter_Info; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.DEV60870_Inverter_Info + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '608700010' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `fanCurr` float NOT NULL DEFAULT '0' COMMENT '·çÉȵçÁ÷'," + " `heatPipesTmp` float NOT NULL DEFAULT '0' COMMENT '·¢ÈȹÜÄÚ²¿Î¶È'," + " `heatPipesOutTmp` float NOT NULL DEFAULT '0' COMMENT '·¢Èȹܳö·ç¿ÚζÈ'," + " `chargerOutputVol1` float NOT NULL DEFAULT '0' COMMENT '³äµç»ú1Êä³öµçѹ'," + " `chargerOutputCurr1` float NOT NULL DEFAULT '0' COMMENT '³äµç»ú1Êä³öµçÁ÷'," + " `battOutputVol1` float NOT NULL DEFAULT '0' COMMENT 'Ðîµç³Ø×é1Êä³öµçѹ'," + " `battOutputCurr1` float NOT NULL DEFAULT '0' COMMENT 'Ðîµç³Ø×é1Êä³öµçÁ÷'," + " `controlBusVol1` float NOT NULL DEFAULT '0' COMMENT 'µÚÒ»×é¿ØÖÆÄ¸Ïßµçѹ'," + " `chargerOutputVol2` float NOT NULL DEFAULT '0' COMMENT '³äµç»ú2Êä³öµçѹ'," + " `chargerOutputCurr2` float NOT NULL DEFAULT '0' COMMENT '³äµç»ú2Êä³öµçÁ÷'," + " `battOutputVol2` float NOT NULL DEFAULT '0' COMMENT 'Ðîµç³Ø×é2Êä³öµçѹ'," + " `battOutputCurr2` float NOT NULL DEFAULT '0' COMMENT 'Ðîµç³Ø×é2Êä³öµçÁ÷'," + " `controlBusVol2` float NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ×é¿ØÖÆÄ¸Ïßµçѹ'," + " `inverterAOutputVol` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öAÏàµçѹ'," + " `inverterAOutputCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öAÏàµçÁ÷'," + " `inverterAOutputFreq` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öAÏàÆµÂÊ'," + " `inverterAOutputBackCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öAÏà»ØÀ¡µçÁ÷'," + " `inverterBOutputVol` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öBÏàµçѹ'," + " `inverterBOutputCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öBÏàµçÁ÷'," + " `inverterBOutputFreq` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öBÏàÆµÂÊ'," + " `inverterBOutputBackCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öBÏà»ØÀ¡µçÁ÷'," + " `inverterCOutputVol` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öCÏàµçѹ'," + " `inverterCOutputCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öCÏàµçÁ÷'," + " `inverterCOutputFreq` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öCÏàÆµÂÊ'," + " `inverterCOutputBackCurr` float NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Êä³öCÏà»ØÀ¡µçÁ÷'," + " `battTestTimeLong1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø1²âÊÔʱ³¤'," + " `battTestTimeLong2` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø2²âÊÔʱ³¤'," + " `battTestCap1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1²âÊÔÈÝÁ¿'," + " `battTestCap2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2²âÊÔÈÝÁ¿'," + " `roomTemp1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1»·¾³Î¶È'," + " `roomTemp2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2»·¾³Î¶È'," + " `roomHumid1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1»·¾³Êª¶È'," + " `roomHumid2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2»·¾³Êª¶È'," + " `battRealCap1` float NOT NULL DEFAULT '0' COMMENT '×é1Ô¤¹Àʵ¼ÊÈÝÁ¿'," + " `battRealCap2` float NOT NULL DEFAULT '0' COMMENT '×é2Ô¤¹Àʵ¼ÊÈÝÁ¿'," + " `atresia` int(11) NOT NULL DEFAULT '0' COMMENT '±ÕËø×´Ì¬¡¾1£º±ÕËø£»0£ºÎ´±ÕËø¡¿'," + " `emergencyStop` int(11) NOT NULL DEFAULT '0' COMMENT '½ô¼±Í£Ö¹'," + " `poweroff` int(11) NOT NULL DEFAULT '0' COMMENT '»ú·¿Í£µç±êʶ'," + " `standState` int(11) NOT NULL DEFAULT '0' COMMENT '¾²ÖÃ״̬[0:ÎÞ£»1£º¾²ÖÃ]'," + " `standNum` int(11) NOT NULL DEFAULT '1' COMMENT '¾²ÖÃ×éºÅ[1:×é1;2-×é2]'," + " `standTime` int(11) NOT NULL DEFAULT '0' COMMENT '¾²ÖÃʱ¼ä(Ãë)[µ¹¼ÆÊ±]'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='µç²Ù¿ª¹ØÒ£²âʵʱ״̬±í';"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); res = null; //ÐÂÔö×Ö¶ÎbattTestTimeLong1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battTestTimeLong1'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battTestTimeLong1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø1²âÊÔʱ³¤';"); } res = null; //ÐÂÔö×Ö¶ÎbattTestTimeLong2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battTestTimeLong2'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battTestTimeLong2` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø2²âÊÔʱ³¤';"); } res = null; //ÐÂÔö×Ö¶ÎbattTestCap1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battTestCap1'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battTestCap1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1²âÊÔÈÝÁ¿';"); } res = null; //ÐÂÔö×Ö¶ÎbattTestCap2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battTestCap2'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battTestCap2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2²âÊÔÈÝÁ¿';"); } res = null; //ÐÂÔö×Ö¶ÎroomTemp1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='roomTemp1'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `roomTemp1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1»·¾³Î¶È';"); } res = null; //ÐÂÔö×Ö¶ÎroomTemp2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='roomTemp2'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `roomTemp2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2»·¾³Î¶È';"); } res = null; //ÐÂÔö×Ö¶ÎroomHumid1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='roomHumid1'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `roomHumid1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é1»·¾³Êª¶È';"); } res = null; //ÐÂÔö×Ö¶ÎroomHumid2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='roomHumid2'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `roomHumid2` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é2»·¾³Êª¶È';"); } res = null; //ÐÂÔö×Ö¶ÎbattRealCap1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battRealCap1'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battRealCap1` float NOT NULL DEFAULT '0' COMMENT '×é1Ô¤¹Àʵ¼ÊÈÝÁ¿';"); } res = null; //ÐÂÔö×Ö¶ÎbattRealCap2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='battRealCap2'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `battRealCap2` float NOT NULL DEFAULT '0' COMMENT '×é2Ô¤¹Àʵ¼ÊÈÝÁ¿';"); } res = null; //ÐÂÔö×Ö¶Îatresia res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='atresia'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `atresia` int(11) NOT NULL DEFAULT '0' COMMENT '±ÕËø×´Ì¬¡¾1£º±ÕËø£»0£ºÎ´±ÕËø¡¿';"); } res = null; //ÐÂÔö×Ö¶ÎemergencyStop res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='emergencyStop'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `emergencyStop` int(11) NOT NULL DEFAULT '0' COMMENT '½ô¼±Í£Ö¹';"); } res = null; //ÐÂÔö×Ö¶Îpoweroff res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='poweroff'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `poweroff` int(11) NOT NULL DEFAULT '0' COMMENT '»ú·¿Í£µç±êʶ';"); } res = null; //ÐÂÔö×Ö¶ÎstandState res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='standState'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `standState` int(11) NOT NULL DEFAULT '0' COMMENT '¾²ÖÃ״̬[0:ÎÞ£»1£º¾²ÖÃ]';"); } res = null; //ÐÂÔö×Ö¶ÎstandNum res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='standNum'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `standNum` int(11) NOT NULL DEFAULT '1' COMMENT '¾²ÖÃ×éºÅ[1:×é1;2-×é2]';"); } res = null; //ÐÂÔö×Ö¶ÎstandTime res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_dev_60870_inverter_info'" + " AND column_name='standTime'"); if(!res.next()){ sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DEV60870_Inverter_Info + " ADD COLUMN `standTime` int(11) NOT NULL DEFAULT '0' COMMENT '¾²ÖÃʱ¼ä(Ãë)[µ¹¼ÆÊ±]';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨µç²Ù¿ª¹ØÒ£ÐÅʵʱ״̬±í * @param pool * @param recreate */ private static void createDEV60870_Inverter_State(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.DEV60870_Inverter_State; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.DEV60870_Inverter_State + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '×ÔÔöÖ÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '608700010' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `aclose1` int(11) NOT NULL DEFAULT '0' COMMENT '1×é½»Á÷ʧµç'," + " `aclose2` int(11) NOT NULL DEFAULT '0' COMMENT '2×é½»Á÷ʧµç'," + " `yhMainTmpHigh` int(11) NOT NULL DEFAULT '0' COMMENT 'Ñø»¤ÒÇÖ÷»úζȸß'," + " `yhMainFault` int(11) NOT NULL DEFAULT '0' COMMENT 'Ñø»¤ÒÇÖ÷»ú¹ÊÕÏ'," + " `yhFromTmpHigh` int(11) NOT NULL DEFAULT '0' COMMENT 'Ñø»¤ÒÇ´Ó»úζȸß'," + " `yhFromFault` int(11) NOT NULL DEFAULT '0' COMMENT 'Ñø»¤ÒÇ´Ó»ú¹ÊÕÏ'," + " `commErrorFor104` int(11) NOT NULL DEFAULT '0' COMMENT '101/104ͨѶ¹ÊÕÏ'," + " `commErrorFor485_1` int(11) NOT NULL DEFAULT '0' COMMENT 'RS485ͨѶ¹ÊÕÏ1×é'," + " `commErrorFor485_2` int(11) NOT NULL DEFAULT '0' COMMENT 'RS485ͨѶ¹ÊÕÏ2×é'," + " `devTmpHigh` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ζȸß'," + " `byPassOpenA` int(11) NOT NULL DEFAULT '0' COMMENT 'A×éÅÔ·¿ª¿ª'," + " `byPassOpenB` int(11) NOT NULL DEFAULT '0' COMMENT 'B×éÅÔ·¿ª¿ª'," + " `disEquFault` int(11) NOT NULL DEFAULT '0' COMMENT '·ÅµçÉ豸¹ÊÕÏ'," + " `eleOperationSwitch1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù1¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch2` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù2¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch3` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù3¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch4` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù4¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch5` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù5¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch6` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù6¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch7` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù7¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch10` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù10¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch11` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù11¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch12` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù12¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch13` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù13¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch14` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù14¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch15` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù15¿ª¹Ø×´Ì¬'," + " `eleOperationSwitch16` int(11) NOT NULL DEFAULT '0' COMMENT 'µç²Ù16¿ª¹Ø×´Ì¬'," + " `dcContactor1` int(11) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷½Ó´¥Æ÷1'," + " `dcContactor2` int(11) NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷½Ó´¥Æ÷2'," + " `charState1` int(11) NOT NULL DEFAULT '0' COMMENT '1ºÅ³äµç»ú״̬'," + " `charState2` int(11) NOT NULL DEFAULT '0' COMMENT '2ºÅ³äµç»ú״̬'," + " `battState1` int(11) NOT NULL DEFAULT '0' COMMENT 'µÚÒ»×éÐîµç³Ø×´Ì¬'," + " `battState2` int(11) NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ×éÐîµç³Ø×´Ì¬'," + " `inverterStatusA` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷A¿ª¹Ø»ú״̬'," + " `inverterWorkWayA` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷A¹¤×÷·½Ê½'," + " `inverterFaulltA` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷AÉ豸¹ÊÕÏ״̬'," + " `inverterTmpAlmA` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Aζȱ¨¾¯'," + " `inverterStatusB` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷B¿ª¹Ø»ú״̬'," + " `inverterWorkWayB` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷B¹¤×÷·½Ê½'," + " `inverterFaulltB` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷BÉ豸¹ÊÕÏ״̬'," + " `inverterTmpAlmB` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Bζȱ¨¾¯'," + " `inverterStatusC` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷C¿ª¹Ø»ú״̬'," + " `inverterWorkWayC` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷C¹¤×÷·½Ê½'," + " `inverterFaulltC` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷CÉ豸¹ÊÕÏ״̬'," + " `inverterTmpAlmC` int(11) NOT NULL DEFAULT '0' COMMENT 'Äæ±äÆ÷Cζȱ¨¾¯'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='µç²Ù¿ª¹ØÒ£ÐÅʵʱ״̬±í';"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨²¢ÁªBTSÍØÆË״̬ÐÅÏ¢ * @param pool * @param recreate */ private static void createFBS9140_Topology_State(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9140_Topology_State; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9140_Topology_State + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `grouptotalnum` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é×ÜÊý'," + " `montotalnum` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå×ÜÊý'," + " `onlinevol` float NOT NULL DEFAULT '0' COMMENT 'ÔÚÏßµçѹ'," + " `accurrrindex` int(11) NOT NULL DEFAULT '0' COMMENT 'µ±Ç°ACÊäÈëË÷Òý[0-#1 1-#2]'," + " `acua_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷AÏàµçѹ'," + " `acub_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷BÏàµçѹ'," + " `acuc_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷CÏàµçѹ'," + " `acia_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷AÏàµçÁ÷'," + " `acib_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷BÏàµçÁ÷'," + " `acic_1` float NOT NULL DEFAULT '0' COMMENT '#1½»Á÷CÏàµçÁ÷'," + " `acua_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷AÏàµçѹ'," + " `acub_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷BÏàµçѹ'," + " `acuc_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷CÏàµçѹ'," + " `acia_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷AÏàµçÁ÷'," + " `acib_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷BÏàµçÁ÷'," + " `acic_2` float NOT NULL DEFAULT '0' COMMENT '#2½»Á÷CÏàµçÁ÷'," + " `mod_enable1` int(11) NOT NULL DEFAULT '0' COMMENT '×é1Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state1` int(11) NOT NULL DEFAULT '0' COMMENT '×é1µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol1` float NOT NULL DEFAULT '0' COMMENT '×é1Êä³öµçѹ'," + " `mod_outcurr1` float NOT NULL DEFAULT '0' COMMENT '×é1Êä³öµçÁ÷'," + " `mod_enable2` int(11) NOT NULL DEFAULT '0' COMMENT '×é2Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state2` int(11) NOT NULL DEFAULT '0' COMMENT '×é2µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol2` float NOT NULL DEFAULT '0' COMMENT '×é2Êä³öµçѹ'," + " `mod_outcurr2` float NOT NULL DEFAULT '0' COMMENT '×é2Êä³öµçÁ÷'," + " `mod_enable3` int(11) NOT NULL DEFAULT '0' COMMENT '×é3Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state3` int(11) NOT NULL DEFAULT '0' COMMENT '×é3µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol3` float NOT NULL DEFAULT '0' COMMENT '×é3Êä³öµçѹ'," + " `mod_outcurr3` float NOT NULL DEFAULT '0' COMMENT '×é3Êä³öµçÁ÷'," + " `mod_enable4` int(11) NOT NULL DEFAULT '0' COMMENT '×é4Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state4` int(11) NOT NULL DEFAULT '0' COMMENT '×é4µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol4` float NOT NULL DEFAULT '0' COMMENT '×é4Êä³öµçѹ'," + " `mod_outcurr4` float NOT NULL DEFAULT '0' COMMENT '×é4Êä³öµçÁ÷'," + " `mod_enable5` int(11) NOT NULL DEFAULT '0' COMMENT '×é5Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state5` int(11) NOT NULL DEFAULT '0' COMMENT '×é5Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `mod_outvol5` float NOT NULL DEFAULT '0' COMMENT '×é5Êä³öµçѹ'," + " `mod_outcurr5` float NOT NULL DEFAULT '0' COMMENT '×é5Êä³öµçÁ÷'," + " `mod_enable6` int(11) NOT NULL DEFAULT '0' COMMENT '×é6Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state6` int(11) NOT NULL DEFAULT '0' COMMENT '×é6µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol6` float NOT NULL DEFAULT '0' COMMENT '×é6Êä³öµçѹ'," + " `mod_outcurr6` float NOT NULL DEFAULT '0' COMMENT '×é6Êä³öµçÁ÷'," + " `mod_enable7` int(11) NOT NULL DEFAULT '0' COMMENT '×é7Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state7` int(11) NOT NULL DEFAULT '0' COMMENT '×é7µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol7` float NOT NULL DEFAULT '0' COMMENT '×é7Êä³öµçѹ'," + " `mod_outcurr7` float NOT NULL DEFAULT '0' COMMENT '×é7Êä³öµçÁ÷'," + " `mod_enable8` int(11) NOT NULL DEFAULT '0' COMMENT '×é8Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state8` int(11) NOT NULL DEFAULT '0' COMMENT '×é8µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol8` float NOT NULL DEFAULT '0' COMMENT '×é8Êä³öµçѹ'," + " `mod_outcurr8` float NOT NULL DEFAULT '0' COMMENT '×é8Êä³öµçÁ÷'," + " `mod_enable9` int(11) NOT NULL DEFAULT '0' COMMENT '×é9Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state9` int(11) NOT NULL DEFAULT '0' COMMENT '×é9µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol9` float NOT NULL DEFAULT '0' COMMENT '×é9Êä³öµçѹ'," + " `mod_outcurr9` float NOT NULL DEFAULT '0' COMMENT '×é9Êä³öµçÁ÷'," + " `mod_enable10` int(11) NOT NULL DEFAULT '0' COMMENT '×é10Ä£¿éʹÄÜ״̬[0-¶Ï¿ª 1-±ÕºÏ]'," + " `batt_state10` int(11) NOT NULL DEFAULT '0' COMMENT '×é10µç³Ø×´Ì¬[0:¸¡³ä 1£º¾ù³ä 2£º¹©µç 3£ººËÈÝ 4£ºÎ²³ä]'," + " `mod_outvol10` float NOT NULL DEFAULT '0' COMMENT '×é10Êä³öµçѹ'," + " `mod_outcurr10` float NOT NULL DEFAULT '0' COMMENT '×é10Êä³öµçÁ÷'," + " `total_vol` float NOT NULL DEFAULT '0' COMMENT '×ܵçѹ'," + " `total_curr` float NOT NULL DEFAULT '0' COMMENT '×ܵçÁ÷'," + " `sys_flag` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ϵͳÐͺÅ0:48Vϵͳ 1£º220Vϵͳ'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='²¢ÁªBTSÍØÆË״̬ÐÅÏ¢'; "; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ótotal_vol ×ܵçѹ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9140_topology_state'" + " AND column_name='total_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9140_Topology_State + " ADD COLUMN `total_vol` float NOT NULL DEFAULT '0' COMMENT '×ܵçѹ';"); } res = null; //Ìí¼Ótotal_curr ×ܵçÁ÷ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9140_topology_state'" + " AND column_name='total_curr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9140_Topology_State + " ADD COLUMN `total_curr` float NOT NULL DEFAULT '0' COMMENT '×ܵçÁ÷';"); } res = null; //Ìí¼Ósys_flag É豸ϵͳÐͺŠres = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9140_topology_state'" + " AND column_name='sys_flag'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9140_Topology_State + " ADD COLUMN `sys_flag` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ϵͳÐͺÅ0:48Vϵͳ 1£º220Vϵͳ';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨²¢ÁªBTSÍØÆË״̬ÐÅÏ¢ * @param pool * @param recreate */ private static void createFBS9149_SetParam(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9149_SetParam; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9149_SetParam + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'É豸Id'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî×Ö¶Î'," + " `test_cmd` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÀàÐÍ'," + " `groupnum` int(11) NOT NULL DEFAULT '0' COMMENT '×éºÅ0-×é1 1-×é2 2-×é3 3-×é4...'," + " `paramtype` int(11) NOT NULL DEFAULT '0' COMMENT '²ÎÊýÀàÐÍ£¬0-ʵʱºËÈݲÎÊý 1-¼Æ»®ºËÈݲÎÊý 2-»î»¯²ÎÊý 3-³äµç²ÎÊý'," + " `battauto` int(11) NOT NULL DEFAULT '0' COMMENT '0-×Ô¶¯ 1-ÊÖ¶¯ µç³Ø¹ÜÀí·½Ê½'," + " `timerchargeable` int(11) NOT NULL DEFAULT '0' COMMENT '0-¿ªÆô 1-¹Ø±Õ ¶¨Ê±¾ù³ä¹¦ÄÜ'," + " `battnominalcap` int(11) NOT NULL DEFAULT '0' COMMENT '50-200Ah µç³Ø±ê³ÆÈÝÁ¿ '," + " `battfloatvol` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø¸¡³äµçѹ'," + " `battchargevol` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø¾ù³äµçѹ'," + " `battchargecurr1` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø³äµçÏÞÁ÷'," + " `battchargecurr2` float NOT NULL DEFAULT '0' COMMENT '¸¡³äת¾ù³äµçÁ÷'," + " `battchargecurr3` float NOT NULL DEFAULT '0' COMMENT '¾ù³äת¸¡³äµçÁ÷'," + " `tailcurrchargetime` int(11) NOT NULL DEFAULT '0' COMMENT '0-5H βµçÁ÷³äµçʱ¼ä'," + " `timerchargeperiod` int(11) NOT NULL DEFAULT '0' COMMENT '30-180Ìì ¶¨Ê±¾ù³äÖÜÆÚ'," + " `maxchargetimehour` int(11) NOT NULL DEFAULT '0' COMMENT '×¾ù³äʱ¼ä'," + " `tempcompensatedable` int(11) NOT NULL DEFAULT '0' COMMENT '0-¿ªÆô 1-¹Ø±Õ ζȲ¹³¥¿ª¹Ø'," + " `batthightemp` int(11) NOT NULL DEFAULT '0' COMMENT '20-80¡æ µç³Ø¹ýεã'," + " `battlowtemp` int(11) NOT NULL DEFAULT '0' COMMENT '-40-10¡æ µç³ØÇ·Îµã'," + " `compensatedtemp` int(11) NOT NULL DEFAULT '0' COMMENT '10-40¡æ β¹ÖÐÐĵã'," + " `tempcompensatedcoe` int(11) NOT NULL DEFAULT '0' COMMENT '0-50mV/¡æ β¹ÏµÊý'," + " `battdischargelowvol` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø·ÅµçÖÕÖ¹µçѹ'," + " `mondischargelowvol` float NOT NULL DEFAULT '0' COMMENT 'µ¥½Ú·ÅµçÖÕÖ¹µçѹ'," + " `localremoteset` int(11) NOT NULL DEFAULT '0' COMMENT '±¾µØÔ¶³ÌÉèÖà 0-Ô¶³Ì 1-±¾µØ'," + " `battchrgctrl` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø³äµç¿ØÖÆ 0-¿ªÆô 1-¹Ø±Õ '," + " `battdisctrl` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø·Åµç¿ØÖÆ 0-¿ªÆô 1-¹Ø±Õ '," + " `herongcurr` float NOT NULL DEFAULT '0' COMMENT 'ºËÈÝÏÞÁ÷ 0.1C-0.5C '," + " `herongtimehour` int(11) NOT NULL DEFAULT '0' COMMENT 'ºËÈÝʱÏÞ'," + " `monvollow` float NOT NULL DEFAULT '0' COMMENT 'ÄÚ²¿µ¥ÌåÏÂÏÞÖµ[1.6-13.6]'," + " PRIMARY KEY (`num`)," + " KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='²¢ÁªµçÔ´9×é²ÎÊý±í';; "; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨É½Î÷´¢ÄÜÉ豸ʵʱ״̬±í * @param pool * @param recreate */ private static void createTB_Batt_Gtstate_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.TB_Batt_Gtstate_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.TB_Batt_Gtstate_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éID'," + " `record_timed` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `battState` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×´Ì¬[1³äµç£»2·Åµç£»3¿ªÂ·£»4¹ÊÕÏ]'," + " `sumVol` float NOT NULL DEFAULT '0' COMMENT '×ܵçѹ'," + " `battCurr` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éµçÁ÷'," + " `battSoc` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éSoc'," + " `battSoh` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éSoh'," + " `maxCharCurr` float NOT NULL DEFAULT '0' COMMENT '×î´ó³äµçµçÁ÷'," + " `maxDiscCurr` float NOT NULL DEFAULT '0' COMMENT '×î´ó·ÅµçµçÁ÷'," + " `diState` int(11) NOT NULL DEFAULT '0' COMMENT 'DI״̬'," + " `doState` int(11) NOT NULL DEFAULT '0' COMMENT 'DO״̬'," + " `battAlm0` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×鏿¾¯'," + " `battAlm1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×鏿¾¯1'," + " `battfault0` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é¹ÊÕÏ0'," + " `battfault1` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é¹ÊÕÏ1'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_battgroupid` (`BattGroupId`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨Ô¶³ÌÖØÆô×°ÖÃ״̬ÐÅÏ¢±í * @param pool * @param recreate */ private static void createTB_Dev61851_State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.TB_Dev61851_State_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.TB_Dev61851_State_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¸üÐÂʱ¼ä'," + " `dev_version` varchar(255) NOT NULL DEFAULT '' COMMENT '°æ±¾ºÅ'," + " `temp_JCQ1` float NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷1ζÈ'," + " `temp_JCQ2` float NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷2ζÈ'," + " `temp_JCQ3` float NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷3ζÈ'," + " `temp_Env` float NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È'," + " `current1` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷1'," + " `currentDir1` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷1·½Ïò'," + " `current2` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷2'," + " `currentDir2` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷2·½Ïò'," + " `current3` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷3'," + " `currentDir3` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷3·½Ïò'," + " `vol_Power_V1` float NOT NULL DEFAULT '0' COMMENT 'µçÔ´µçѹV1'," + " `vol_Power_V2` float NOT NULL DEFAULT '0' COMMENT 'µçÔ´µçѹV2'," + " `vol_Vkdz` float NOT NULL DEFAULT '0' COMMENT '×ܽøÏßµçѹ'," + " `vol_Vkdz_Out` float NOT NULL DEFAULT '0' COMMENT '×ܿؿª³öµçѹ'," + " `vol_Vk1` float NOT NULL DEFAULT '0' COMMENT '³öÏß1µçѹ'," + " `vol_Vk1_Out` float NOT NULL DEFAULT '0' COMMENT '֧·1³öµçѹ'," + " `vol_Vk2` float NOT NULL DEFAULT '0' COMMENT '³öÏß2µçѹ'," + " `vol_Vk2_Out` float NOT NULL DEFAULT '0' COMMENT '֧·2³öµçѹ'," + " `vol_Vk3` float NOT NULL DEFAULT '0' COMMENT '³öÏß3µçѹ'," + " `vol_Vk3_Out` float NOT NULL DEFAULT '0' COMMENT '֧·3³öµçѹ'," + " `km_State1` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷1״̬'," + " `km_State2` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷2״̬'," + " `km_State3` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷3״̬'," + " `kmz_State` int(11) NOT NULL DEFAULT '0' COMMENT '×ܿտª×´Ì¬'," + " `kd_State1` int(11) NOT NULL DEFAULT '0' COMMENT '֧·¿ª¹Ø1״̬'," + " `kd_State2` int(11) NOT NULL DEFAULT '0' COMMENT '֧·¿ª¹Ø2״̬'," + " `kd_State3` int(11) NOT NULL DEFAULT '0' COMMENT '֧·¿ª¹Ø3״̬'," + " `kd_ByPass_State1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·¿ª¹Ø1״̬'," + " `kd_ByPass_State2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·¿ª¹Ø2״̬'," + " `kd_ByPass_State3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·¿ª¹Ø3״̬'," + " `alarm_TempEnv_High` int(11) NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶ȹý¸ß'," + " `alarm_TempJCQ_High1` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷1ζȹý¸ß'," + " `alarm_TempJCQ_High2` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷2ζȹý¸ß'," + " `alarm_TempJCQ_High3` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷3ζȹý¸ß'," + " `alarm_KDZ_Break` int(11) NOT NULL DEFAULT '0' COMMENT '×ܿտª¶Ï¿ª'," + " `alarm_KD_Break1` int(11) NOT NULL DEFAULT '0' COMMENT '֧·1¿Õ¿ª¶Ï¿ª'," + " `alarm_KD_Break2` int(11) NOT NULL DEFAULT '0' COMMENT '֧·2¿Õ¿ª¶Ï¿ª'," + " `alarm_KD_Break3` int(11) NOT NULL DEFAULT '0' COMMENT '֧·3¿Õ¿ª¶Ï¿ª'," + " `alarm_KD_BP_Connect1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·1¿Õ¿ª±ÕºÏ'," + " `alarm_KD_BP_Connect2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·2¿Õ¿ª±ÕºÏ'," + " `alarm_KD_BP_Connect3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÅÔ·3¿Õ¿ª±ÕºÏ'," + " `alarm_CURR_ZL_High1` int(11) NOT NULL DEFAULT '0' COMMENT '֧·1µçÁ÷¹ý¸ß'," + " `alarm_CURR_ZL_High2` int(11) NOT NULL DEFAULT '0' COMMENT '֧·2µçÁ÷¹ý¸ß'," + " `alarm_CURR_ZL_High3` int(11) NOT NULL DEFAULT '0' COMMENT '֧·3µçÁ÷¹ý¸ß'," + " PRIMARY KEY (`num`)," + " KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Ô¶³ÌÖØÆô×°ÖÃʵʱ״̬ÐÅÏ¢±í';"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } private static void createTb_ess3100_pcs_state(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_ess3100_pcs_state; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_ess3100_pcs_state + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `acUa` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàµçѹ'," + " `acUb` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàµçѹ'," + " `acUc` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàµçѹ'," + " `acIa` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàµçÁ÷'," + " `acIb` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàµçÁ÷'," + " `acIc` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàµçÁ÷'," + " `acActPower` float NOT NULL DEFAULT '0' COMMENT '½»Á÷Óй¦¹¦ÂÊ'," + " `acReaPower` float NOT NULL DEFAULT '0' COMMENT '½»Á÷ÎÞ¹¦¹¦ÂÊ'," + " `acAppPower` float NOT NULL DEFAULT '0' COMMENT '½»Á÷ÊÓÔÚ¹¦ÂÊ'," + " `acFreq` float NOT NULL DEFAULT '0' COMMENT '½»Á÷ƵÂÊ'," + " `powerFact` float NOT NULL DEFAULT '0' COMMENT '¹¦ÂÊÒòÊý'," + " `macInsTmp` float NOT NULL DEFAULT '0' COMMENT '»úÄÚζÈ'," + " `maxFlowCharPower` float NOT NULL DEFAULT '0' COMMENT 'ϵͳ×î´óÔÊÐí³äµç¹¦ÂÊ'," + " `maxFlowDiscPower` float NOT NULL DEFAULT '0' COMMENT 'ϵͳ×î´óÔÊÐí·Åµç¹¦ÂÊ'," + " `dcVol1` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ1'," + " `dcCurr1` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçÁ÷1'," + " `dcPower1` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷¹¦ÂÊ1'," + " `dcVol2` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ2'," + " `dcCurr2` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçÁ÷2'," + " `dcPower2` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷¹¦ÂÊ2'," + " `dcVol3` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ3'," + " `dcCurr3` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçÁ÷3'," + " `dcPower3` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷¹¦ÂÊ3'," + " `dcVol4` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçѹ4'," + " `dcCurr4` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷µçÁ÷4'," + " `dcPower4` float NOT NULL DEFAULT '0' COMMENT 'Ö±Á÷¹¦ÂÊ4'," + " `dcAC1DevRun` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC1É豸ÔËÐÐ״̬×Ö'," + " `dcAC1CompFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC1ϵͳ×ۺϹÊÕÏ×Ö'," + " `dcAC1EnvirFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC1ϵͳ»·¾³¹ÊÕÏ×Ö'," + " `dcAC1HardFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC1ϵͳӲ¼þ¹ÊÕÏ×Ö'," + " `dcAC1TmpFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC1ϵͳζȹÊÕÏ×Ö'," + " `dcAC2DevRun` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC2É豸ÔËÐÐ״̬×Ö'," + " `dcAC2CompFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC2ϵͳ×ۺϹÊÕÏ×Ö'," + " `dcAC2EnvirFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC2ϵͳ»·¾³¹ÊÕÏ×Ö'," + " `dcAC2HardFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC2ϵͳӲ¼þ¹ÊÕÏ×Ö'," + " `dcAC2TmpFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC2ϵͳζȹÊÕÏ×Ö'," + " `dcAC3DevRun` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC3É豸ÔËÐÐ״̬×Ö'," + " `dcAC3CompFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC3ϵͳ×ۺϹÊÕÏ×Ö'," + " `dcAC3EnvirFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC3ϵͳ»·¾³¹ÊÕÏ×Ö'," + " `dcAC3HardFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC3ϵͳӲ¼þ¹ÊÕÏ×Ö'," + " `dcAC3TmpFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC3ϵͳζȹÊÕÏ×Ö'," + " `dcAC4DevRun` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC4É豸ÔËÐÐ״̬×Ö'," + " `dcAC4CompFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC4ϵͳ×ۺϹÊÕÏ×Ö'," + " `dcAC4EnvirFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC4ϵͳ»·¾³¹ÊÕÏ×Ö'," + " `dcAC4HardFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC4ϵͳӲ¼þ¹ÊÕÏ×Ö'," + " `dcAC4TmpFault` int(11) NOT NULL DEFAULT '0' COMMENT 'DCAC4ϵͳζȹÊÕÏ×Ö'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //³õʼ»¯Ä¬ÈÏÊý¾Ý res = sql.sqlMysqlQuery("SELECT COUNT(*) num FROM db_ram_db.tb_ess3100_pcs_state;"); if(false != res.next()) { int num = res.getInt("num"); if(num==0){ //³õʼ»¯Êý¾Ý sql.sqlMysqlExecute("INSERT INTO db_ram_db.`tb_ess3100_pcs_state` VALUES " + "('1', '310000001', '2021-11-27 11:40:58', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '3276.8', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');"); }else{ // System.out.println("db_ram_db.tb_ess3100_pcs_state ÓÐ Num ÌõÊý¾Ý "+num); } } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } private static void createTb_ess3100_sysstate(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_ess3100_sysstate; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_ess3100_sysstate + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '1' COMMENT 'É豸id'," + " `sysState` int(11) NOT NULL DEFAULT '1' COMMENT 'ϵͳ¹¤×÷״̬1:Í£»ú£»2×Լ죻3ÔËÐУ»4£ºÔ¤Áô£»5£º¹ÊÕÏ'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `workModel` int(11) NOT NULL DEFAULT '1' COMMENT 'ϵͳ¹¤×÷ģʽ1£ºÀëÍøÄ£Ê½£»2£ºP/Qģʽ£»3£º×Ô¶¯ÔËÐÐģʽ'," + " `activePowerLimitDis` int(11) NOT NULL DEFAULT '0' COMMENT '·ÅµçÓй¦¹¦ÂÊÏÞÖµ'," + " `activePowerLimitChar` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçÓй¦¹¦ÂÊÏÞÖµ'," + " `acUa` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàµçѹ'," + " `acUb` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàµçѹ'," + " `acUc` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàµçѹ'," + " `acIa` float NOT NULL DEFAULT '0' COMMENT '½»Á÷AÏàµçÁ÷'," + " `acIb` float NOT NULL DEFAULT '0' COMMENT '½»Á÷BÏàµçÁ÷'," + " `acIc` float NOT NULL DEFAULT '0' COMMENT '½»Á÷CÏàµçÁ÷'," + " `sysActivePowerSum` float NOT NULL DEFAULT '0' COMMENT 'ϵͳµ±Ç°Óй¦¹¦ÂʺÍ'," + " `sysReactivePowerSum` float NOT NULL DEFAULT '0' COMMENT 'ϵͳµ±Ç°ÎÞ¹¦ÂʺÍ'," + " `sysSoc` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳSOC'," + " `runPCSMode` float NOT NULL DEFAULT '0' COMMENT 'ÔËÐÐPCSÄ£¿éÊý'," + " `parkPower` float NOT NULL DEFAULT '0' COMMENT 'Ô°Çø¹¦ÂÊ'," + " `pcsState1` int(11) NOT NULL DEFAULT '0' COMMENT 'PCSÄ£¿é1״̬'," + " `pcsState2` int(11) NOT NULL DEFAULT '0' COMMENT 'PCSÄ£¿é2״̬'," + " `pcsState3` int(11) NOT NULL DEFAULT '0' COMMENT 'PCSÄ£¿é3״̬'," + " `pcsState4` int(11) NOT NULL DEFAULT '0' COMMENT 'PCSÄ£¿é4״̬'," + " `sysAlm0` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¸æ¾¯ÐÅÏ¢0'," + " `sysAlm1` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¸æ¾¯ÐÅÏ¢1'," + " `sysAlm2` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¸æ¾¯ÐÅÏ¢2'," + " `sysAlm3` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¸æ¾¯ÐÅÏ¢3'," + " `sysFault0` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¹ÊÕÏÐÅÏ¢0'," + " `sysFault1` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ¹ÊÕÏÐÅÏ¢1'," + " `pcsWareTmp` float NOT NULL DEFAULT '0' COMMENT 'PCS²Ö»·¾³Î¶È'," + " `battWareTmp` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø²Ö»·¾³Î¶È'," + " `containWareTmp` float NOT NULL DEFAULT '0' COMMENT '¼¯×°ÏäÍâ»·¾³Î¶È'," + " `battWateHum` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø²Ö»·¾³Êª¶È'," + " `pcsWateHum` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS²Ö»·¾³Êª¶È'," + " `containWateHum` int(11) NOT NULL DEFAULT '0' COMMENT '¼¯×°Ïä»·¾³Êª¶È'," + " `airCondState1` int(11) NOT NULL DEFAULT '0' COMMENT '¿Õµ÷״̬1'," + " `airCondState2` int(11) NOT NULL DEFAULT '0' COMMENT '¿Õµ÷״̬2'," + " `sys_year` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼ä-Äê'," + " `sys_month` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼ä-ÔÂ'," + " `sys_day` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼ä-ÈÕ'," + " `sys_hour` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼äʱ'," + " `sys_minte` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼ä-·Ö'," + " `sys_second` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳʱ¼ä-Ãë'," + " `auxPowerEle_ref` int(11) NOT NULL DEFAULT '0' COMMENT '¸¨Öú¹©µç-ÊäÈëÓ馵çÄܲο¼Öµ'," + " `auxPowerEle_real` int(11) NOT NULL DEFAULT '0' COMMENT '¸¨Öú¹©µç-ÊäÈëÓ馵çÄÜʵ¼ÊÖµ'," + " `pcsUIChanges` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS UI±ä±È'," + " `pcsPQChanges` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS PQ±ä±È'," + " `pcsUa` float NOT NULL DEFAULT '0' COMMENT 'PCSÏàµçѹUa'," + " `pcsUb` float NOT NULL DEFAULT '0' COMMENT 'PCSÏàµçѹUb'," + " `pcsUc` float NOT NULL DEFAULT '0' COMMENT 'PCSÏàµçѹUc'," + " `pcsUab` float NOT NULL DEFAULT '0' COMMENT 'PCSÏßµçѹUab'," + " `pcsUbc` float NOT NULL DEFAULT '0' COMMENT 'PCSÏßµçѹUbc'," + " `pcsUca` float NOT NULL DEFAULT '0' COMMENT 'PCSÏßµçѹUca'," + " `pcsIa` float NOT NULL DEFAULT '0' COMMENT 'PCSµçÁ÷Ia'," + " `pcsIb` float NOT NULL DEFAULT '0' COMMENT 'PCSµçÁ÷Ib'," + " `pcsIc` float NOT NULL DEFAULT '0' COMMENT 'PCSµçÁ÷Ic'," + " `pcsAActPower` float NOT NULL DEFAULT '0' COMMENT 'PCS AÏàÓй¦¹¦ÂÊ'," + " `pcsBActPower` float NOT NULL DEFAULT '0' COMMENT 'PCS BÏàÓй¦¹¦ÂÊ'," + " `pcsCActPower` float NOT NULL DEFAULT '0' COMMENT 'PCS CÏàÓй¦¹¦ÂÊ'," + " `pcsSumActPower` float NOT NULL DEFAULT '0' COMMENT 'PCS ×ÜÓй¦¹¦ÂÊ'," + " `pcsAReaPower` float NOT NULL DEFAULT '0' COMMENT 'PCS AÏàÎÞ¹¦¹¦ÂÊ'," + " `pcsBReaPower` float NOT NULL DEFAULT '0' COMMENT 'PCS BÏàÎÞ¹¦¹¦ÂÊ'," + " `pcsCReaPower` float NOT NULL DEFAULT '0' COMMENT 'PCS CÏàÎÞ¹¦¹¦ÂÊ'," + " `pcsSumReaPower` float NOT NULL DEFAULT '0' COMMENT 'PCS ×ÜÎÞ¹¦¹¦ÂÊ'," + " `pcsApowerFact` float NOT NULL DEFAULT '0' COMMENT 'PCS AÏ๦ÂÊÒòÊý'," + " `pcsBpowerFact` float NOT NULL DEFAULT '0' COMMENT 'PCS BÏ๦ÂÊÒòÊý'," + " `pcsCpowerFact` float NOT NULL DEFAULT '0' COMMENT 'PCS CÏ๦ÂÊÒòÊý'," + " `pcsSumpowerFact` float NOT NULL DEFAULT '0' COMMENT '×ܹ¦ÂÊÒòÊý'," + " `pcsAAppPower` float NOT NULL DEFAULT '0' COMMENT 'PCS AÏàÊÓÔÚ¹¦ÂÊ'," + " `pcsBAppPower` float NOT NULL DEFAULT '0' COMMENT 'PCS BÏàÊÓÔÚ¹¦ÂÊ'," + " `pcsCAppPower` float NOT NULL DEFAULT '0' COMMENT 'PCS CÏàÊÓÔÚ¹¦ÂÊ'," + " `pcsSumAppPower` float NOT NULL DEFAULT '0' COMMENT 'PCS ×ÜÊÓÔÚ¹¦ÂÊ'," + " `pcsFreq` float NOT NULL DEFAULT '0' COMMENT 'PCS ƵÂÊ'," + " `pcsInActPower_ref` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ÊäÈëÓ馵çÄÜ'," + " `pcsOutActPower_ref` int(11) NOT NULL DEFAULT '0' COMMENT 'PCSÊä³öÓ馵çÄÜ'," + " `pcsPerReaPower_ref` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ¸ÐÐÔÎÞ¹¦µçÄÜ'," + " `pcsCapReaPower_ref` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ÈÝÐÔÎÞ¹¦¹¦ÂÊ'," + " `pcsInActPower_real` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ÊäÈëÓ馵çÄÜʵ¼ÊÖµ'," + " `pcsOutActPower_real` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS Êä³öÓ馵çÄÜʵ¼ÊÖµ'," + " `pcsPerReaPower_real` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ¸ÐÐÔÎÞ¹¦µçÄÜʵ¼ÊÖµ'," + " `pcsCapReaPower_real` int(11) NOT NULL DEFAULT '0' COMMENT 'PCS ÈÝÐÔÎÞ¹¦¹¦ÂÊʵ¼ÊÖµ'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //³õʼ»¯Ä¬ÈÏÊý¾Ý res = sql.sqlMysqlQuery("SELECT COUNT(*) num FROM db_ram_db.tb_ess3100_sysstate;"); if(false != res.next()) { int num = res.getInt("num"); if(num==0){ //³õʼ»¯Êý¾Ý sql.sqlMysqlExecute("INSERT INTO db_ram_db.`tb_ess3100_sysstate` VALUES " + "('1', '310000001', '1', '2021-11-27 11:40:59', '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '77', '0', '0', '0', '0', '0', '0', '0', '0', '32', '0', '0', '0', '7.3', '11.6', '7.6', '0', '0', '0', '0', '1', '2021', '11', '27', '11', '42', '50', '18709', '0', '771', '1536', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '100', '100', '100', '100', '0', '0', '0', '0', '0', '35184', '32512', '52192', '5120', '23945', '38336', '1244', '9219');"); }else{ // System.out.println("db_ram_db.tb_ess3100_sysstate ÓÐ Num ÌõÊý¾Ý "+num); } } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * * @Title: createTb_li9130_setparam_plan * @Description: * @param pool * @param recreate * @author author * @date 2021Äê9ÔÂ24ÈÕ */ private static void createTb_li9130_setparam_plan(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_li9130_setparam_plan; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_li9130_setparam_plan + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éID'," + " `test_type` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÀàÐÍ'," + " `test_starttime` time NOT NULL DEFAULT '00:00:00' COMMENT '¿ªÊ¼Ê±¼ä'," + " `test_stoptime` time NOT NULL DEFAULT '00:00:00' COMMENT 'ֹͣʱ¼ä'," + " `is_startup` int(11) NOT NULL DEFAULT '0' COMMENT 'ÊÇ·ñÆôÓÃ'," + " `HourRate` int(11) NOT NULL DEFAULT '0' COMMENT 'СʱÂÊ'," + " `DisCurr` float NOT NULL DEFAULT '0' COMMENT '·ÅµçµçÁ÷'," + " `DisCap` float NOT NULL DEFAULT '0' COMMENT '·ÅµçÈÝÁ¿'," + " `DisTime` int(11) NOT NULL DEFAULT '0' COMMENT '·Åµçʱ³¤'," + " `GroupVol_LOW` float NOT NULL DEFAULT '0' COMMENT '×é¶ËµçѹÏÂÏÞ'," + " `MonomerVol_LOW` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÏÂÏÞ'," + " `MonomerLowCount` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÏÂÏÞÊýÁ¿'," + " `BattGroupNum` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é±àºÅ'," + " `OnlineVolLowAction` int(11) NOT NULL DEFAULT '0' COMMENT 'ÔÚÏßµçѹµÍ´¦Àí'," + " `DCVolHighLimit` float NOT NULL DEFAULT '0' COMMENT 'ÉýѹÉÏÏÞ'," + " `ChargeCurrSet` float NOT NULL DEFAULT '0' COMMENT '³äµçµçÁ÷'," + " `MonomerTmp_High` float NOT NULL DEFAULT '0' COMMENT 'ζÈÉÏÏÞ'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * * @Title: createTb_li9130_bms_alm * @Description: ´´½¨ï®µç³ØBMS¸æ¾¯Á¿±í * @param pool * @param recreate * @author author * @date 2021Äê9ÔÂ14ÈÕ */ private static void createTb_li9130_bms_alm(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_li9130_bms_alm; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_li9130_bms_alm + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `bms_idx` int(11) NOT NULL DEFAULT '0' COMMENT 'ÐÅÏ¢Ë÷Òý'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî¿ØÖÆ'," + " `data_flag` int(11) NOT NULL DEFAULT '0'," + " `pack_pos` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏλ»úÐèÒª»ñÈ¡µÄpack×éλÖÃ'," + " `monomer_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµç³ØÊýÁ¿'," + " `mon_vol_alm1` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå1µçѹ¸æ¾¯'," + " `mon_vol_alm2` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå2µçѹ¸æ¾¯'," + " `mon_vol_alm3` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå3µçѹ¸æ¾¯'," + " `mon_vol_alm4` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå4µçѹ¸æ¾¯'," + " `mon_vol_alm5` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå5µçѹ¸æ¾¯'," + " `mon_vol_alm6` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå6µçѹ¸æ¾¯'," + " `mon_vol_alm7` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå7µçѹ¸æ¾¯'," + " `mon_vol_alm8` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå8µçѹ¸æ¾¯'," + " `mon_vol_alm9` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå9µçѹ¸æ¾¯'," + " `mon_vol_alm10` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå10µçѹ¸æ¾¯'," + " `mon_vol_alm11` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå11µçѹ¸æ¾¯'," + " `mon_vol_alm12` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå12µçѹ¸æ¾¯'," + " `mon_vol_alm13` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå13µçѹ¸æ¾¯'," + " `mon_vol_alm14` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå14µçѹ¸æ¾¯'," + " `mon_vol_alm15` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå15µçѹ¸æ¾¯'," + " `mon_vol_alm16` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå16µçѹ¸æ¾¯'," + " `temp_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'µçоζÈÊýÁ¿'," + " `mon_tmp_alm1` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå1µçоζȸ澯'," + " `mon_tmp_alm2` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå2µçоζȸ澯'," + " `mon_tmp_alm3` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå3µçоζȸ澯'," + " `mon_tmp_alm4` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå4µçоζȸ澯'," + " `env_temp_alm` int(11) NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È'," + " `mos_temp_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'MOS¹ÜζÈ'," + " `current_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷'," + " `sum_vol_alm` int(11) NOT NULL DEFAULT '0' COMMENT '×Üѹ'," + " `user_def_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¨Ò叿¾¯ÊýÁ¿'," + " `junheng_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâʼþ´úÂë'," + " `vol_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'µçѹʼþ´úÂë'," + " `temp_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ζÈʼþ´úÂë'," + " `curr_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷ʼþ´úÂë'," + " `rest_cap_alm` int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÈÝÁ¿¸æ¾¯'," + " `fet_state_code` int(11) NOT NULL DEFAULT '0' COMMENT 'FET״̬´úÂë'," + " `junheng_state_code` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâ״̬´úÂë'," + " `sys_state_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ״̬´úÂë'," + " `group_num` int(11) NOT NULL DEFAULT '0' COMMENT '×éºÅ:0-×é1£»1-×é2'," + " `sys_tmp_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳζÈʼþ´úÂë'," + " PRIMARY KEY (`num`)," + " KEY `idx_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×éºÅ:0-×é1£»1-×é2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_alm'" + " AND column_name='group_num'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_alm + " ADD COLUMN `group_num` int(11) NOT NULL DEFAULT '0' COMMENT '×éºÅ:0-×é1£»1-×é2';"); } //Ìí¼ÓϵͳζÈʼþ´úÂë res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_alm'" + " AND column_name='sys_tmp_code'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_alm + " ADD COLUMN `sys_tmp_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳζÈʼþ´úÂë';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * * @Title: createTb_li9130_bms_state * @Description: ´´½¨ï®µç³ØBMSÄ£ÄâÁ¿±í * @param pool * @param recreate * @author author * @date 2021Äê9ÔÂ14ÈÕ */ private static void createTb_li9130_bms_state(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_li9130_bms_state; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_li9130_bms_state + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `bms_idx` int(11) NOT NULL DEFAULT '0' COMMENT 'ÐÅÏ¢Ë÷Òý'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT '¿ØÖÆ'," + " `data_flag` int(11) NOT NULL DEFAULT '0'," + " `pack_pos` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏλ»úÐèÒª»ñÈ¡µÄpack×éλÖÃ'," + " `monomer_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµç³ØÊýÁ¿'," + " `mon_vol1` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå1µçѹ'," + " `mon_vol2` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå2µçѹ'," + " `mon_vol3` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå3µçѹ'," + " `mon_vol4` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå4µçѹ'," + " `mon_vol5` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå5µçѹ'," + " `mon_vol6` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå6µçѹ'," + " `mon_vol7` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå7µçѹ'," + " `mon_vol8` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå8µçѹ'," + " `mon_vol9` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå9µçѹ'," + " `mon_vol10` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå10µçѹ'," + " `mon_vol11` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå11µçѹ'," + " `mon_vol12` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå12µçѹ'," + " `mon_vol13` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå13µçѹ'," + " `mon_vol14` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå14µçѹ'," + " `mon_vol15` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå15µçѹ'," + " `mon_vol16` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå16µçѹ'," + " `tmp_cnt` int(11) NOT NULL DEFAULT '0' COMMENT 'µçоζÈÊýÁ¿'," + " `mon_tmp1` float NOT NULL DEFAULT '0' COMMENT 'µçо1ζÈ'," + " `mon_tmp2` float NOT NULL DEFAULT '0' COMMENT 'µçо2ζÈ'," + " `mon_tmp3` float NOT NULL DEFAULT '0' COMMENT 'µçо3ζÈ'," + " `mon_tmp4` float NOT NULL DEFAULT '0' COMMENT 'µçо4ζÈ'," + " `env_temp` float(11) NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È'," + " `mos_temp` float(11) NOT NULL DEFAULT '0' COMMENT 'MOS¹ÜζÈ'," + " `current` float(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷'," + " `sum_vol` float(11) NOT NULL DEFAULT '0' COMMENT '×Üѹ'," + " `rest_cap` int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÈÝÁ¿'," + " `sum_cap` int(11) NOT NULL DEFAULT '0' COMMENT '×ÜÈÝÁ¿'," + " `cycle_times` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³ØÑ­»·´ÎÊý'," + " `user_def_cnt` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¨ÒåÒ£²âÊýÁ¿'," + " `group_num` int(11) NOT NULL DEFAULT '0' COMMENT '×éºÅ:0-×é1£»1-×é2'," + " `mon_tmps` varchar(256) NOT NULL DEFAULT '' COMMENT 'µ¥ÌåÎÂ¶ÈÆ´½Ó×Ö·û´®'," + " PRIMARY KEY (`num`)," + " KEY `idx_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //ÐÞ¸Ä×Ö¶Îenv_temp ÀàÐÍΪfloat res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='env_temp' AND DATA_TYPE != 'float'"); if(res.next()){ //ÐÞ¸Ä×Ö¶Îenv_temp ÀàÐÍΪfloat sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " CHANGE `env_temp` `env_temp` float NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È';"); } res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='mos_temp' AND DATA_TYPE != 'float'"); if(res.next()) { //ÐÞ¸Ä×Ö¶Îmos_temp ÀàÐÍΪfloat sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " CHANGE `mos_temp` `mos_temp` float NOT NULL DEFAULT '0' COMMENT 'MOS¹ÜζÈ';"); } res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='current' AND DATA_TYPE != 'float'"); if(res.next()) { //ÐÞ¸Ä×Ö¶Îcurrent ÀàÐÍΪfloat sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " CHANGE `current` `current` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷';"); } res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='sum_vol' AND DATA_TYPE != 'float'"); if(res.next()) { //ÐÞ¸Ä×Ö¶Îsum_vol ÀàÐÍΪfloat sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " CHANGE `sum_vol` `sum_vol` float NOT NULL DEFAULT '0' COMMENT '×Üѹ';"); } res = null; //Ìí¼Ó×éºÅ:0-×é1£»1-×é2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='group_num'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " ADD COLUMN `group_num` int(11) NOT NULL DEFAULT '0' COMMENT '×éºÅ:0-×é1£»1-×é2';"); } res = null; //Ìí¼Ómon_tmps µ¥ÌåÎÂ¶È res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='mon_tmps'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " ADD COLUMN `mon_tmps` varchar(256) NOT NULL DEFAULT '' COMMENT 'µ¥ÌåÎÂ¶ÈÆ´½Ó×Ö·û´®';"); } res = null; //Ìí¼Óreserved1 Ô¤Áô[²©Ç¿-ÎÞ£»Íذî-¾ùºâζÈ]' res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_li9130_bms_state'" + " AND column_name='reserved1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_li9130_bms_state + " ADD COLUMN `reserved1` float NOT NULL DEFAULT '0' COMMENT 'Ô¤Áô[²©Ç¿-ÎÞ£»Íذî-¾ùºâζÈ]';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * * @Title: createTb_li9130_dcdc_data * @Description: ´´½¨Ë«ÏòDCDCÄÚ²¿Êý¾Ý±í * @param pool * @param recreate * @author author * @date 2021Äê9ÔÂ14ÈÕ */ private static void createTb_li9130_dcdc_data(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_li9130_dcdc_data; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_li9130_dcdc_data + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî¿ØÖÆ'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `dcdc_index` int(11) NOT NULL DEFAULT '0' COMMENT 'dcdecÄ£¿éË÷Òý[ÿÖÖ﮵çBTS´ø4¸ödcdcÄ£¿éÐÅÏ¢]'," + " `powerState` int(11) NOT NULL DEFAULT '0' COMMENT 'µçԴ״̬£º0-Í£Ö¹£»1-Õý³£Êä³ö£»2/3/4/5-Òì³£±£»¤'," + " `imuxian` float NOT NULL DEFAULT '0' COMMENT 'µçÔ´(ĸÏß)¶ËµçÁ÷'," + " `vmuxian` float NOT NULL DEFAULT '0' COMMENT 'µçÔ´(ĸÏß)¶Ëµçѹ'," + " `ibatt` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø¶ËµçÁ÷'," + " `vbatt` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷¶Ëµçѹ'," + " `currState` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷״̬£º0-ĸÏß¶Ôµç³Ø³äµç£»1-µç³Ø¶ÔĸÏ߷ŵç'," + " `version` float NOT NULL DEFAULT '0' COMMENT '°æ±¾ºÅ'," + " `setChgVol` float NOT NULL DEFAULT '0' COMMENT '³äµçµçѹÉèÖÃ'," + " `setChgCurr` float NOT NULL DEFAULT '0' COMMENT '³äµçµçÁ÷ÉèÖÃ'," + " `setChgStopCurr` float NOT NULL DEFAULT '0' COMMENT '³äµç½ØÖ¹µçÁ÷ÉèÖÃ'," + " `setReChgVol` float NOT NULL DEFAULT '0' COMMENT 'µçѹµøÂäÔٴγäµç·§ÖµÉèÖÃ'," + " `setDisStartVol` float NOT NULL DEFAULT '0' COMMENT 'ĸÏ߷ŵçµçѹãÐÖµÉèÖÃ'," + " `setDisVol` float NOT NULL DEFAULT '0' COMMENT '·ÅµçµçѹÉèÖÃ'," + " `setDisCurr` float NOT NULL DEFAULT '0' COMMENT '·ÅµçµçÁ÷ÉèÖÃ'," + " `setChgStartVol` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø³äµçµçѹãÐÖµÉèÖÃ'," + " `commTxCnt` int(11) NOT NULL DEFAULT '0' COMMENT '·¢ËͼÆÊý'," + " `commRxCnt` int(11) NOT NULL DEFAULT '0' COMMENT '½ÓÊÕ¼ÆÊý'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * * @Title: createTb_li9130_dcdc_param * @Description: ´´½¨Ë«ÏòDCDC¹¤×÷²ÎÊý±í * @param pool * @param recreate * @author author * @date 2021Äê9ÔÂ14ÈÕ */ private static void createTb_li9130_dcdc_param(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_li9130_dcdc_param; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_li9130_dcdc_param + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî±êʶ'," + " `dev_type` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸ÀàÐÍ[0:ï®µç³Ø;1ǦËáµç³Ø]'," + " `setChgVol` float NOT NULL DEFAULT '0' COMMENT '³äµçµçѹÉèÖÃ'," + " `setChgCurr` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçµçÁ÷ÉèÖÃ'," + " `setChgStopCurr` float NOT NULL DEFAULT '0' COMMENT '³äµç½ØÖ¹µçÁ÷ÉèÖÃ'," + " `setReChgVol` float NOT NULL DEFAULT '0' COMMENT 'µçѹµøÂäÔٴγäµç·§ÖµÉèÖÃ'," + " `setDisStartVol` float NOT NULL DEFAULT '0' COMMENT 'ĸÏ߷ŵçµçѹ·§ÖµÉèÖÃ'," + " `setDisVol` float NOT NULL DEFAULT '0' COMMENT '·ÅµçµçѹÉèÖÃ'," + " `setDisCurr` int(11) NOT NULL DEFAULT '0' COMMENT '·ÅµçµçÁ÷ÉèÖÃ'," + " `setChgStartVol` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø³äµçµçѹ·§ÖµÉèÖÃ'," + " `ifSaveToFlash` int(11) NOT NULL DEFAULT '0' COMMENT 'ÊÇ·ñдFlash[0:²»Ð´;1:д]'," + " `setWorkMode` int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷ģʽ[ÊÖ¶¯/×Ô¶¯]'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `idx_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ web_site Êý¾Ý¿â * @param pool */ public static void createDb_Ram_Db(MysqlConnPool pool) { Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { sql.sqlMysqlExecute("CREATE DATABASE IF NOT EXISTS " + Sql_Mysql.DB_RamDB); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨³ýÁò״̬±í * @param pool * @param recreate */ public static void createFBS9100s_fod_state(MysqlConnPool pool, boolean recreate) { String sql_str1 = " DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100s_fod_state; String sql_str2 = "CREATE TABLE IF NOT EXISTS "+ Sql_Mysql.FBS9100s_fod_state +" (" + " num int(11) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " BattGroupId int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éid'," + " record_time datetime NOT NULL DEFAULT '1970-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " RestTime_one int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÌìÊý(×é1)'," + " WorkState_one int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷ģʽ(×é1)'," + " VGroupVol_one double NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é1)'," + " VpeakVol_one double NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é1)'," + " RestTime_two int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÌìÊý(×é2)'," + " WorkState_two int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷ģʽ(×é2)'," + " VGroupVol_two double NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é2)'," + " VpeakVol_two double NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é2)'," + " RestTime_three int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÌìÊý(×é3)'," + " WorkState_three int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷ģʽ(×é3)'," + " VGroupVol_three double NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é3)'," + " VpeakVol_three double NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é3)'," + " RestTime_four int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÌìÊý(×é4)'," + " WorkState_four int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷ģʽ(×é4)'," + " VGroupVol_four double NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é4)'," + " VpeakVol_four double NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é4)'," + " RestTime_five int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'," + " WorkState_five int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'," + " VGroupVol_five int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'," + " VpeakVol_five int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'," + " PRIMARY KEY (num)," + " UNIQUE KEY unique_battgroupid (BattGroupId) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(recreate) { sql.sqlMysqlExecute(sql_str1); } sql.sqlMysqlExecute(sql_str2); //Ìí¼ÓÊ£Óàʱ¼ä(×é1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='RestTime_one'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN RestTime_one int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'"); } //Ìí¼Ó³ýÁò״̬(×é1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='WorkState_one'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN WorkState_one int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'"); } //Ìí¼Ó×é¶Ëµçѹ(×é1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VGroupVol_one'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VGroupVol_one int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'"); } //Ìí¼Ó·åÖµµçѹ(×é1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VpeakVol_one'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VpeakVol_one int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'"); } //Ìí¼ÓÊ£Óàʱ¼ä(×é2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='RestTime_two'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN RestTime_two int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'"); } //Ìí¼Ó³ýÁò״̬(×é2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='WorkState_two'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN WorkState_two int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'"); } //Ìí¼Ó×é¶Ëµçѹ(×é2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VGroupVol_two'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VGroupVol_two int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'"); } //Ìí¼Ó·åÖµµçѹ(×é2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VpeakVol_two'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VpeakVol_two int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'"); } //Ìí¼ÓÊ£Óàʱ¼ä(×é3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='RestTime_three'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN RestTime_three int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'"); } //Ìí¼Ó³ýÁò״̬(×é3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='WorkState_three'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN WorkState_three int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'"); } //Ìí¼Ó×é¶Ëµçѹ(×é3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VGroupVol_three'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VGroupVol_three int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'"); } //Ìí¼Ó·åÖµµçѹ(×é3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VpeakVol_three'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VpeakVol_three int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'"); } //Ìí¼ÓÊ£Óàʱ¼ä(×é4) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='RestTime_four'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN RestTime_four int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'"); } //Ìí¼Ó³ýÁò״̬(×é4) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='WorkState_four'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN WorkState_four int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'"); } //Ìí¼Ó×é¶Ëµçѹ(×é4) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VGroupVol_four'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VGroupVol_four int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'"); } //Ìí¼Ó·åÖµµçѹ(×é4) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VpeakVol_four'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VpeakVol_four int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'"); } //Ìí¼ÓÊ£Óàʱ¼ä(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='RestTime_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN RestTime_five int(11) NOT NULL DEFAULT '0' COMMENT 'Ê£Óàʱ¼ä(×é5)'"); } //Ìí¼Ó³ýÁò״̬(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='WorkState_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN WorkState_five int(11) NOT NULL DEFAULT '0' COMMENT '³ýÁò5״̬(×é5)'"); } //Ìí¼Ó×é¶Ëµçѹ(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VGroupVol_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VGroupVol_five int(11) NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ(×é5)'"); } //Ìí¼Ó·åÖµµçѹ(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='VpeakVol_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN VpeakVol_five int(11) NOT NULL DEFAULT '0' COMMENT '·åÖµµçѹ(×é5)'"); } //Ìí¼Óµç³Ø×éid×Ö¶Î res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_state'" + " AND column_name='BattGroupId'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_fod_state + " ADD COLUMN BattGroupId int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éid' AFTER dev_id"); } //ÒÆ³ý֮ǰµÄÒÔÉ豸id·Ö×éµÄÉ豸idΨһË÷Òý res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE KEY_name = 'unique_dev_id'"); if(res.next()) { sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100s_fod_state+" drop index unique_dev_id;"); } //Ìí¼Óµç³Ø×éidΪΨһË÷Òý res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE KEY_name = 'unique_BattGroupId'"); if(!res.next()) { //Ìí¼ÓΨһË÷ÒýǰÏÈɾ³ý±íÖмǼ sql.sqlMysqlExecute("DELETE FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE num>0"); sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100s_fod_state+" add UNIQUE unique_BattGroupId(BattGroupId);"); } //ÒÆ³ý֮ǰµÄÒÔÉ豸id·Ö×éµÄÉ豸idΨһË÷Òý /*res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE KEY_name = 'unique_BattGroupId'"); if(res.next()) { sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100s_fod_state+" drop index unique_BattGroupId;"); } //Ìí¼ÓÐÞ¸´É豸idΪΨһË÷Òý res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE KEY_name = 'unique_dev_id'"); if(!res.next()) { //Ìí¼ÓΨһË÷ÒýǰÏÈɾ³ý±íÖмǼ sql.sqlMysqlExecute("DELETE FROM "+Sql_Mysql.FBS9100s_fod_state+" WHERE num>0"); sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100s_fod_state+" add UNIQUE unique_dev_id(dev_id);"); }*/ } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨³ýÁò״̬±í * @param pool * @param recreate */ public static void createFBS9100SetDLParam_Table(MysqlConnPool pool, boolean recreate) { String sql_str1 = " DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SetDLParam_Table; String sql_str2 = "CREATE TABLE IF NOT EXISTS "+ Sql_Mysql.FBS9100SetDLParam_Table +" (" + " num int(11) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " op_cmd int(11) NOT NULL DEFAULT '0'," + " test_cmd int(11) NOT NULL DEFAULT '0'," + " GroupNum int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é±àºÅ'," + " BattGroupNum int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éºÅ'," + " STDCap_one int(11) NOT NULL DEFAULT '0' COMMENT '×é1±ê³ÆÈÝÁ¿'," + " FloatVol_one double NOT NULL DEFAULT '0' COMMENT '×é1¸¡³äµçѹ'," + " Strength_one double NOT NULL DEFAULT '0' COMMENT '×é1³ýÁòÇ¿¶È'," + " YHStrength_one double NOT NULL DEFAULT '0' COMMENT '×é1Ñø»¤Ç¿¶È'," + " TimeLong_one int(11) NOT NULL DEFAULT '0' COMMENT '×é1³ýÁòÌìÊý'," + " STDCap_two int(11) NOT NULL DEFAULT '0' COMMENT '×é2±ê³ÆÈÝÁ¿'," + " FloatVol_two double NOT NULL DEFAULT '0' COMMENT '×é2¸¡³äµçѹ'," + " Strength_two double NOT NULL DEFAULT '0' COMMENT '×é2³ýÁòÇ¿¶È'," + " YHStrength_two double NOT NULL DEFAULT '0' COMMENT '×é2Ñø»¤Ç¿¶È'," + " TimeLong_two int(11) NOT NULL DEFAULT '0' COMMENT '×é2³ýÁòÌìÊý'," + " STDCap_three int(11) NOT NULL DEFAULT '0' COMMENT '×é3±ê³ÆÈÝÁ¿'," + " FloatVol_three double NOT NULL DEFAULT '0' COMMENT '×é3¸¡³äµçѹ'," + " Strength_three double NOT NULL DEFAULT '0' COMMENT '×é3³ýÁòÇ¿¶È'," + " YHStrength_three double NOT NULL DEFAULT '0' COMMENT '×é3Ñø»¤Ç¿¶È'," + " TimeLong_three int(11) NOT NULL DEFAULT '0' COMMENT '×é3³ýÁòÌìÊý'," + " STDCap_four int(11) NOT NULL DEFAULT '0' COMMENT '×é4±ê³ÆÈÝÁ¿'," + " FloatVol_four double NOT NULL DEFAULT '0' COMMENT '×é4¸¡³äµçѹ'," + " Strength_four double NOT NULL DEFAULT '0' COMMENT '×é4³ýÁòÇ¿¶È'," + " YHStrength_four double NOT NULL DEFAULT '0' COMMENT '×é4Ñø»¤Ç¿¶È'," + " TimeLong_four int(11) NOT NULL DEFAULT '0' COMMENT '×é4³ýÁòÌìÊý'," + " PRIMARY KEY (num)," + " UNIQUE KEY unique_dev_id (dev_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(recreate) { sql.sqlMysqlExecute(sql_str1); } sql.sqlMysqlExecute(sql_str2); //Ìí¼Óµç³Ø×é±àºÅ×Ö¶Î res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='BattGroupNum'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN BattGroupNum int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é×éºÅ'"); } //Ìí¼Ó±ê³ÆÈÝÁ¿(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='STDCap_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN STDCap_five int(11) NOT NULL DEFAULT '0' COMMENT '×é5±ê³ÆÈÝÁ¿'"); } //Ìí¼Ó¸¡³äµçѹ(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='FloatVol_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN FloatVol_five double NOT NULL DEFAULT '0' COMMENT '×é5¸¡³äµçѹ'"); } //Ìí¼Ó³ýÁòÇ¿¶È(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='Strength_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN Strength_five double NOT NULL DEFAULT '0' COMMENT '×é5³ýÁòÇ¿¶È'"); } //Ìí¼ÓÑø»¤Ç¿¶È(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='YHStrength_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN YHStrength_five double NOT NULL DEFAULT '0' COMMENT '×é5Ñø»¤Ç¿¶È'"); } //Ìí¼ÓÊ£Óàʱ¼ä(×é5) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_fod_param'" + " AND column_name='TimeLong_five'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetDLParam_Table + " ADD COLUMN TimeLong_five int(11) NOT NULL DEFAULT '0' COMMENT '×é5³ýÁòÌìÊý'"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨Äæ±äÐÅÏ¢±í */ public static void createFBS9100_NiBian_State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100_NiBian_State; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100_NiBian_State + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id bigint(11) NOT NULL DEFAULT '0'," + " nb_num bigint(11) NOT NULL DEFAULT '0'," + " record_time datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + " AC_ASimVol float NOT NULL DEFAULT '0'," + " AC_ASimCur float NOT NULL DEFAULT '0'," + " AC_BSimVol float NOT NULL DEFAULT '0'," + " AC_BSimCur float NOT NULL DEFAULT '0'," + " AC_CSimVol float NOT NULL DEFAULT '0'," + " AC_CSimCur float NOT NULL DEFAULT '0'," + " A_HZ float NOT NULL DEFAULT '0'," + " B_HZ float NOT NULL DEFAULT '0'," + " C_HZ float NOT NULL DEFAULT '0'," + " Power_Pa float NOT NULL DEFAULT '0'," + " Power_Pb float NOT NULL DEFAULT '0'," + " Power_Pc float NOT NULL DEFAULT '0'," + " Power_Sa float NOT NULL DEFAULT '0'," + " Power_Sb float NOT NULL DEFAULT '0'," + " Power_Sc float NOT NULL DEFAULT '0'," + " Temp1 float NOT NULL DEFAULT '0'," + " Temp2 float NOT NULL DEFAULT '0'," + " RunState float NOT NULL DEFAULT '0'," + " DcACState int(11) NOT NULL DEFAULT '0'," + " InsulaTionRes1 int(11) NOT NULL DEFAULT '0'," + " InsulaTionRes2 int(11) NOT NULL DEFAULT '0'," + " DCInputVol float NOT NULL DEFAULT '0'," + " DCInputCur float NOT NULL DEFAULT '0'," + " SetRun_Stop int(11) NOT NULL DEFAULT '0'," + " SetDischargeCur float NOT NULL DEFAULT '0'," + " CommTxCnt int(11) NOT NULL DEFAULT '0'," + " CommRxCnt int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY nb_num_index (nb_num) USING HASH" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_socketclient_state ±í * @param pool * @param recreate */ public static void createSocketClientStateTable(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.SocketClientStateTable; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.SocketClientStateTable + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " uId int(11) NOT NULL DEFAULT '0'," + " client_type int(11) NOT NULL DEFAULT '0'," + " client_id bigint(20) NOT NULL DEFAULT '0'," + " BattGroupId int(11) NOT NULL DEFAULT '0'," + " client_is_connected tinyint(1) NOT NULL DEFAULT '0'," + " client_ip varchar(64) NOT NULL DEFAULT ' '," + " client_conn_time datetime NOT NULL DEFAULT '1980-01-01 00:00:00'," + " client_disconn_time datetime NOT NULL DEFAULT '1980-01-01 00:00:00'," + " PRIMARY KEY (num)," + " KEY index_user_id (uId)," + " KEY index_client_type (client_type)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_server_state ±í * @param pool * @param recreate */ public static void createServerState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.ServerState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.ServerState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " server_version float NOT NULL DEFAULT '0'," + " server_datetime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " max_mem bigint(20) NOT NULL DEFAULT '0'," + " total_mem bigint(20) NOT NULL DEFAULT '0'," + " free_men bigint(20) NOT NULL DEFAULT '0'," + " total_disc_space bigint(20) NOT NULL DEFAULT '0'," + " free_disc_space bigint(20) NOT NULL DEFAULT '0'," + " db_conn_max int(11) NOT NULL DEFAULT '0'," + " db_conn_count int(11) NOT NULL DEFAULT '0'," + " app_conn_max int(11) NOT NULL DEFAULT '0'," + " app_busy_conn_cnt int(11) NOT NULL DEFAULT '0'," + " app_idle_conn_cnt int(11) NOT NULL DEFAULT '0'," + " server_cpu_rate float NOT NULL DEFAULT '0'," + " server_network_rate float NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×Ö¶Îapp_conn_max res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_server_state'" + " AND column_name='app_conn_max'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.ServerState_Table + " ADD COLUMN app_conn_max int(11) NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Îapp_busy_conn_cnt res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_server_state'" + " AND column_name='app_busy_conn_cnt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.ServerState_Table + " ADD COLUMN app_busy_conn_cnt int(11) NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Îapp_idle_conn_cnt res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_server_state'" + " AND column_name='app_idle_conn_cnt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.ServerState_Table + " ADD COLUMN app_idle_conn_cnt int(11) NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Îserver_cpu_rate res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_server_state'" + " AND column_name='server_cpu_rate'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.ServerState_Table + " ADD COLUMN server_cpu_rate float NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Î server_network_rate res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_server_state'" + " AND column_name='server_network_rate'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.ServerState_Table + " ADD COLUMN server_network_rate float NOT NULL DEFAULT '0';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_ld9_updatestatue ±í * @param pool * @param recreate */ public static void createLd9_Updatestatue_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Ld9_Updatestatue_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Ld9_Updatestatue_Table + " (" + "`num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'É豸ID'," + " `update_file` varchar(200) NOT NULL DEFAULT '' COMMENT 'Éý¼¶ÎļþÃû³Æ'," + " `update_en` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Éý¼¶Ê¹ÄÜ:0:²»²Ù×÷£»1£º¿ªÊ¼Éý¼¶'," + " `update_type` int(1) NOT NULL DEFAULT '0' COMMENT '0:Éý¼¶LD9;1:Éý¼¶ÏÔʾÆÁ'," + " `send_upfile_ok` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Éý¼¶ÊÇ·ñ³É¹¦'," + " `stopreason` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò'," + " `countpackage` int(11) NOT NULL DEFAULT '0' COMMENT '×ÜÊý¾Ý°üÊýÁ¿'," + " `nowpackagenum` int(11) NOT NULL DEFAULT '0' COMMENT 'µ±Ç°Êý¾Ý°ü±àºÅ'," + " `updatetime` datetime NOT NULL DEFAULT '1982-01-01 00:00:00' COMMENT '¸üÐÂʱ¼ä'," + " `starttime` datetime NOT NULL DEFAULT '1982-01-01 00:00:00' COMMENT '¿ªÊ¼Éý¼¶Ê±¼ä'," + " `note` varchar(200) NOT NULL DEFAULT ''," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id_uniq` (`dev_id`)" + ") ENGINE=MEMORY AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼ÓÔÚÏß³äµçÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_ld9_updatestatue'" + " AND column_name='update_type'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Ld9_Updatestatue_Table + " ADD COLUMN `update_type` int(1) NOT NULL DEFAULT '0' COMMENT '0:Éý¼¶LD9;1:Éý¼¶ÏÔʾÆÁ' AFTER update_en;"); } //³õʼ»¯Ä¬ÈÏÊý¾Ý res = sql.sqlMysqlQuery("SELECT COUNT(*) num FROM db_ram_db.tb_ld9_updatestatue;"); if(false != res.next()) { int num = res.getInt("num"); if(num==0){ //³õʼ»¯Êý¾Ý sql.sqlMysqlExecute("INSERT INTO db_ram_db.`tb_ld9_updatestatue` VALUES ('6', '401900002', 'E51_DFU.SM5', '0', '0', '1', '0', '668', '668', '2022-01-07 10:10:02', '2022-01-07 10:07:12', '');"); }else{ // System.out.println("db_ram_db.tb_ld9_updatestatue ÓÐ Num ÌõÊý¾Ý "+num); } } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_ld9_state ±í * @param pool * @param recreate */ public static void createLd9_State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Ld9_State_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Ld9_State_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '401900001'," + " dev_ip varchar(20) NOT NULL DEFAULT '127.0.0.1'," + " record_datetime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " dev_version varchar(64) NOT NULL DEFAULT 'v1.01.01'," + " sys_state int(11) NOT NULL DEFAULT '0'," + " sys_online_vol float NOT NULL DEFAULT '0.01'," + " sys_group_vol float NOT NULL DEFAULT '0.01'," + " sys_now_battnum int(11) NOT NULL DEFAULT '1'," + " sys_now_battstate int(11) NOT NULL DEFAULT '1'," + " sys_now_battvol float NOT NULL DEFAULT '0.01'," + " sys_now_battcurr float NOT NULL DEFAULT '0.01'," + " sys_now_battcap float NOT NULL DEFAULT '0.01'," + " sys_now_testtime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " sys_next_battnum int(11) NOT NULL DEFAULT '1'," + " sys_next_battstate int(11) NOT NULL DEFAULT '1'," + " sys_next_battvol float NOT NULL DEFAULT '0.01'," + " sys_next_battcurr float NOT NULL DEFAULT '0.01'," + " sys_next_battcap float NOT NULL DEFAULT '0.01'," + " sys_next_testtime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " sys_tmp float NOT NULL DEFAULT '0.1'," + " sys_stop_reason int(11) NOT NULL DEFAULT '1'," + " dev_commcount int(11) NOT NULL DEFAULT '0'," + " dev_errcommcount int(11) NOT NULL DEFAULT '0'," + " timelong int(11) NOT NULL DEFAULT '0'," + " monvol_hightalarm int(11) NOT NULL DEFAULT '0'," + " monvol_loweralarm int(11) NOT NULL DEFAULT '0'," + " moncap_alarm int(11) NOT NULL DEFAULT '0'," + " montmp_alarm int(11) NOT NULL DEFAULT '0'," + " monres_alarm int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id (dev_id)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_ld9_setparam ±í * @param pool * @param recreate */ public static void createLd9_Setparam_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Ld9_Setparam_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Ld9_Setparam_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '401900001'," + " `op_cmd` int(11) NOT NULL DEFAULT '0'," + " `param_teststart_batt_num` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÆðʼµç³ØÐòºÅ'," + " `param_cap` int(11) NOT NULL DEFAULT '1' COMMENT '±ê³ÆÈÝÁ¿'," + " `param_discharge_curr` float NOT NULL DEFAULT '0.001' COMMENT '·ÅµçµçÁ÷'," + " `param_mon_curr_high` float NOT NULL DEFAULT '0.001' COMMENT 'µ¥ÌåÏÂÏÞ'," + " `param_charge_curr` float NOT NULL DEFAULT '0.001' COMMENT '³äµçµçÁ÷'," + " `param_mon_curr_low` float NOT NULL DEFAULT '0.001' COMMENT 'µ¥ÌåÉÏÏÞ'," + " `param_online_vol` float NOT NULL DEFAULT '0.01' COMMENT 'ÔÚÏßµçѹãÐÖµ'," + " `param_charge_curr_low` float NOT NULL DEFAULT '0.001' COMMENT '³äµçµçÁ÷ÏÂÏÞãÐÖµ'," + " `param_charge_cap_low` float NOT NULL DEFAULT '0.1' COMMENT '³äµçÈÝÁ¿ÏÂÏÞãÐÖµ'," + " `param_online_vol_recover` int(11) NOT NULL DEFAULT '0' COMMENT 'ÔÚÏßµçѹ»Ö¸´ãÐÖµ'," + " `param_module_address` int(11) NOT NULL DEFAULT '1' COMMENT 'Ä£¿éµØÖ·'," + " `param_junheng_model` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâ¹¦ÄܵįôÓûò½ûÓÃ'," + " `param_cap_low` float NOT NULL DEFAULT '0' COMMENT 'ÈÝÁ¿ÏÂÏÞ'," + " `param_datasource` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀ´Ô´0-±¾»ú;1-»ã¼¯Æ÷'," + " `param_res_args` int(11) NOT NULL DEFAULT '0' COMMENT 'ÄÚ×è²âÊÔϵÊý[1-100]'," + " `param_tmp_high` float NOT NULL DEFAULT '0' COMMENT 'ζÈÉÏÏÞ'," + " `param_res_high` float NOT NULL DEFAULT '0' COMMENT 'ÄÚ×èÉÏÏÞ'," + " `param_testtime` int(11) NOT NULL DEFAULT '0' COMMENT '·Åµçʱ¼ä(·ÖÖÓ)[0-5940]'," + " `param_mon_vol` float NOT NULL DEFAULT '0' COMMENT '±ê³Æµ¥Ìåµçѹ'," + " `param_jh_vol` float NOT NULL DEFAULT '0' COMMENT '¾ùºâµçÑ¹Æ«ÒÆ'," + " `param_jhtest_interval` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâ²âÊÔ¼ä¸ô(·ÖÖÓ)[1-120]'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //param_testtime ·Åµçʱ¼ä(·ÖÖÓ)[0-5940] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_ld9_setparam'" + " AND column_name='param_testtime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Ld9_Setparam_Table + " ADD COLUMN `param_testtime` int(11) NOT NULL DEFAULT '0' COMMENT '·Åµçʱ¼ä(·ÖÖÓ)[0-5940]';"); } res = null; //param_mon_vol ±ê³Æµ¥Ìåµçѹ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_ld9_setparam'" + " AND column_name='param_mon_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Ld9_Setparam_Table + " ADD COLUMN `param_mon_vol` float NOT NULL DEFAULT '0' COMMENT '±ê³Æµ¥Ìåµçѹ';"); } //param_jh_vol ¾ùºâµçÑ¹Æ«ÒÆ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_ld9_setparam'" + " AND column_name='param_jh_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Ld9_Setparam_Table + " ADD COLUMN `param_jh_vol` float NOT NULL DEFAULT '0' COMMENT '¾ùºâµçÑ¹Æ«ÒÆ';"); } //param_jhtest_interval ¾ùºâ²âÊÔ¼ä¸ô(·ÖÖÓ)[1-120] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_ld9_setparam'" + " AND column_name='param_jhtest_interval'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Ld9_Setparam_Table + " ADD COLUMN `param_jhtest_interval` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâ²âÊÔ¼ä¸ô(·ÖÖÓ)[1-120]';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_ld9_setparam ±í * @param pool * @param recreate */ public static void createLd9_Concentratestate_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Ld9_Concentratestate_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Ld9_Concentratestate_Table + " (" + " num int(11) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " dev_id int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " record_time datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " systemVersion varchar(255) NOT NULL DEFAULT '' COMMENT 'ϵͳ°æ±¾'," + " systemState int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ״̬'," + " groupVol float NOT NULL DEFAULT '0' COMMENT '×é¶Ëµçѹ'," + " groupCurr float NOT NULL DEFAULT '0' COMMENT '×é¶ËµçÁ÷'," + " battState int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×´Ì¬'," + " currDirection int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷·½Ïò'," + " rippleCurrAvg float NOT NULL DEFAULT '0' COMMENT 'ÎÆ²¨µçÁ÷¾ùÖµ'," + " rippleCurrTop float NOT NULL DEFAULT '0' COMMENT 'ÎÆ²¨µçÁ÷·åÖµ'," + " resTestCount int(11) NOT NULL DEFAULT '0' COMMENT 'ÄÚ×è²âÊÔ´ÎÊý'," + " resTestMethod int(11) NOT NULL DEFAULT '0' COMMENT 'ÄÚ×è²âÊÔ·½·¨'," + " PRIMARY KEY (num)," + " UNIQUE KEY unique_dev_id (dev_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_ld9_concentrateparam ±í * @param pool * @param recreate */ public static void createLd9_Concentrateparam_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Ld9_Concentrateparam_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Ld9_Concentrateparam_Table + " (" + " num int(11) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " op_cmd int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî¿ØÖÆ×Ö¶Î'," + " addr int(11) NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷µØÖ·£¨0-2555£©'," + " firthMonCount int(11) NOT NULL DEFAULT '0' COMMENT 'µÚһ·µ¥Ìå¸öÊý'," + " secondMonCount int(11) NOT NULL DEFAULT '0' COMMENT 'µÚ¶þ·µ¥Ìå¸öÊý'," + " thirdMonCount int(11) NOT NULL DEFAULT '0' COMMENT 'µÚÈý·µ¥Ìå¸öÊý'," + " fourthMonCount int(11) NOT NULL DEFAULT '0' COMMENT 'µÚËÄ·µ¥Ìå¸öÊý'," + " fifthMonCount int(11) NOT NULL DEFAULT '0' COMMENT 'µÚÎå·µ¥Ìå¸öÊý'," + " currRange int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷ǯÁ¿³Ì'," + " floatCurrLimit float NOT NULL DEFAULT '0' COMMENT '¸¡³äµçÁ÷ÃÅÏÞ'," + " rippleCurrLimit float NOT NULL DEFAULT '0' COMMENT 'ÎÆ²¨µçÁ÷·§Öµ'," + " autoTestCycle int(11) NOT NULL DEFAULT '1' COMMENT '×Ô¶¯²âÊÔÖÜÆÚ'," + " resTestType int(11) NOT NULL DEFAULT '0' COMMENT 'ÄÚ×è²âÊÔ·½·¨'," + " dischargeType int(11) NOT NULL DEFAULT '0' COMMENT '·Åµçģʽ'," + " battCapStd int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿'," + " backup1 int(11) NOT NULL DEFAULT '0' COMMENT '±¸ÓÃ1'," + " backup2 int(11) NOT NULL DEFAULT '0' COMMENT '±¸ÓÃ2'," + " backup3 int(11) NOT NULL DEFAULT '0' COMMENT '±¸ÓÃ3'," + " backup4 int(11) NOT NULL DEFAULT '0' COMMENT '±¸ÓÃ4'," + " PRIMARY KEY (num)," + " UNIQUE KEY unique_dev_id (dev_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_hard_dev_sms_state ±í * @param pool * @param recreate */ public static void createHardDevSmsState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.HardDevSmsState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.HardDevSmsState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " sms_dev_ip varchar(20) NOT NULL DEFAULT '192.168.1.60'," + " sms_ack_type int(11) NOT NULL DEFAULT '0'," + " sms_sincard_ok tinyint(1) NOT NULL DEFAULT '0'," + " sms_mobile_net_ok tinyint(1) NOT NULL DEFAULT '0'," + " sms_sinal_value int(11) NOT NULL DEFAULT '0'," + " sms_is_busy tinyint(1) NOT NULL DEFAULT '0'," + " sms_money_rest float NOT NULL DEFAULT '0'," + " sms_com_count int(11) NOT NULL DEFAULT '0'," + " sms_com_err_count int(11) NOT NULL DEFAULT '0'," + " note varchar(100) NOT NULL DEFAULT ' '," + " PRIMARY KEY (num)" + ") ENGINE=MEMORY DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9600_state ±í * @param pool * @param recreate */ public static void createFBS9600State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9600State_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9600State_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_ip varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " op_cmd int(11) NOT NULL DEFAULT '0'," + " dev_workstate int(11) NOT NULL DEFAULT '0'," + " dev_alarmstate int(11) NOT NULL DEFAULT '0'," + " dev_commcount int(11) NOT NULL DEFAULT '0'," + " dev_errcommcount int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_uniq (dev_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100s_dfu_state ±í * @param pool * @param recreate */ public static void createFBS9100S_DFUState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100S_DFUState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100S_DFUState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " sysVersion_new int(11) NOT NULL DEFAULT '0'," + " softVersion_new int(11) NOT NULL DEFAULT '0'," + " sysVersion_dev int(11) NOT NULL DEFAULT '0'," + " softVersion_dev int(11) NOT NULL DEFAULT '0'," + " dfu_file varchar(200) NOT NULL DEFAULT ' '," + " dfu_en tinyint(1) NOT NULL DEFAULT '0'," + " dfu_wr_stat int(11) NOT NULL DEFAULT '0'," + " dfu_data_blocknum int(11) NOT NULL DEFAULT '0'," + " dfu_data_blocklen int(11) NOT NULL DEFAULT '256'," + " dfu_password varchar(100) NOT NULL DEFAULT ' '," + " dfu_file_len int(11) NOT NULL," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_uniq (dev_id)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó´íÎó´úÂë×Ö¶Î res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_DFU_state'" + " AND column_name='error_code'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100S_DFUState_Table + " ADD COLUMN `error_code` int(11) NOT NULL DEFAULT '0' COMMENT '´íÎó´úÂë[0:ÎÞ£»1:ÎļþδÕÒµ½£»2:²ÎÊý´íÎó£»3:Îļþ·¢Ëͳ¬Ê±;4£ºÔ¶³ÌÍ£Ö¹]'"); } //ÐÞ¸ÄsysVersion_new×ֶθñʽ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_DFU_state'" + " AND column_name='sysVersion_new' AND DATA_TYPE != 'varchar'"); if(res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100S_DFUState_Table + " CHANGE `sysVersion_new` `sysVersion_new` varchar(128) NOT NULL DEFAULT '0';"); } //ÐÞ¸ÄsysVersion_dev×ֶθñʽ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_DFU_state'" + " AND column_name='sysVersion_dev' AND DATA_TYPE != 'varchar'"); if(res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100S_DFUState_Table + " CHANGE `sysVersion_dev` `sysVersion_dev` varchar(128) NOT NULL DEFAULT '0';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_fbs9100s_dcdc_state ±í * @param pool * @param recreate */ public static void createFBS9100S_DcDcState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100S_DcDcState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100S_DcDcState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " dcdc_num bigint(20) NOT NULL DEFAULT '0'," + " dcdc_Vsys float NOT NULL DEFAULT '0'," + " dcdc_Vout float NOT NULL DEFAULT '0'," + " dcdc_Vbat float NOT NULL DEFAULT '0'," + " dcdc_Iout float NOT NULL DEFAULT '0'," + " dcdc_Ibuck float NOT NULL DEFAULT '0'," + " dcdc_Tmp_Dis float NOT NULL DEFAULT '0'," + " dcdc_Tmp_Chr float NOT NULL DEFAULT '0'," + " dcdc_SMR_Alarm1 int(11) NOT NULL DEFAULT '0'," + " dcdc_SMR_Alarm2 int(11) NOT NULL DEFAULT '0'," + " dcdc_version int(11) NOT NULL DEFAULT '0'," + " dcdc_ModeSetComm int(11) NOT NULL DEFAULT '0'," + " dcdc_RunSetComm int(11) NOT NULL DEFAULT '0'," + " dcdc_BuckISet float NOT NULL DEFAULT '0'," + " dcdc_DisVolSet float NOT NULL DEFAULT '0'," + " dcdc_DisCurrSet float NOT NULL DEFAULT '0'," + " dcdc_CommTxCnt int(11) NOT NULL DEFAULT '0'," + " dcdc_CommRxCnt int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dcdc_num_uniq (dcdc_num)" + ") ENGINE=MEMORY DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_sysparam ±í * @param pool * @param recreate */ public static void createFBS9100SysParam_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100SysParam_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SysParam_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_ip varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " op_cmd int(11) NOT NULL DEFAULT '0'," + " IPADDR varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " SubIPADDR varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " NetGateADDR varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " GroupVolRange int(11) NOT NULL DEFAULT '0'," + " GroupVolSorce int(11) NOT NULL DEFAULT '0'," + " CurrentRange int(11) NOT NULL DEFAULT '0'," + " CurrentTyte int(11) NOT NULL DEFAULT '0'," + " MonomerOrder int(11) NOT NULL DEFAULT '0'," + " BackLightTime int(11) NOT NULL DEFAULT '0'," + " MACADDR varchar(30) NOT NULL DEFAULT '0.0.0.0.0.0'," + " LoaderCount int(11) NOT NULL DEFAULT '0'," + " DtCardCount int(11) NOT NULL DEFAULT '0'," + " PowerBreakChargeCurr float NOT NULL DEFAULT '0'," + " MajorBattGroupNum int(11) NOT NULL DEFAULT '0'," + " POF_BG_Boost_Cnt int(11) NOT NULL DEFAULT '0'," + " POF_BG_Boost_VolStop float NOT NULL DEFAULT '0'," + " POF_BG_Boost_VolStart float NOT NULL DEFAULT '0'," + " `JunHeng_Enabled` float NOT NULL DEFAULT '0' COMMENT '¾ùºâ¹¦ÄÜÆôÓÃ״̬£¨1:ÆôÓã»0:½ûÓã©'," + " `JunHeng_StVol` float NOT NULL DEFAULT '0' COMMENT '¾ùºâÍ£Ö¹µçѹ·§Öµ'," + " `JunHeng_StCurr` float NOT NULL DEFAULT '0' COMMENT '¾ùºâÍ£Ö¹µçÁ÷·§Öµ'," + " `auto_captestperiod` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¯ºËÈÝÖÜÆÚ£¬µ¥Î»£ºÌì(7~999)'," + " `loaderpowerdown_peroid` int(11) NOT NULL DEFAULT '1' COMMENT '¸ºÔØ×Ô¶¯¶ÏµçÖÜÆÚ µ¥Î»£ºÌì(1~999)'," + " `loaderpowerdown_time` int(11) NOT NULL DEFAULT '0' COMMENT '¸ºÔضϵçʱ¼ä µ¥Î»£ºÃë(5~30)'," + " `boost_dcdc_bakvol` float NOT NULL DEFAULT '0' COMMENT 'ÉýѹDCDC£¬ºó±¸µçѹ(0.1V 30.0~56.0)'," + " `boost_dcdc_bakcurr` float NOT NULL DEFAULT '0' COMMENT 'ÉýѹDCDC£¬ºó±¸µçÁ÷'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_uniq (dev_id)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×Ö¶ÎJunHeng_Enabled ¾ùºâ¹¦ÄÜÆôÓÃ״̬ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='JunHeng_Enabled'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `JunHeng_Enabled` float NOT NULL DEFAULT '0' COMMENT '¾ùºâ¹¦ÄÜÆôÓÃ״̬£¨1:ÆôÓã»0:½ûÓã©';"); } res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='JunHeng_Enabled' AND DATA_TYPE != 'float'"); if(res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " CHANGE `JunHeng_Enabled` `JunHeng_Enabled` float NOT NULL DEFAULT '0' COMMENT '¾ùºâ¹¦ÄÜÆôÓÃ״̬£¨1:ÆôÓã»0:½ûÓã©';"); } //Ìí¼Ó×Ö¶ÎJunHeng_StVol ¾ùºâÍ£Ö¹µçѹ·§Öµ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='JunHeng_StVol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `JunHeng_StVol` float NOT NULL DEFAULT '0' COMMENT '¾ùºâÍ£Ö¹µçѹ·§Öµ';"); } //Ìí¼Ó×Ö¶ÎJunHeng_StCurr ¾ùºâÍ£Ö¹µçÁ÷·§Öµ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='JunHeng_StCurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `JunHeng_StCurr` float NOT NULL DEFAULT '0' COMMENT '¾ùºâÍ£Ö¹µçÁ÷·§Öµ';"); } //Ìí¼Ó×Ö¶ÎStandyVolt ºó±¸µçѹ£¨V£© res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='StandyVolt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `StandyVolt` float NOT NULL DEFAULT '0' COMMENT 'ºó±¸µçѹ£¨V£©';"); } /* * * 2022-08-23 ²¢ÁªµçÔ´ÐÂÔö²ÎÊýÉèÖà * ***********************************************************/ //Ìí¼Ó×Ö¶ÎfloatChargeVolt ¸¡³äµçѹ[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='floatChargeVolt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `floatChargeVolt` float NOT NULL DEFAULT '0' COMMENT '¸¡³äµçѹ[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎdisChargeVolt ºó±¸·Åµçµçѹ[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='disChargeVolt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `disChargeVolt` float NOT NULL DEFAULT '0' COMMENT 'ºó±¸·Åµçµçѹ[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎdischargeVoltLimit ·ÅµçµçѹÏÂÏÞ[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='dischargeVoltLimit'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `dischargeVoltLimit` float NOT NULL DEFAULT '0' COMMENT '·ÅµçµçѹÏÂÏÞ[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎmonomerLowVolt µ¥ÌåÏÂÏÞ[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='monomerLowVolt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `monomerLowVolt` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÏÂÏÞ[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎmonomerLowCount µ¥ÌåÏÂÏÞ¸öÊý[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='monomerLowCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `monomerLowCount` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÏÂÏÞ¸öÊý[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎautoEQChargeStartimeTime ×Ô¶¯Æô¶¯¾ù³äÖÜÆÚ(Ìì)[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='autoEQChargeStartimeTime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `autoEQChargeStartimeTime` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¯Æô¶¯¾ù³äÖÜÆÚ(Ìì)[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶ÎautoEQChargetTime ¾ù³äʱ³¤[²¢ÁªµçÔ´] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='autoEQChargetTime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `autoEQChargetTime` int(11) NOT NULL DEFAULT '0' COMMENT '¾ù³äʱ³¤[²¢ÁªµçÔ´]';"); } //Ìí¼Ó×Ö¶Îdev_addr 61851_É豸µØÖ· res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='dev_addr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `dev_addr` int(11) NOT NULL DEFAULT '0' COMMENT '61851_É豸µØÖ·';"); } //Ìí¼Ó×Ö¶ÎtempH_Env 61851_»·¾³Î¶ȸßãÐÖµ res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='tempH_Env'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `tempH_Env` float NOT NULL DEFAULT '0' COMMENT '61851_»·¾³Î¶ȸßãÐÖµ';"); } //Ìí¼Ó×Ö¶ÎtempH_JCQ 61851_½Ó´¥Æ÷ζȸßãÐÖµ res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='tempH_JCQ'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `tempH_JCQ` float NOT NULL DEFAULT '0' COMMENT '61851_½Ó´¥Æ÷ζȸßãÐÖµ';"); } //Ìí¼Ó×Ö¶ÎcurrH_ZL 61851_֧·µçÁ÷¸ßãÐÖµ res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='currH_ZL'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `currH_ZL` float NOT NULL DEFAULT '0' COMMENT '61851_֧·µçÁ÷¸ßãÐÖµ';"); } //Ìí¼Ó×Ö¶Îkm1_switch 61851_¿ØÖÆKM1¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='km1_switch'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `km1_switch` tinyint(4) NOT NULL DEFAULT '0' COMMENT '61851_¿ØÖÆKM1¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª]';"); } //Ìí¼Ó×Ö¶Îkm2_switch 61851_¿ØÖÆKM2¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='km2_switch'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `km2_switch` tinyint(4) NOT NULL DEFAULT '0' COMMENT '61851_¿ØÖÆKM2¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª]';"); } //Ìí¼Ó×Ö¶Îkm3_switch 61851_¿ØÖÆKM3¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª] res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='km3_switch'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `km3_switch` tinyint(4) NOT NULL DEFAULT '0' COMMENT '61851_¿ØÖÆKM3¿ª¹Ø[1±ÕºÏ£»0£º¶Ï¿ª]';"); } //Ìí¼Ó×Ö¶Îauto_captestperiod '×Ô¶¯ºËÈÝÖÜÆÚ£¬µ¥Î»£ºÌì(7~999)' res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='auto_captestperiod'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `auto_captestperiod` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¯ºËÈÝÖÜÆÚ£¬µ¥Î»£ºÌì(7~999)';"); } //Ìí¼Ó×Ö¶Îloaderpowerdown_peroid ¸ºÔØ×Ô¶¯¶ÏµçÖÜÆÚ µ¥Î»£ºÌì(1~999) res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='loaderpowerdown_peroid'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `loaderpowerdown_peroid` int(11) NOT NULL DEFAULT '1' COMMENT '¸ºÔØ×Ô¶¯¶ÏµçÖÜÆÚ µ¥Î»£ºÌì(1~999)';"); } //Ìí¼Ó×Ö¶Îloaderpowerdown_time ¸ºÔضϵçʱ¼ä µ¥Î»£ºÃë(5~30) res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='loaderpowerdown_time'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `loaderpowerdown_time` int(11) NOT NULL DEFAULT '0' COMMENT '¸ºÔضϵçʱ¼ä µ¥Î»£ºÃë(5~30)';"); } //Ìí¼Ó×Ö¶Îboost_dcdc_bakvol ÉýѹDCDC£¬ºó±¸µçѹ(0.1V 30.0~56.0) res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='boost_dcdc_bakvol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `boost_dcdc_bakvol` float NOT NULL DEFAULT '0' COMMENT 'ÉýѹDCDC£¬ºó±¸µçѹ(0.1V 30.0~56.0)';"); } //Ìí¼Ó×Ö¶Îboost_dcdc_bakcurr ÉýѹDCDC£¬ºó±¸µçÁ÷ res = null; res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_sysparam'" + " AND column_name='boost_dcdc_bakcurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SysParam_Table + " ADD COLUMN `boost_dcdc_bakcurr` float NOT NULL DEFAULT '0' COMMENT 'ÉýѹDCDC£¬ºó±¸µçÁ÷';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_fbs9100_state ±í * @param pool * @param recreate */ public static void createFBS9100State_Table(MysqlConnPool pool, boolean recreate) { String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100State_Table; String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100State_Table + " ( `num` BIGINT NOT NULL AUTO_INCREMENT, " + "`dev_ip` varchar(20) NOT NULL DEFAULT '127.0.0.0', " + "`dev_version` varchar(64) NOT NULL DEFAULT '0', " + "`dev_id` BIGINT NOT NULL DEFAULT 0, " + "`op_cmd` INT NOT NULL DEFAULT 0, " + "`record_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', " + "`dev_datetime` varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00', " + "`dev_testtype` INT NOT NULL DEFAULT 0, " + "`dev_testgroupnum` INT NOT NULL DEFAULT 0, " + "`dev_workstate` INT NOT NULL DEFAULT 0, " + "`dev_alarmstate` INT NOT NULL DEFAULT 0, " + "`dev_temp` float NOT NULL DEFAULT 0, " //É豸ÎÂ¶È + "`dev_res_test_state` INT NOT NULL DEFAULT 0, " //ÄÚ×è²âÊÔ״̬ + "`dev_onlinevollow` BOOLEAN NOT NULL DEFAULT false, " + "`dev_eachgroup_battsum` INT NOT NULL DEFAULT 0, " + "`dev_captest_onlinevol` float NOT NULL DEFAULT 0, " + "`dev_captest_groupvol` float NOT NULL DEFAULT 0, " + "`dev_captest_curr` float NOT NULL DEFAULT 0, " + "`dev_captest_cap` float NOT NULL DEFAULT 0, " + "`dev_captest_timelong` INT NOT NULL DEFAULT 0, " + "`dev_restest_count` INT NOT NULL DEFAULT 0, " + "`dev_restest_moncount` INT NOT NULL DEFAULT 0, " + "`dev_restest_monindex` INT NOT NULL DEFAULT 0, " + "`dev_commcount` INT NOT NULL DEFAULT 0, " + "`dev_errcommcount` INT NOT NULL DEFAULT 0, " + "`dev_rxnullerrcount` INT NOT NULL DEFAULT 0, " + "`dev_last_captest_stop_type` INT NOT NULL DEFAULT 0, " + "`dev_concurr` float NOT NULL DEFAULT 0, " + "`dev_condvoldp` float NOT NULL DEFAULT 0, " + "`dev_conresist` float NOT NULL DEFAULT 0, " + "`dev_condcurr` float NOT NULL DEFAULT 0, " + "`dev_61850alarms` varchar(64) NOT NULL DEFAULT '', " + "`dev_batt_xuhang_tlong` INT NOT NULL DEFAULT 0, " //Ðøº½Ê±³¤ + "`dev_station_poff_tlong` INT NOT NULL DEFAULT 0, " //Í£µçʱ³¤ + "`dev_station_poff_cnt` INT NOT NULL DEFAULT 0, " //Í£µç´ÎÊý + "`dev_data_flowsum` BIGINT NOT NULL DEFAULT 0, " //»ú·¿Á÷Á¿ + "`batt_online_state` INT NOT NULL DEFAULT 0, " //µç³Ø×´Ì¬(0:±ÕºÏ,1£º¶Ï¿ª) + "`dev_condvoldp1` float NOT NULL DEFAULT '0'," + "`a059_group_vol1` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é1×é¶Ëµçѹ'," + "`a059_group_vol2` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é2×é¶Ëµçѹ'," + "`a059_group_curr1` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é1×é¶ËµçÁ÷'," + "`a059_group_curr2` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é2×é¶ËµçÁ÷'," + "`dev_pos_states` varchar(30) NOT NULL DEFAULT '0,0,0,0' COMMENT 'Çл»Ïä½Ó´¥Æ÷Õý¼«¿ª¹Ø×´Ì¬[0ûͨÐÅÉÏ£»1£»Õý³££»2£»Òì³£]'," + "`dev_neg_states` varchar(30) NOT NULL DEFAULT '0,0,0,0' COMMENT 'Çл»Ïä½Ó´¥Æ÷¸º¼«¿ª¹Ø×´Ì¬[0ûͨÐÅÉÏ£»1£»Õý³££»2£»Òì³£]'," + "`a059_onlineSaveVol` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»úÇл»µç³Ø×é±£»¤µçѹ'," + "`a059_acvolLowFlag` int(11) NOT NULL DEFAULT '0' COMMENT 'ÊеçÖжÏ״̬(0£ºÕý³££»1£ºÊеçÖжÏ)'," + "`a059_switchVolMin` float NOT NULL DEFAULT '0' COMMENT '»ØÇÐ×é¶Ëµçѹ·¶Î§µÍ'," + "`a059_switchVolMax` float NOT NULL DEFAULT '0' COMMENT '»ØÇÐ×é¶Ëµçѹ·¶Î§¸ß'," + "`elec_comb_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±í×éºÏÓ馵çÄÜ¡¾kWh¡¿'," + "`elec_posi_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±íÕýÏòÓ馵çÄÜ¡¾kWh¡¿'," + "`elec_rever_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±í·´ÏòÓ馵çÄÜ¡¾kWh¡¿'," + "`elec_active_power` float NOT NULL DEFAULT '0' COMMENT 'µç±íÓй¦¹¦ÂÊ¡¾W¡¿'," + "`elec_vol` float NOT NULL DEFAULT '0' COMMENT 'µç±í²âÁ¿µçѹ[V]'," + "`elec_curr` float NOT NULL DEFAULT '0' COMMENT 'µç±í²âÁ¿µçÁ÷[A]'," + "`load_vol_fromhjq` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçѹ£¨V£©-»ã¼¯Æ÷'," + "`load_curr_fromhjq` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçÁ÷£¨A£©-»ã¼¯Æ÷'," + "`dev_power` float NOT NULL DEFAULT '0' COMMENT 'É豸¹¦ÂÊ(KW)'," + "`fbo4830_is_online` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'FBO4830ÔÚÀëÏß״̬£º0:ÀëÏߣ»1£ºÔÚÏß'," + "`fbo4830_stopstr` varchar(255) NOT NULL DEFAULT '' COMMENT 'FBO4830״̬Îı¾ÏÔʾ'," + " UNIQUE INDEX index_dev_id_uniq (`dev_id`), " + " PRIMARY KEY (`num`) ) " + " ENGINE=InnoDB DEFAULT CHARSET=utf8"; /* String str3 = "INSERT INTO " + Sql_Mysql.FBS9100State_Table + " (dev_ip, dev_id) "; str3 += " SELECT dev_ip, dev_id FROM " + Sql_Mysql.BattInf_Table; */ Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(recreate) { sql.sqlMysqlExecute(str1); } sql.sqlMysqlExecute(str2); //ÐÞ¸´É豸É豸°æ±¾ºÅ¹ý³¤bug res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_version'"); if(true == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " +Sql_Mysql.FBS9100State_Table + " MODIFY COLUMN dev_version varchar(255) NOT NULL DEFAULT '';"); } //Ìí¼ÓÉ豸ζÈÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_temp'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_temp` float NOT NULL DEFAULT 0;"); } //Ìí¼ÓÄÚ×è²âÊÔ״̬ÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_res_test_state'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_res_test_state` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_restest_count res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_restest_count'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_restest_count` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_last_captest_stop_type res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_last_captest_stop_type'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_last_captest_stop_type` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_concurr res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_concurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_concurr` float NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_condvoldp ×é1µ¼Í¨Ñ¹½µ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_condvoldp'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_condvoldp` float NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_condvoldp1 ×é2µ¼Í¨Ñ¹½µ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_condvoldp1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_condvoldp1` float NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_conresist ×é1½Ó´¥Æ÷µ¼Í¨×迹 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_conresist'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_conresist` float NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_conresist ×é2½Ó´¥Æ÷µ¼Í¨×迹 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_conresist1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_conresist1` float NOT NULL DEFAULT 0 after dev_conresist;"); } //Ìí¼Ódev_condcurr res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_condcurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_condcurr` float NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_61850alarms res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_61850alarms'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_61850alarms` varchar(64) NOT NULL DEFAULT '';"); } //Ìí¼Ódev_batt_xuhang_tlong res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_batt_xuhang_tlong'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_batt_xuhang_tlong` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_station_poff_tlong res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_station_poff_tlong'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_station_poff_tlong` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_station_poff_cnt(Í£µç´ÎÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_station_poff_cnt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_station_poff_cnt` INT NOT NULL DEFAULT 0;"); } //Ìí¼Ódev_data_flowsum(Á÷Á¿Í³¼Æ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_data_flowsum'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_data_flowsum` BIGINT NOT NULL DEFAULT 0;"); } //Ìí¼Óbatt_online_state(µç³Ø¿ª¹Ø×´Ì¬) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='batt_online_state'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `batt_online_state` INT NOT NULL DEFAULT 0;"); } res = null; //Ìí¼Ó×Ö¶Îa059_group_vol1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_group_vol1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_group_vol1` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é1×é¶Ëµçѹ';"); } res = null; //Ìí¼Ó×Ö¶Îa059_group_vol2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_group_vol2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_group_vol2` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é2×é¶Ëµçѹ';"); } res = null; //Ìí¼Ó×Ö¶Îa059_group_curr1 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_group_curr1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_group_curr1` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é1×é¶ËµçÁ÷';"); } res = null; //Ìí¼Ó×Ö¶Îa059_group_curr2 res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_group_curr2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_group_curr2` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»ú×é2×é¶ËµçÁ÷';"); } res = null; //Ìí¼Ó×Ö¶Îdev_pos_states res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_pos_states'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_pos_states` varchar(30) NOT NULL DEFAULT '0,0,0,0' COMMENT 'Çл»Ïä½Ó´¥Æ÷Õý¼«¿ª¹Ø×´Ì¬[0ûͨÐÅÉÏ£»1£»Õý³££»2£»Òì³£]';"); } res = null; //Ìí¼Ó×Ö¶Îdev_neg_states res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_neg_states'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_neg_states` varchar(30) NOT NULL DEFAULT '0,0,0,0' COMMENT 'Çл»Ïä½Ó´¥Æ÷¸º¼«¿ª¹Ø×´Ì¬[0ûͨÐÅÉÏ£»1£»Õý³££»2£»Òì³£]';"); } res = null; //Ìí¼Ó×Ö¶Îa059_onlineSaveVol res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_onlineSaveVol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_onlineSaveVol` float NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçÒ»Ìå»úÇл»µç³Ø×é±£»¤µçѹ';"); } res = null; //Ìí¼Ó×Ö¶Îa059_acvolLowFlag-ÊеçÖжÏ״̬ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_acvolLowFlag'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_acvolLowFlag` int(11) NOT NULL DEFAULT '0' COMMENT 'ÊеçÖжÏ״̬(0£ºÕý³££»1£ºÊеçÖжÏ)';"); } res = null; //Ìí¼Ó×Ö¶Îa059_switchVolMin-»ØÇÐ×é¶Ëµçѹ·¶Î§µÍ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_switchVolMin'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_switchVolMin` float NOT NULL DEFAULT '0' COMMENT '»ØÇÐ×é¶Ëµçѹ·¶Î§µÍ';"); } res = null; //Ìí¼Ó×Ö¶Îa059_switchVolMax-»ØÇÐ×é¶Ëµçѹ·¶Î§¸ß res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='a059_switchVolMax'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `a059_switchVolMax` float NOT NULL DEFAULT '0' COMMENT '»ØÇÐ×é¶Ëµçѹ·¶Î§¸ß';"); } /********************** 2022-12-15 ÐÂÔöµçÄܱíÊý¾Ý *************************************************/ res = null; //Ìí¼Ó×Ö¶Îelec_comb_acttive_energy-µç±í×éºÏÓ馵çÄÜ¡¾kWh¡¿ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_comb_acttive_energy'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_comb_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±í×éºÏÓ馵çÄÜ¡¾kWh¡¿';"); } res = null; //Ìí¼Ó×Ö¶Îelec_posi_acttive_energy-µç±íÕýÏòÓ馵çÄÜ¡¾kWh¡¿ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_posi_acttive_energy'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_posi_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±íÕýÏòÓ馵çÄÜ¡¾kWh¡¿';"); } res = null; //Ìí¼Ó×Ö¶Îelec_rever_acttive_energy-µç±í·´ÏòÓ馵çÄÜ¡¾kWh¡¿ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_rever_acttive_energy'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_rever_acttive_energy` float NOT NULL DEFAULT '0' COMMENT 'µç±í·´ÏòÓ馵çÄÜ¡¾kWh¡¿';"); } res = null; //Ìí¼Ó×Ö¶Îelec_active_power-µç±íÓй¦¹¦ÂÊ¡¾W¡¿ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_active_power'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_active_power` float NOT NULL DEFAULT '0' COMMENT 'µç±íÓй¦¹¦ÂÊ¡¾W¡¿';"); } res = null; //Ìí¼Ó×Ö¶Îelec_vol-µç±í²âÁ¿µçѹ[V] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_vol` float NOT NULL DEFAULT '0' COMMENT 'µç±í²âÁ¿µçѹ[V]';"); } res = null; //Ìí¼Ó×Ö¶Îelec_curr-µç±í²âÁ¿µçÁ÷[A] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='elec_curr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `elec_curr` float NOT NULL DEFAULT '0' COMMENT 'µç±í²âÁ¿µçÁ÷[A]';"); } res = null; //Ìí¼Ó×Ö¶Îload_vol_fromhjq-¸ºÔصçѹ£¨V£©-»ã¼¯Æ÷[A] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='load_vol_fromhjq'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `load_vol_fromhjq` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçѹ£¨V£©-»ã¼¯Æ÷';"); } res = null; //Ìí¼Ó×Ö¶Îload_curr_fromhjq-¸ºÔصçÁ÷£¨A£©-»ã¼¯Æ÷[A] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='load_curr_fromhjq'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `load_curr_fromhjq` float NOT NULL DEFAULT '0' COMMENT '¸ºÔصçÁ÷£¨A£©-»ã¼¯Æ÷';"); } res = null; //Ìí¼Ó×Ö¶Îdev_power-É豸¹¦ÂÊ(KW) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='dev_power'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `dev_power` float NOT NULL DEFAULT '0' COMMENT 'É豸¹¦ÂÊ(KW)';"); } res = null; //Ìí¼Ó×Ö¶Îfbo4830_is_online - FBO4830ÔÚÀëÏß״̬£º0:ÀëÏߣ»1£ºÔÚÏß res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='fbo4830_is_online'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `fbo4830_is_online` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'FBO4830ÔÚÀëÏß״̬£º0:ÀëÏߣ»1£ºÔÚÏß';"); } res = null; //Ìí¼Ó×Ö¶Îfbo4830_stopstr - FBO4830״̬Îı¾ÏÔʾ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_state'" + " AND column_name='fbo4830_stopstr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100State_Table + " ADD COLUMN `fbo4830_stopstr` varchar(255) NOT NULL DEFAULT '' COMMENT 'FBO4830µ±Ç°×´Ì¬Îı¾ÏÔʾ';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_setparam ±í * @param pool * @param recreate */ public static void createFBS9100SetParam_Table(MysqlConnPool pool, boolean recreate) { String str1 = "DROP TABLE IF EXISTS " + Sql_Mysql.FBS9100SetParam_Table; String str2 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100SetParam_Table + " ( `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_ip` varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " `dev_id` bigint(20) NOT NULL DEFAULT '0'," + " `op_cmd` int(11) NOT NULL DEFAULT '0'," + " `TestCmd` int(11) NOT NULL DEFAULT '0'," + " `HourRate` int(11) NOT NULL DEFAULT '0'," + " `DisCurr` float NOT NULL DEFAULT '0'," + " `DisCap` float NOT NULL DEFAULT '0'," + " `DisTime` int(11) NOT NULL DEFAULT '0'," + " `GroupVol_LOW` float NOT NULL DEFAULT '0'," + " `MonomerVol_LOW` float NOT NULL DEFAULT '0'," + " `MonomerLowCount` int(11) NOT NULL DEFAULT '0'," + " `BattGroupNum` int(11) NOT NULL DEFAULT '0'," + " `OnlineVolLowAction` int(11) NOT NULL DEFAULT '0'," + " `DCVolHighLimit` float NOT NULL DEFAULT '0'," + " `ChargeCurrSet` float NOT NULL DEFAULT '0'," + " `MonomerTmp_High` float NOT NULL DEFAULT '0'," + " `AutoTestStartVol` float NOT NULL DEFAULT '0'," + " `MonCount` int(11) NOT NULL DEFAULT '0' COMMENT 'ÿ×éµ¥ÌåÊý'," + " `MonVol` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµçѹ'," + " `DisPower` float NOT NULL DEFAULT '0' COMMENT 'Ô¤·Å¹¦ÂÊ£¨0.1kw£©'," + " `DisPreRes` float(11,0) NOT NULL DEFAULT '0' COMMENT '·Åµç×èÖµ(m¦¸) '," + " `CharCap` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçÈÝÁ¿(AH)'," + " `CharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçʱ³¤(min)'," + " `FloatCharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '¸¡³äʱ³¤'," + " `CharSotpCurr` float NOT NULL DEFAULT '0' COMMENT '½ØÖ¹µçÁ÷(0.1A) '," + " `MonVolHightLimit` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ(0.01V)'," + " `MonVolHightLimitCount` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞÊýÁ¿'," + " `CharHighTmp` float(11,0) NOT NULL DEFAULT '45' COMMENT '³äµç¹ýÎÂ'," + " `DisWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '·ÅÍê¾²ÖÃ(0-500·ÖÖÓ)'," + " `CharWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '³äÍê¾²ÖÃ(0-500·ÖÖÓ)'," + " `FlowOver_Count` int(11) NOT NULL DEFAULT '1' COMMENT 'ºãÁ÷×ܽ׶ÎÊý[1-3]'," + " `FlowOver_CharCurr_1` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷1½×¶Î³äµçµçÁ÷'," + " `FlowOver_CharCurr_2` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷2½×¶Î³äµçµçÁ÷'," + " `FlowOver_CharCurr_3` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷3½×¶Î³äµçµçÁ÷'," + " `FlowOver_CharTime_1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷1½×¶Î³äµçʱ³¤'," + " `FlowOver_CharTime_2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷2½×¶Î³äµçʱ³¤'," + " `FlowOver_CharTime_3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷3½×¶Î³äµçʱ³¤'," + " `OnLineVol_Low` float NOT NULL DEFAULT '0'," + " `OffLineYH_Cycle` int(11) NOT NULL DEFAULT '0'," + " `OffLineYHstarttime` datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + " `OffLineYHTimes` int(11) NOT NULL DEFAULT '1'," + " `OffLineYHOnceCycle` int(11) NOT NULL DEFAULT '1'," + " `ChargeVolt` float NOT NULL DEFAULT '0' COMMENT '³äµçµçѹ(V)'," + " `C_ProtectVol1` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçѹ1'," + " `C_ProtectVol2` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçѹ2'," + " `C_ProtectVol3` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçѹ3'," + " `C_mon_uppervol1` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ1'," + " `C_mon_uppervol2` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ2'," + " `C_mon_uppervol3` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ3'," + " `C_mon_uppernum1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý1'," + " `C_mon_uppernum2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý2'," + " `C_mon_uppernum3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý3'," + " `HV_charge_num` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ×ܽ׶ÎÊý[1~3]'," + " `HV_charge_Vol1` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1³äµçµçѹ'," + " `HV_charge_Vol2` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2³äµçµçѹ'," + " `HV_charge_Vol3` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3³äµçµçѹ'," + " `HV_time1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1³äµçʱ¼ä'," + " `HV_time2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2³äµçʱ¼ä'," + " `HV_time3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3³äµçʱ¼ä'," + " `HV_ProtectCurr1` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçÁ÷1'," + " `HV_ProtectCurr2` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçÁ÷2'," + " `HV_ProtectCurr3` float NOT NULL DEFAULT '0' COMMENT '±£»¤µçÁ÷3'," + " `HV_mon_uppervol1` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ1'," + " `HV_mon_uppervol2` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ2'," + " `HV_mon_uppervol3` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ3'," + " `HV_mon_uppernum1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý1'," + " `HV_mon_uppernum2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý2'," + " `HV_mon_uppernum3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏÏÞ¸öÊý3'," + " `MonCapStd` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿'," + " `OnlineTestFlag` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÀàÐÍ£º0£ºÀëÏß 1£ºÔÚÏß'," + " `BattGroupCount` int(11) NOT NULL DEFAULT '1' COMMENT 'µç³Ø×é×éÊý'," + " `SOCLow` float NOT NULL DEFAULT '0' COMMENT 'µç³Øsoc[Ê£ÓàÈÝÁ¿]ÏÂÏÞ(%)'," + " `SOCHigh` float NOT NULL DEFAULT '0' COMMENT 'µç³Øsoc[Ê£ÓàÈÝÁ¿]ÉÏÏÞ(%)'," + " `CellDiffVolHigh` float NOT NULL DEFAULT '0' COMMENT 'ѹ²îÉÏÏÞ(mV)'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id_uniq` (`dev_id`)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(str1); //ÖØ½¨±í } sql.sqlMysqlExecute(str2); //Ìí¼ÓÖ¸¶¨µÄBattGroupNumÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='BattGroupNum'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `BattGroupNum` INT NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄOnlineVolLowActionÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OnlineVolLowAction'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OnlineVolLowAction` INT NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ DCVolHighLimit ÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='DCVolHighLimit'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `DCVolHighLimit` FLOAT NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ ChargeCurrSet ÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='ChargeCurrSet'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `ChargeCurrSet` FLOAT NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ MonomerTmp_High ÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonomerTmp_High'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonomerTmp_High` FLOAT NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ AutoTestStartVol ÁÐ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='AutoTestStartVol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `AutoTestStartVol` float NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ OnLineVol_Low ÁÐ(ÔÚÏßµçѹµÍ·§Öµ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OnLineVol_Low'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OnLineVol_Low` float NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄ OffLineYH_Cycle ÁÐ(ÀëÏßÑø»¤ÖÜÆÚ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OffLineYH_Cycle'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OffLineYH_Cycle` int NOT NULL DEFAULT 0;"); } //Ìí¼ÓÖ¸¶¨µÄOffLineYHstarttimeÁÐ(Ñø»¤¼Æ»®¿ªÊ¼Ê±¼ä) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OffLineYHstarttime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OffLineYHstarttime` datetime NOT NULL DEFAULT '2000-01-01 00:00:00';"); } //Ìí¼ÓÖ¸¶¨µÄOffLineYHTimesÁÐ(ÀëÏßÑø»¤Ö´ÐдÎÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OffLineYHTimes'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OffLineYHTimes` int(11) NOT NULL DEFAULT '1';"); } //Ìí¼ÓÖ¸¶¨µÄOffLineYHOnceCycleÁÐ(ÀëÏßÑø»¤Ã¿´ÎÖ´ÐÐÖÜÆÚ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OffLineYHOnceCycle'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OffLineYHOnceCycle` int(11) NOT NULL DEFAULT '1';"); } /* 2021-07-19 edit by lijun * FGCD_A059É豸ÐÂÔö²ÎÊý */ //Ìí¼ÓÖ¸¶¨µÄMonCountÁÐ(ÿ×éµ¥ÌåÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonCount` int(11) NOT NULL DEFAULT '0' COMMENT 'ÿ×éµ¥ÌåÊý';"); } //Ìí¼ÓÖ¸¶¨µÄMonVolÁÐ(µ¥Ìåµçѹ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonVol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonVol` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµçѹ';"); } //Ìí¼ÓÖ¸¶¨µÄDisPowerÁÐ(Ô¤·Å¹¦ÂÊ£¨0.1kw£©) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='DisPower'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `DisPower` float(11,0) NOT NULL DEFAULT '0' COMMENT 'Ô¤·Å¹¦ÂÊ£¨0.1kw£©';"); } //Ìí¼ÓÖ¸¶¨µÄDisPreResÁÐ(·Åµç×èÖµ(m¦¸)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='DisPreRes'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `DisPreRes` float(11,0) NOT NULL DEFAULT '0' COMMENT '·Åµç×èÖµ(m¦¸)';"); } //Ìí¼ÓÖ¸¶¨µÄCharCapÁÐ(³äµçÈÝÁ¿(AH)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharCap'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CharCap` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçÈÝÁ¿(AH)';"); } //Ìí¼ÓÖ¸¶¨µÄCharTimeLongÁÐ(³äµçʱ³¤(min)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharTimeLong'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '³äµçʱ³¤(min)';"); } //Ìí¼ÓÖ¸¶¨µÄFloatCharTimeLongÁÐ(¸¡³äʱ³¤) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FloatCharTimeLong'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FloatCharTimeLong` int(11) NOT NULL DEFAULT '0' COMMENT '¸¡³äʱ³¤';"); } //Ìí¼ÓÖ¸¶¨µÄCharSotpCurrÁÐ(½ØÖ¹µçÁ÷(0.1A)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharSotpCurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CharSotpCurr` float(11,0) NOT NULL DEFAULT '0' COMMENT '½ØÖ¹µçÁ÷(0.1A)';"); } //Ìí¼ÓÖ¸¶¨µÄMonVolHightLimitÁÐ(µ¥ÌåÉÏÏÞ(0.01V)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonVolHightLimit'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonVolHightLimit` float(11,0) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞ(0.01V)';"); } //Ìí¼ÓÖ¸¶¨µÄMonVolHightLimitCountÁÐ(µ¥ÌåÉÏÏÞÊýÁ¿) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonVolHightLimitCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonVolHightLimitCount` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÉÏÏÞÊýÁ¿';"); } //Ìí¼ÓÖ¸¶¨µÄCharHighTmpÁÐ(³äµç¹ýÎÂ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharHighTmp'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CharHighTmp` int(11) NOT NULL DEFAULT '0' COMMENT '³äµç¹ýÎÂ';"); } //ÐÞ¸ÄÖ¸¶¨µÄCharHighTmpÁÐ(³äµç¹ýÎÂ)×Ö¶Îint ->double res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharHighTmp'"); if(res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " modify column `CharHighTmp` float(11,0) NOT NULL DEFAULT '45' COMMENT '³äµç¹ýÎÂ';"); } //Ìí¼ÓÖ¸¶¨µÄDisWaitTimeÁÐ(·ÅÍê¾²ÖÃ(0-500·ÖÖÓ)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='DisWaitTime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `DisWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '·ÅÍê¾²ÖÃ(0-500·ÖÖÓ)';"); } //Ìí¼ÓÖ¸¶¨µÄCharWaitTimeÁÐ(³äÍê¾²ÖÃ(0-500·ÖÖÓ)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CharWaitTime'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CharWaitTime` int(11) NOT NULL DEFAULT '0' COMMENT '³äÍê¾²ÖÃ(0-500·ÖÖÓ)';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CountÁÐ(ºãÁ÷×ܽ׶ÎÊý[1-3]) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_Count'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_Count` int(11) NOT NULL DEFAULT '1' COMMENT 'ºãÁ÷×ܽ׶ÎÊý[1-3]';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharCurr_1ÁÐ(ºãÁ÷1½×¶Î³äµçµçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharCurr_1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharCurr_1` float(11,0) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷1½×¶Î³äµçµçÁ÷';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharCurr_2ÁÐ(ºãÁ÷2½×¶Î³äµçµçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharCurr_2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharCurr_2` float(11,0) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷2½×¶Î³äµçµçÁ÷';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharCurr_3ÁÐ(ºãÁ÷3½×¶Î³äµçµçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharCurr_3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharCurr_3` float(11,0) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷3½×¶Î³äµçµçÁ÷';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharTime_1ÁÐ(ºãÁ÷1½×¶Î³äµçʱ³¤) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharTime_1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharTime_1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷1½×¶Î³äµçʱ³¤';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharTime_2ÁÐ(ºãÁ÷2½×¶Î³äµçʱ³¤) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharTime_2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharTime_2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷2½×¶Î³äµçʱ³¤';"); } //Ìí¼ÓÖ¸¶¨µÄFlowOver_CharTime_3ÁÐ(ºãÁ÷3½×¶Î³äµçʱ³¤) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='FlowOver_CharTime_3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `FlowOver_CharTime_3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷3½×¶Î³äµçʱ³¤';"); } //2022-06-09Ìí¼ÓÖ¸¶¨µÄChargeVoltÁÐ(³äµçµçѹ(V)) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='ChargeVolt'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `ChargeVolt` float NOT NULL DEFAULT '0' COMMENT '³äµçµçѹ(V)';"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_ProtectVol1ÁÐ(ºãÁ÷±£»¤µçѹ1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_ProtectVol1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_ProtectVol1` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷±£»¤µçѹ1'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_ProtectVol2ÁÐ(ºãÁ÷±£»¤µçѹ2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_ProtectVol2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_ProtectVol2` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷±£»¤µçѹ2'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_ProtectVol3ÁÐ(ºãÁ÷±£»¤µçѹ3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_ProtectVol3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_ProtectVol3` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷±£»¤µçѹ3'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppervol1ÁÐ(ºãÁ÷µ¥ÌåÉÏÏÞ1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppervol1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppervol1` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷µ¥ÌåÉÏÏÞ1'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppervol2ÁÐ(ºãÁ÷µ¥ÌåÉÏÏÞ2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppervol2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppervol2` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷µ¥ÌåÉÏÏÞ2'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppervol3ÁÐ(ºãÁ÷µ¥ÌåÉÏÏÞ3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppervol3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppervol3` float NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷µ¥ÌåÉÏÏÞ3'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppernum1ÁÐ(ºãÁ÷ÉÏÏÞ¸öÊý1) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppernum1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppernum1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷ÉÏÏÞ¸öÊý1'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppernum2ÁÐ(ºãÁ÷ÉÏÏÞ¸öÊý2) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppernum2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppernum2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷ÉÏÏÞ¸öÊý2'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄC_mon_uppernum3ÁÐ(ºãÁ÷ÉÏÏÞ¸öÊý3) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='C_mon_uppernum3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `C_mon_uppernum3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷ÉÏÏÞ¸öÊý3'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_charge_numÁÐ(ºãѹ×ܽ׶ÎÊý[1~3]) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_charge_num'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_charge_num` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ×ܽ׶ÎÊý[1~3]'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_charge_Vol1ÁÐ(ºãѹ½×¶Î1³äµçµçѹ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_charge_Vol1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_charge_Vol1` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1³äµçµçѹ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_charge_Vol2ÁÐ(ºãѹ½×¶Î2³äµçµçѹ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_charge_Vol2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_charge_Vol2` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2³äµçµçѹ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_charge_Vol3ÁÐ(ºãѹ½×¶Î3³äµçµçѹ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_charge_Vol3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_charge_Vol3` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3³äµçµçѹ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_time1ÁÐ(ºãѹ½×¶Î1³äµçʱ¼ä) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_time1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_time1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1³äµçʱ¼ä'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_time2ÁÐ(ºãѹ½×¶Î2³äµçʱ¼ä) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_time2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_time2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2³äµçʱ¼ä'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_time3ÁÐ(ºãѹ½×¶Î3³äµçʱ¼ä) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_time3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_time3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3³äµçʱ¼ä'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_ProtectCurr1ÁÐ(ºãѹ½×¶Î1±£»¤µçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_ProtectCurr1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_ProtectCurr1` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1±£»¤µçÁ÷'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_ProtectCurr2ÁÐ(ºãѹ½×¶Î2±£»¤µçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_ProtectCurr2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_ProtectCurr2` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2±£»¤µçÁ÷'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_ProtectCurr3ÁÐ(ºãѹ½×¶Î3±£»¤µçÁ÷) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_ProtectCurr3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_ProtectCurr3` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3±£»¤µçÁ÷'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppervol1ÁÐ(ºãѹ½×¶Î1µ¥ÌåÉÏÏÞ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppervol1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppervol1` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1µ¥ÌåÉÏÏÞ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppervol2ÁÐ(ºãѹ½×¶Î2µ¥ÌåÉÏÏÞ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppervol2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppervol2` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2µ¥ÌåÉÏÏÞ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppervol3ÁÐ(ºãѹ½×¶Î1µ¥ÌåÉÏÏÞ) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppervol3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppervol3` float NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3µ¥ÌåÉÏÏÞ'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppernum1ÁÐ(ºãѹ½×¶Î1ÉÏÏÞ¸öÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppernum1'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppernum1` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î1ÉÏÏÞ¸öÊý'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppernum2ÁÐ(ºãѹ½×¶Î2ÉÏÏÞ¸öÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppernum2'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppernum2` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î2ÉÏÏÞ¸öÊý'"); } //2022-06-17Ìí¼ÓÖ¸¶¨µÄHV_mon_uppernum3ÁÐ(ºãѹ½×¶Î3ÉÏÏÞ¸öÊý) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='HV_mon_uppernum3'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `HV_mon_uppernum3` int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹ½×¶Î3ÉÏÏÞ¸öÊý'"); } //2022-11-04Ìí¼ÓÖ¸¶¨µÄMonCapStdÁÐ(±ê³ÆÈÝÁ¿) res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='MonCapStd'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `MonCapStd` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿';"); } /************* 2022-12-06 ÐÂÔöFBO-4830NT ²ÎÊý×Ö¶Î **************************************/ res = null; //Ìí¼Ó OnlineTestFlag [²âÊÔÀàÐÍ×Ö¶Î] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='OnlineTestFlag'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `OnlineTestFlag` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÀàÐÍ£º0£ºÀëÏß 1£ºÔÚÏß';"); } res = null; //Ìí¼Ó BattGroupCount [µç³Ø×é×éÊý] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='BattGroupCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `BattGroupCount` int(11) NOT NULL DEFAULT '1' COMMENT 'µç³Ø×é×éÊý';"); } res = null; //Ìí¼Ó SOCLow [µç³Øsoc[Ê£ÓàÈÝÁ¿]ÏÂÏÞ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='SOCLow'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `SOCLow` float NOT NULL DEFAULT '0' COMMENT 'µç³Øsoc[Ê£ÓàÈÝÁ¿]ÏÂÏÞ(%)';"); } res = null; //Ìí¼Ó SOCHigh [µç³Øsoc[Ê£ÓàÈÝÁ¿]ÉÏÏÞ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='SOCHigh'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `SOCHigh` float NOT NULL DEFAULT '0' COMMENT 'µç³Øsoc[Ê£ÓàÈÝÁ¿]ÉÏÏÞ(%)';"); } res = null; //Ìí¼Ó CellDiffVolHigh [ѹ²îÉÏÏÞ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='CellDiffVolHigh'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `CellDiffVolHigh` float NOT NULL DEFAULT '0' COMMENT 'ѹ²îÉÏÏÞ(mV)';"); } /****************************************************************/ res = null; //Ìí¼Ó dcdc1_outputvol [DCDC1Êä³öµçѹ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='dcdc1_outputvol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `dcdc1_outputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC1Êä³öµçѹ';"); } /****************************************************************/ res = null; //Ìí¼Ó dcdc2_outputvol [DCDC2Êä³öµçѹ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='dcdc2_outputvol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `dcdc2_outputvol` float NOT NULL DEFAULT '0' COMMENT 'DCDC2Êä³öµçѹ';"); } /****************************************************************/ res = null; //Ìí¼Ó dcdc1_outputcurr [DCDC1Êä³öÏÞÁ÷Öµ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='dcdc1_outputcurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `dcdc1_outputcurr` float NOT NULL DEFAULT '0' COMMENT 'DCDC1Êä³öÏÞÁ÷Öµ';"); } /****************************************************************/ res = null; //Ìí¼Ó dcdc2_outputcurr [DCDC2Êä³öÏÞÁ÷Öµ] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='dcdc2_outputcurr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `dcdc2_outputcurr` float NOT NULL DEFAULT '0' COMMENT 'DCDC2Êä³öÏÞÁ÷Öµ';"); } /****************************************************************/ res = null; //Ìí¼Ó screensaver_time [½øÈëÆÁÄ»±£»¤Ê±¼ä] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='screensaver_time'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `screensaver_time` int(11) NOT NULL DEFAULT '10' COMMENT '½øÈëÆÁÄ»±£»¤Ê±¼ä£¨²»ÄÜСÓÚ10·ÖÖÓ£©';"); } /****************************************************************/ /****************************************************************/ res = null; //Ìí¼Ó moncap [±ê³ÆÈÝÁ¿] res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_setparam'" + " AND column_name='moncap'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100SetParam_Table + " ADD COLUMN `moncap` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿';"); } /****************************************************************/ } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_offlineyhplan ±í * @param pool * @param recreate */ public static void createFBS9100_offlineyhplan_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100_offlineyhplan; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100_offlineyhplan + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '1'," + " OffLineYH_Cycle int(11) NOT NULL DEFAULT '1'," + " OffLineYHstarttime datetime NOT NULL DEFAULT '2000-01-01 00:00:00'," + " OffLineYHTimes int(11) NOT NULL DEFAULT '0'," + " OffLineYHOnceCycle int(11) NOT NULL DEFAULT '0'," + " note varchar(255) NOT NULL DEFAULT ''," + " PRIMARY KEY (num)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_battparam ±í * @param pool * @param recreate */ public static void createFBS9100BattParam_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100BattParam_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100BattParam_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_ip varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " op_cmd int(11) NOT NULL DEFAULT '0'," + " STD_CAP int(11) NOT NULL DEFAULT '0'," + " STD_RES int(11) NOT NULL DEFAULT '0'," + " BattGroupCount int(11) NOT NULL DEFAULT '0'," + " EachGroupBattCount int(11) NOT NULL DEFAULT '0'," + " MonomerVol float NOT NULL DEFAULT '0'," + " GroupVol float NOT NULL DEFAULT '0'," + " BattTemp float NOT NULL DEFAULT '0'," + " FloatChargeVol float NOT NULL DEFAULT '0'," + " FloatChargeCurr float NOT NULL DEFAULT '0'," + " OnlineVolLow float NOT NULL DEFAULT '0'," + " GroupConnType int(11) NOT NULL DEFAULT '0'," + " BattGroupCountSum int(11) NOT NULL DEFAULT '0'," + " LiBattGroupCount int(11) NOT NULL DEFAULT '0'," + " LiEachGroupBattCount int(11) NOT NULL DEFAULT '0'," + " juncharge_vol float NOT NULL DEFAULT '0' COMMENT '¾ù³äµçѹ'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_uniq (dev_id)" + ") ENGINE=MEMORY DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×Ö¶ÎBattGroupCountSum res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_battparam'" + " AND column_name='BattGroupCountSum'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table + " ADD COLUMN `BattGroupCountSum` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×é×ÜÊý(ǦËá+﮵磬ֻ¶Á)';"); } //Ìí¼Ó×Ö¶ÎLiBattGroupCount res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_battparam'" + " AND column_name='LiBattGroupCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table + " ADD COLUMN `LiBattGroupCount` int(11) NOT NULL DEFAULT '0' COMMENT '﮵ç×éÊý';"); } //Ìí¼Ó×Ö¶ÎLiEachGroupBattCount res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_battparam'" + " AND column_name='LiEachGroupBattCount'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table + " ADD COLUMN `LiEachGroupBattCount` int(11) NOT NULL DEFAULT '0' COMMENT '﮵ç½ÚÊý';"); } //Ìí¼Ó×Ö¶Îjuncharge_vol res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_battparam'" + " AND column_name='juncharge_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100BattParam_Table + " ADD COLUMN `juncharge_vol` float NOT NULL DEFAULT '0' COMMENT '¾ù³äµçѹ';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_bts_station_state ±í * @param pool * @param recreate */ public static void createBTSStationState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BTSStationState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BTSStationState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " station_id bigint(20) NOT NULL DEFAULT '0'," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " record_datetime varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_stat int(11) NOT NULL DEFAULT '0'," + " station_poff_start_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_fadian_start_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_diaozhan_start_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_temp float NOT NULL DEFAULT '0'," + " station_damp float NOT NULL DEFAULT '0'," + " station_dooropen_start_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_xuhang_start_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " station_xuhang_end_time varchar(20) NOT NULL DEFAULT '2015-12-02 12:10:00'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_station_id_uniq (station_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_bts_gprs_state ±í * @param pool * @param recreate */ public static void createBTSGPRSState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BTSGPRSState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BTSGPRSState_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` bigint(20) NOT NULL DEFAULT '0'," + " `op_cmd` int(11) NOT NULL DEFAULT '0'," + " `AT_cmd` varchar(20) NOT NULL DEFAULT ''," + " `ack_inf` varchar(50) NOT NULL DEFAULT ''," + " `bts_task_inf` varchar(1024) NOT NULL DEFAULT ''," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id_uniq` (`dev_id`)" + ") ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×Ö¶Îop_cmd res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_bts_gprs_state'" + " AND column_name='op_cmd'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BTSGPRSState_Table + " ADD COLUMN `op_cmd` int(11) NOT NULL DEFAULT '0';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_bpm7100_state ±í * @param pool * @param recreate */ public static void createBMP7100State_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BMP7100State_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BMP7100State_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_ip varchar(20) NOT NULL DEFAULT '127.0.0.0'," + " dev_id int(11) NOT NULL DEFAULT '0'," + " op_cmd int(11) NOT NULL DEFAULT '0'," + " dev_workstate int(11) NOT NULL DEFAULT '0'," + " dev_worktime bigint(20) NOT NULL DEFAULT '0'," + " dev_commcount int(11) NOT NULL DEFAULT '0'," + " dev_errcommcount int(11) NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)" + ") ENGINE=MEMORY DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_batt_rtstate ±í * @param pool * @param recreate */ public static void createBattRtState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattRtState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattRtState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " BattGroupId int(11) NOT NULL DEFAULT '0'," + " batt_count int(11) NOT NULL DEFAULT '0'," + " rec_datetime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " online_vol float NOT NULL DEFAULT '0'," + " group_vol float NOT NULL DEFAULT '0'," + " group_tmp float NOT NULL DEFAULT '0'," + " group_curr float NOT NULL DEFAULT '0'," + " batt_state int(11) NOT NULL DEFAULT '0'," + " batt_test_type int(11) NOT NULL DEFAULT '0'," + " batt_test_starttime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " batt_test_recordtime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " batt_test_tlong int(11) NOT NULL DEFAULT '0'," + " batt_test_cap float NOT NULL DEFAULT '0'," + " batt_real_cap float NOT NULL DEFAULT '0'," + " batt_rest_cap float NOT NULL DEFAULT '0'," + " batt_rest_power1_time int(11) NOT NULL DEFAULT '0'," + " batt_rest_power2_time int(11) NOT NULL DEFAULT '0'," + " test_loadertype int(11) NOT NULL DEFAULT '0'," + " test_recordnum int(11) NOT NULL DEFAULT '0'," + " `dev_temperature` float NOT NULL DEFAULT '0' COMMENT 'ζȴ«¸ÐÆ÷ζÈ'," + " `dev_humidity` float NOT NULL DEFAULT '0' COMMENT 'ζȴ«¸ÐÆ÷ʪ¶È'," + " `a059_num` int(11) NOT NULL DEFAULT '0' COMMENT 'a059É豸µ±Ç°µç³Ø×é±àºÅ'," + " `dev_testPower` float NOT NULL DEFAULT '0' COMMENT 'É豸ÏûºÄµçÄÜ[wh]ÓÃÓÚÓõçÁ¿Í³¼Æ'," + " PRIMARY KEY (num)," + " KEY index_BattGroupId (BattGroupId)" + ") ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //ζȴ«¸ÐÆ÷ÎÂ¶È res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtstate'" + " AND column_name='dev_temperature'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table + " ADD COLUMN `dev_temperature` float NOT NULL DEFAULT '0' COMMENT 'ζȴ«¸ÐÆ÷ζÈ'"); } //ζȴ«¸ÐÆ÷ʪ¶È res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtstate'" + " AND column_name='dev_humidity'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table + " ADD COLUMN `dev_humidity` float NOT NULL DEFAULT '0' COMMENT 'ζȴ«¸ÐÆ÷ʪ¶È'"); } //a059É豸µ±Ç°µ¥ÌåÊý¾ÝÀ´Ô´µç³Ø×éºÅ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtstate'" + " AND column_name='a059_num'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table + " ADD COLUMN `a059_num` int(11) NOT NULL DEFAULT '0' COMMENT 'a059É豸µ±Ç°µç³Ø×é±àºÅ'"); } //ÐÂÔö×Ö¶Î'dev_testPower' --É豸ÏûºÄµçÄÜ[wh]ÓÃÓÚÓõçÁ¿Í³¼Æ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtstate'" + " AND column_name='dev_testPower'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table + " ADD COLUMN `dev_testPower` float NOT NULL DEFAULT '0' COMMENT 'É豸ÏûºÄµçÄÜ[wh]ÓÃÓÚÓõçÁ¿Í³¼Æ'"); } //ÐÂÔö×Ö¶Î'batt_alm_state' --µç³Ø×鏿¾¯×´Ì¬ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtstate'" + " AND column_name='batt_alm_state'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtState_Table + " ADD COLUMN `batt_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×鏿¾¯×´Ì¬'"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_batt_rtdata ±í * @param pool * @param recreate */ public static void createBattRtData_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattRtData_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattRtData_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " BattGroupId int(11) NOT NULL DEFAULT '0'," + " rec_datetime datetime NOT NULL DEFAULT '1982-01-01 00:00:00'," + " mon_num int(11) NOT NULL DEFAULT '0'," + " mon_vol float NOT NULL DEFAULT '0'," + " mon_tmp float NOT NULL DEFAULT '0'," + " mon_res float NOT NULL DEFAULT '0'," + " mon_ser float NOT NULL DEFAULT '0'," + " mon_conn_res float NOT NULL DEFAULT '0'," + " mon_cap float NOT NULL DEFAULT '0'," + " mon_JH_curr float NOT NULL DEFAULT '0'," + " mon_LY_vol float NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " KEY index_BattGroupId (BattGroupId)" + ") ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //Ìí¼Ó×Ö¶Îmon_JH_curr res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_JH_curr'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN mon_JH_curr float NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Îmon_LY_vol res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_LY_vol'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN mon_LY_vol float NOT NULL DEFAULT '0';"); } //Ìí¼Ó×Ö¶Îmon_test_cap res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_test_cap'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN `mon_test_cap` float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå²âÊÔÈÝÁ¿';"); } //Ìí¼Ó×Ö¶Îmon_dis_timelong res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_dis_timelong'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN `mon_dis_timelong` int(11) NOT NULL DEFAULT '0' COMMENT '·Åµç¿É³ÖÐøÊ±³¤';"); } //Ìí¼Ó×Ö¶Îmon_rest_cap--µ¥ÌåÊ£ÓàÈÝÁ¿ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_rest_cap'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN `mon_rest_cap` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊ£ÓàÈÝÁ¿';"); } //Ìí¼Ó×Ö¶Îmon_state--µ¥Ìå״̬ res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_batt_rtdata'" + " AND column_name='mon_state'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattRtData_Table + " ADD COLUMN `mon_state` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå״̬';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_61850_jhstate ±í * @param pool * @param recreate */ public static void create61850_JHState_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.TB_61850_JHState_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.TB_61850_JHState_Table + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id int(11) NOT NULL DEFAULT '0'," + " dev_version varchar(255) NOT NULL DEFAULT ''," + " input_vol_total double NOT NULL DEFAULT '0'," + " output_vol_total double NOT NULL DEFAULT '0'," + " input_curr_total double NOT NULL DEFAULT '0'," + " output_curr_total double NOT NULL DEFAULT '0'," + " output_vol_one double NOT NULL DEFAULT '0'," + " output_vol_two double NOT NULL DEFAULT '0'," + " output_vol_three double NOT NULL DEFAULT '0'," + " output_vol_four double NOT NULL DEFAULT '0'," + " output_vol_five double NOT NULL DEFAULT '0'," + " output_vol_six double NOT NULL DEFAULT '0'," + " output_vol_seven double NOT NULL DEFAULT '0'," + " output_vol_eight double NOT NULL DEFAULT '0'," + " output_vol_nine double NOT NULL DEFAULT '0'," + " output_vol_ten double NOT NULL DEFAULT '0'," + " dev_temp double NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_unique (dev_id) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=9046 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ cmcc_power_data ±í * @param pool * @param recreate */ public static void createRamDB_CMCC_POWER_Data_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.RamDB_CMCC_POWER_Data; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.RamDB_CMCC_POWER_Data + " (" + " num bigint(20) NOT NULL AUTO_INCREMENT," + " dev_id bigint(20) NOT NULL DEFAULT '0'," + " vol1 float NOT NULL DEFAULT '0'," + " vol2 float NOT NULL DEFAULT '0'," + " vol3 float NOT NULL DEFAULT '0'," + " vol4 float NOT NULL DEFAULT '0'," + " vol5 float NOT NULL DEFAULT '0'," + " curr1 float NOT NULL DEFAULT '0'," + " curr2 float NOT NULL DEFAULT '0'," + " curr3 float NOT NULL DEFAULT '0'," + " curr4 float NOT NULL DEFAULT '0'," + " curr5 float NOT NULL DEFAULT '0'," + " PRIMARY KEY (num)," + " UNIQUE KEY index_dev_id_uniq (dev_id)" + ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_insulatstate ±í * @param pool * @param recreate */ public static void createFBS9100_InsulatstateTable(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100_InsulatstateTable; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100_InsulatstateTable + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `PowerDeviceId` int(11) NOT NULL DEFAULT '1' COMMENT 'µçÔ´id'," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éid'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `dev_version` varchar(64) NOT NULL DEFAULT '' COMMENT 'Эת°æ±¾ºÅ'," + " `insulat_system_vol` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿éϵͳµçѹ'," + " `insulat_ground_vol` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿éÕý¶ÔµØµçѹ'," + " `insulat_negative_vol` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é¸º¶ÔµØµçѹ'," + " `insulat_ground_res` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿éÕý¶ÔµØµç×è'," + " `insulat_negative_res` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é¸º¶ÔµØµç×è'," + " `insulat_batt_res` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿éµç³Ø¶ÔµØµç×è'," + " `insulat_fault_num` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é¹ÊÕÏµç³Ø½ÚÊý'," + " `insulat_ac_vol` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½»Á÷µçѹ'," + " `insulat_system_state` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿éϵͳ״̬'," + " `insulat_record_state` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é˲ʱ¼Ç¼״̬'," + " `insulat_state` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é×°ÖÃ״̬'," + " `insulat_branch_num_1` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é1)'," + " `insulat_branch_res_is_1` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é1)'," + " `insulat_branch_res_ne_1` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é1)'," + " `insulat_branch_num_2` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é2)'," + " `insulat_branch_res_is_2` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é2)'," + " `insulat_branch_res_ne_2` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é2)'," + " `insulat_branch_num_3` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é3)'," + " `insulat_branch_res_is_3` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é3)'," + " `insulat_branch_res_ne_3` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é3)'," + " `insulat_branch_num_4` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é4)'," + " `insulat_branch_res_is_4` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é4)'," + " `insulat_branch_res_ne_4` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é4)'," + " `insulat_branch_num_5` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é5)'," + " `insulat_branch_res_is_5` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é5)'," + " `insulat_branch_res_ne_5` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é5)'," + " `insulat_branch_num_6` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é6)'," + " `insulat_branch_res_is_6` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é6)'," + " `insulat_branch_res_ne_6` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é6)'," + " `insulat_branch_num_7` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é7)'," + " `insulat_branch_res_is_7` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é7)'," + " `insulat_branch_res_ne_7` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é7)'," + " `insulat_branch_num_8` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é8)'," + " `insulat_branch_res_is_8` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é8)'," + " `insulat_branch_res_ne_8` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é8)'," + " `insulat_branch_num_9` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é9)'," + " `insulat_branch_res_is_9` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é9)'," + " `insulat_branch_res_ne_9` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é9)'," + " `insulat_branch_num_10` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é10)'," + " `insulat_branch_res_is_10` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é10)'," + " `insulat_branch_res_ne_10` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é10)'," + " `insulat_branch_num_11` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é11)'," + " `insulat_branch_res_is_11` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é11)'," + " `insulat_branch_res_ne_11` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é11)'," + " `insulat_branch_num_12` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é12)'," + " `insulat_branch_res_is_12` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é12)'," + " `insulat_branch_res_ne_12` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é12)'," + " `insulat_branch_num_13` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é13)'," + " `insulat_branch_res_is_13` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é13)'," + " `insulat_branch_res_ne_13` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é13)'," + " `insulat_branch_num_14` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é14)'," + " `insulat_branch_res_is_14` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é14)'," + " `insulat_branch_res_ne_14` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é14)'," + " `insulat_branch_num_15` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é15)'," + " `insulat_branch_res_is_15` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é15)'," + " `insulat_branch_res_ne_15` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é15)'," + " `insulat_branch_num_16` int(11) NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é½ÓµØÖ§Â·ºÅ(Ä£¿é12)'," + " `insulat_branch_res_is_16` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·Õý¶ÔµØµç×è(Ä£¿é12)'," + " `insulat_branch_res_ne_16` float NOT NULL DEFAULT '0' COMMENT '¾øÔµ¼à²âÄ£¿é֧·¸º¶ÔµØµç×è(Ä£¿é12)'," + " `note` varchar(32) NOT NULL DEFAULT '' COMMENT '±¸ÓÃ'," + " PRIMARY KEY (`num`,`PowerDeviceId`)," + " KEY `index_PowerDeviceId` (`PowerDeviceId`) USING BTREE," + " KEY `index_battgroupid` (`BattGroupId`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //ÒÆ³ý֮ǰµÄÒÔµç³Ø×éidÉèÖõÄΨһË÷Òý res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100_InsulatstateTable+" WHERE KEY_name = 'unique_battgroupid'"); if(res.next()) { sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100_InsulatstateTable+" drop index unique_battgroupid;"); } //Ìí¼Ó×Ö¶ÎPowerDeviceId res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_insulatstate'" + " AND column_name='PowerDeviceId'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100_InsulatstateTable + " ADD COLUMN `PowerDeviceId` int(11) NOT NULL DEFAULT '1' COMMENT 'µçÔ´id'"); } //Ìí¼Ó×Ö¶Îdev_version res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_insulatstate'" + " AND column_name='dev_version'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100_InsulatstateTable + " ADD COLUMN `dev_version` varchar(64) NOT NULL DEFAULT '' COMMENT 'Эת°æ±¾ºÅ';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨ tb_fbs9100_collectionstate ±í * @param pool * @param recreate */ public static void createFBS9100_CollectionstateTable(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100_CollectionstateTable; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100_CollectionstateTable + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `col_version` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷°æ±¾'," + " `col_state` int(11) NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷״̬'," + " `col_vol` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷×éµçѹ'," + " `col_curr` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷×éµçÁ÷'," + " `col_batt_state` int(11) NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷µç³Ø×´Ì¬'," + " `col_curr_dir` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷µçÁ÷·½Ïò'," + " `col_mean_rip_curr` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷ÎÆ²¨µçÁ÷¾ùÖµ'," + " `col_peak_rip_curr` float NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷ÎÆ²¨µçÁ÷·åÖµ'," + " `col_restest_count` int(11) NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷ÄÚ×è²âÊÔ´ÎÊý'," + " `col_restest_type` int(11) NOT NULL DEFAULT '0' COMMENT '»ã¼¯Æ÷ÄÚ×è²âÊÔ·½·¨'," + " `note` varchar(255) NOT NULL DEFAULT '' COMMENT '±¸ÓÃ'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `unique_battgroupid` (`BattGroupId`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_lithium_data ±í * @param pool * @param recreate */ public static void createTb_Lithium_DataTable(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_Lithium_DataTable; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_Lithium_DataTable + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `BattGroupId` int(11) NOT NULL DEFAULT '1000001' COMMENT 'µç³Ø×éID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `envir_tmp` float NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶È'," + " `power_tmp` float NOT NULL DEFAULT '0' COMMENT '¹¦ÂÊζÈ'," + " `rest_cap` float NOT NULL DEFAULT '0' COMMENT 'Ê£ÓàÈÝÁ¿'," + " `remote_control_count` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¨ÒåÒ£¿ØÊýÁ¿'," + " `batt_total_cap` float NOT NULL DEFAULT '0' COMMENT 'µç³Ø×ÜÈÝÁ¿'," + " `batt_cycles` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³ØÑ­»·´ÎÊý'," + " `evir_tmp_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '»·¾³Î¶ȸ澯״̬'," + " `power_tmp_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '¹¦ÂÊζȸ澯״̬'," + " `discharge_curr_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT '³ä·ÅµçµçÁ÷¸æ¾¯×´Ì¬'," + " `batt_totalvol_alm_state` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×ܵçѹ¸æ¾¯×´Ì¬'," + " `custom_alm_count` int(11) NOT NULL DEFAULT '0' COMMENT '×Ô¶¨Ò叿¾¯Á¿ÊýÁ¿'," + " `junheng_event_code` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâʼþ´úÂë'," + " `vol_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'µçѹʼþ´úÂë'," + " `tmp_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ζÈʼþ´úÂë'," + " `curr_event_code` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷ʼþ´úÂë'," + " `fet_state_code` int(11) NOT NULL DEFAULT '0' COMMENT 'FET״̬´úÂë'," + " `junheng_state_code` int(11) NOT NULL DEFAULT '0' COMMENT '¾ùºâ״̬´úÂë'," + " `sys_state_code` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ״̬´úÂë'," + " `note` varchar(255) NOT NULL DEFAULT '' COMMENT '±¸ÓÃ'," + " PRIMARY KEY (`num`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨×é¶ËÐÅÏ¢¸æ¾¯¼Ç¼±í * @param pool * @param recreate */ public static void createTb_Batt_RSAlarm_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_Batt_RSAlarm_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_Batt_RSAlarm_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `BattGroupId` int(11) NOT NULL DEFAULT '1000001' COMMENT 'µç³Ø×éID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `groupvol_alm` tinyint(4) NOT NULL DEFAULT '0' COMMENT '×éµçѹ¸æ¾¯'," + " `test_end_vol` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÖÕÖ¹µçѹ'," + " `test_end_cap` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÖÕֹʣÓàÈÝÁ¿'," + " `test_timelong` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔÖÕֹʱ¼ä(Ãë)'," + " PRIMARY KEY (`num`)," + " KEY `index_BattGroupId` (`BattGroupId`) USING BTREE," + " KEY `index_record_time` (`record_time`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } //System.out.println(sql_str02); sql.sqlMysqlExecute(sql_str02); //Ìí¼Óδ¼Èëµç³Ø×éµÄ×é¶ËÐÅÏ¢ String sql_str03 = "INSERT INTO " + Sql_Mysql.Tb_Batt_RSAlarm_Table + " (BattGroupId)" + " SELECT BattGroupId FROM " + Sql_Mysql.BattInf_Table + " WHERE BattGroupId NOT IN (SELECT BattGroupId FROM " + Sql_Mysql.Tb_Batt_RSAlarm_Table + ")"; //System.out.println(sql_str03); sql.sqlMysqlExecute(sql_str03); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨µ¥ÌåÐÅÏ¢¸æ¾¯¼Ç¼±í * @param pool * @param recreate */ public static void createTb_Batt_RTAlarm_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_Batt_RTAlarm_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_Batt_RTAlarm_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `BattGroupId` int(11) NOT NULL DEFAULT '1000001' COMMENT 'µç³Ø×éid'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `mon_num` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìå±àºÅ'," + " `monvol_alm` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµçѹ¸æ¾¯'," + " `montmp_alm` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåζȸ澯'," + " `monres_alm` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÄÚ×è¸æ¾¯'," + " `monrestcap_alm` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊ£ÓàÈÝÁ¿¸æ¾¯'," + " PRIMARY KEY (`num`)," + " KEY `index_BattGroupId` (`BattGroupId`) USING BTREE," + " KEY `index_record_time` (`record_time`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); ResultSet res_t = sql.sqlMysqlQuery("SELECT BattGroupId,MonCount,FBSDeviceId,PackCount FROM " + Sql_Mysql.BattInf_Table); while(res_t.next()) { int bg_id = res_t.getInt("BattGroupId"); int mon_cnt = res_t.getInt("MonCount"); int packCount = res_t.getInt("PackCount"); int dev_id = res_t.getInt("FBSDeviceId"); if(checkLiBTSDevType(dev_id) && packCount > 0) { mon_cnt = mon_cnt * packCount; } if(mon_cnt > 0){ int max_monnum = BattData_RT_RamDB_Thread_SQL.seachBattRTAlarmMaxMonNum(pool,bg_id); //µ±Ç°µç³Ø×éÔÚ tb_batt_rtdata ±íÖеÄ×î´óµ¥Ìå¸öÊý if(mon_cnt > max_monnum){ //ÐèÒª´Ómax_monnum¿ªÊ¼Ìí¼Óµ¥Ìå¼Ç¼ String sql_str2 = "INSERT INTO " + Sql_Mysql.Tb_Batt_RTAlarm_Table + "(BattGroupId, mon_num)" + " VALUES "; boolean isStart = true; for(int mc = max_monnum; mc < mon_cnt; mc++) { if(isStart) { isStart = false; }else{ sql_str2 += ","; } sql_str2 += "(" + bg_id + "," + (mc+1) + ")"; } System.out.println("µç³Ø×é"+bg_id+"´Óµ¥Ìå"+(max_monnum+1)+"¿ªÊ¼ÔÚtb_batt_rtdata±íÖÐÌí¼Óµ¥ÌåÊý¾Ý at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); sql.sqlMysqlExecute(sql_str2); }else if(mon_cnt < max_monnum){ //ɾ³ýµ±Ç°µç³Ø×éÖг¬¹ýµ¥Ìå¸öÊýµÄÊý¾Ý String sql_str2 = " DELETE FROM " + Sql_Mysql.Tb_Batt_RTAlarm_Table + " WHERE BattGroupId = " +bg_id+ " AND mon_num > "+mon_cnt; sql.sqlMysqlExecute(sql_str2); System.out.println("µç³Ø×é"+bg_id+"´Óµ¥Ìå"+(mon_cnt+1)+"¿ªÊ¼É¾³ýtb_batt_rtdataµ¥ÌåÊý¾Ý at "+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); } } } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨ tb_fbs9100_chargerstate ±í * @param pool * @param recreate */ public static void createFBS9100_ChargerstateTable(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100_ChargerstateTable; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100_ChargerstateTable + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," + " `PowerDeviceId` int(11) NOT NULL DEFAULT '1' COMMENT 'µçÔ´id'," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éID'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `dev_version` varchar(64) NOT NULL DEFAULT '' COMMENT 'Эת°æ±¾ºÅ'," + " `char_output_vol` float NOT NULL DEFAULT '0' COMMENT '³äµç»úÊä³öµçѹ'," + " `char_output_curr` float NOT NULL DEFAULT '0' COMMENT '³äµç»úÊä³öµçÁ÷'," + " `char_peak_rip_vol` float NOT NULL DEFAULT '0' COMMENT 'ÎÆ²¨·åÖµ'," + " `char_peak_rip_param` float NOT NULL DEFAULT '0' COMMENT 'ÎÆ²¨·åֵϵÊý'," + " `char_Uan` float NOT NULL DEFAULT '0' COMMENT 'Uan'," + " `char_Ian` float NOT NULL DEFAULT '0' COMMENT 'Ian'," + " `char_Ubn` float NOT NULL DEFAULT '0' COMMENT 'Ubn'," + " `char_Ibn` float NOT NULL DEFAULT '0' COMMENT 'Ibn'," + " `char_Ucn` float NOT NULL DEFAULT '0' COMMENT 'Ucn'," + " `char_Icn` float NOT NULL DEFAULT '0' COMMENT 'Icn'," + " `char_system_state` int(11) NOT NULL DEFAULT '0' COMMENT 'ϵͳ״̬'," + " `note` varchar(255) NOT NULL DEFAULT '' COMMENT '±¸ÓÃ'," + " PRIMARY KEY (`num`)," + " KEY `index_battgroupid` (`BattGroupId`) USING BTREE," + " KEY `index_PowerDeviceId` (`PowerDeviceId`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); //ÒÆ³ý֮ǰµÄÒÔµç³Ø×éidÉèÖõÄΨһË÷Òý res = sql.sqlMysqlQuery("show INDEX FROM "+Sql_Mysql.FBS9100_ChargerstateTable+" WHERE KEY_name = 'unique_battgroupid'"); if(res.next()) { sql.sqlMysqlExecute("alter table "+Sql_Mysql.FBS9100_ChargerstateTable+" drop index unique_battgroupid;"); } //Ìí¼Ó×Ö¶ÎPowerDeviceId res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_chargerstate'" + " AND column_name='PowerDeviceId'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100_ChargerstateTable + " ADD COLUMN `PowerDeviceId` int(11) NOT NULL DEFAULT '1' COMMENT 'µçÔ´id';"); } //Ìí¼Ó×Ö¶Îdev_version res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100_chargerstate'" + " AND column_name='dev_version'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.FBS9100_ChargerstateTable + " ADD COLUMN `dev_version` varchar(64) NOT NULL DEFAULT '' COMMENT 'Эת°æ±¾ºÅ';"); } } catch (SQLException e) { e.printStackTrace(); } finally { if(null != res) { try { res.close(); } catch (SQLException e) { e.printStackTrace(); } } sql.close_con(); } } /** * ´´½¨¸É½Óµã״̬±í * @param pool * @param recreate */ private static void createFBS9100s_stemnode_state_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100s_stemnode_state_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100s_stemnode_state_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `dryInputState` int(11) NOT NULL DEFAULT '0' COMMENT '¸É½ÚµãÊäÈë״̬'," + " `dryOutputState` int(11) NOT NULL DEFAULT '0' COMMENT '¸É½ÚµãÊä³ö״̬'," + " `volOutputState` int(11) NOT NULL DEFAULT '0' COMMENT '¸É½ÚµãµçѹÊä³ö״̬'," + " `sumOutputVolt` float NOT NULL DEFAULT '0' COMMENT '×ÜÊä³öµçѹ'," + " `sumOutputCur` float NOT NULL DEFAULT '0' COMMENT '×ÜÊä³öµçÁ÷'," + " `outputVolt1` float NOT NULL DEFAULT '0' COMMENT 'Êä³öµçѹ1'," + " `outputVolt2` float NOT NULL DEFAULT '0' COMMENT 'Êä³öµçѹ2'," + " `outputVolt3` float NOT NULL DEFAULT '0' COMMENT 'Êä³öµçѹ3'," + " `outputVolt4` float NOT NULL DEFAULT '0' COMMENT 'Êä³öµçѹ4'," + " `mode_state` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é×Ü״̬'," + " `drynode_commst` int(11) NOT NULL DEFAULT '43690' COMMENT '¸É½ÓµãͨÐÅ״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)'," + " `k1_check_st` int(11) NOT NULL DEFAULT '43690' COMMENT '½Ó´¥Æ÷k1¼ì²â״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)'," + " `k2_check_st` int(11) NOT NULL DEFAULT '43690' COMMENT '½Ó´¥Æ÷k2¼ì²â״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)'," + " `urgentswitch_st` int(11) NOT NULL DEFAULT '43690' COMMENT '¼±Í£×´Ì¬(0xAAAA-δ´¥·¢ 0xBBBB-´¥·¢)'," + " `bypassswitch_st` int(11) NOT NULL DEFAULT '43690' COMMENT 'ÅÔ·״̬£¨0xAAAA-δ½ÓÈë 0xBBBB-½ÓÈëÅÔ·£©'," + " `k1_st` int(11) NOT NULL DEFAULT '0' COMMENT '½Ó´¥Æ÷k1״̬£¨0-¶Ï¿ª 1-±ÕºÏ£©'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='mode_state'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `mode_state` int(11) NOT NULL DEFAULT '0' COMMENT 'Ä£¿é×Ü״̬';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='drynode_commst'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `drynode_commst` int(11) NOT NULL DEFAULT '43690' COMMENT '¸É½ÓµãͨÐÅ״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='k1_check_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `k1_check_st` int(11) NOT NULL DEFAULT '43690' COMMENT '½Ó´¥Æ÷k1¼ì²â״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='k2_check_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `k2_check_st` int(11) NOT NULL DEFAULT '43690' COMMENT '½Ó´¥Æ÷k2¼ì²â״̬(0xAAAA-Õý³£ 0xBBBB-Òì³£)';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='urgentswitch_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `urgentswitch_st` int(11) NOT NULL DEFAULT '43690' COMMENT '¼±Í£×´Ì¬(0xAAAA-δ´¥·¢ 0xBBBB-´¥·¢)';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='bypassswitch_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `bypassswitch_st` int(11) NOT NULL DEFAULT '43690' COMMENT 'ÅÔ·״̬£¨0xAAAA-δ½ÓÈë 0xBBBB-½ÓÈëÅÔ·£©';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='k1_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `k1_st` int(5) NOT NULL DEFAULT '0' COMMENT '×é1½Ó´¥Æ÷k״̬£¨0-¶Ï¿ª 1-±ÕºÏ£©';"); } res = sql.sqlMysqlTotalQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fbs9100s_stemnode_state'" + " AND column_name='k2_st'"); if(false == res.next()) { sql.sqlMysqlTotalExecute("ALTER TABLE " + Sql_Mysql.FBS9100s_stemnode_state_Table + " ADD COLUMN `k2_st` int(5) NOT NULL DEFAULT '0' COMMENT '×é2½Ó´¥Æ÷k״̬£¨0-¶Ï¿ª 1-±ÕºÏ£©';"); } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨Ä¸Áª×´Ì¬±í * @param pool * @param recreate */ private static void createFBS9100s_buscouple_state_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.FBS9100s_buscouple_state_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.FBS9100s_buscouple_state_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '912000001' COMMENT 'É豸id'," + " `record_time` datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '¼Ç¼ʱ¼ä'," + " `fanglei_state` int(11) NOT NULL DEFAULT '0' COMMENT '·ÀÀ×״̬:0:δÁ¬½Ó;1:Õý³£¹¤×÷;2ÐèÒª¸ü»»·ÀÀ×É豸'," + " `workstate` int(11) NOT NULL DEFAULT '0' COMMENT '¹¤×÷״̬'," + " `rlayworkmode` int(11) NOT NULL DEFAULT '0' COMMENT '¿Õ¿ª²Ù×÷״̬'," + " `rlyAstate` int(11) NOT NULL DEFAULT '0' COMMENT '¿ª¹ØÊäÈëON״̬'," + " `rlyBstate` int(11) NOT NULL DEFAULT '0' COMMENT '¿ª¹ØÊäÈëOFF״̬'," + " `stopreson` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò'," + " `volt_m1` float NOT NULL DEFAULT '0' COMMENT 'µçѹ1'," + " `volt_m2` float NOT NULL DEFAULT '0' COMMENT 'µçѹ2'," + " `iout` float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷'," + " `curdir` int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷·½Ïò'," + " `commustate` int(11) NOT NULL DEFAULT '0' COMMENT 'ͨÐÅ״̬'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * ´´½¨³ä·ÅµçÒ»Ìå»úÏÂÔØ¿ØÖƱí * @param pool * @param recreate */ private static void createFgcd_filedownload_Table(MysqlConnPool pool, boolean recreate) { String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Fgcd_filedownload_Table; String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Fgcd_filedownload_Table + " (" + " `num` bigint(20) NOT NULL AUTO_INCREMENT," + " `dev_id` int(11) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + " `BattGroupId` int(11) NOT NULL DEFAULT '0' COMMENT 'µç³Ø×éID'," + " `op_cmd` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃüÁî'," + " `file_total` int(11) NOT NULL DEFAULT '0' COMMENT '×ܵÄÎļþÊýÄ¿'," + " `file_count` int(11) NOT NULL DEFAULT '0' COMMENT 'µ±Ç°Ò³Êý¾ÝÎļþÊý'," + " `file_index` int(11) NOT NULL DEFAULT '0' COMMENT 'ÐèÒªÏÂÔØÎļþË÷Òý'," + " `file_name1` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû1'," + " `file_index1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý1'," + " `test_timelong1` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤1'," + " `data_type1` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ1'," + " `test_curr1` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷1'," + " `test_cap1` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿1'," + " `cap_std1` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿1'," + " `mon_count1` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿1'," + " `mon_vol1` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ1'," + " `stop_type1` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò1'," + " `download_flag1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ1'," + " `download_state1` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬1'," + " `file_name2` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû2'," + " `file_index2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý2'," + " `test_timelong2` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤2'," + " `data_type2` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ2'," + " `test_curr2` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷2'," + " `test_cap2` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿2'," + " `cap_std2` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿2'," + " `mon_count2` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿2'," + " `mon_vol2` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ2'," + " `stop_type2` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò2'," + " `download_flag2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ2'," + " `download_state2` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬2'," + " `file_name3` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû3'," + " `file_index3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý3'," + " `test_timelong3` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤3'," + " `data_type3` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ3'," + " `test_curr3` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷3'," + " `test_cap3` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿3'," + " `cap_std3` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿3'," + " `mon_count3` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿3'," + " `mon_vol3` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ3'," + " `stop_type3` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò3'," + " `download_flag3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ3'," + " `download_state3` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬3'," + " `file_name4` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû4'," + " `file_index4` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý4'," + " `test_timelong4` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤4'," + " `data_type4` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ4'," + " `test_curr4` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷4'," + " `test_cap4` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿4'," + " `cap_std4` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿4'," + " `mon_count4` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿4'," + " `mon_vol4` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ4'," + " `download_flag4` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ4'," + " `download_state4` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬4'," + " `stop_type4` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò4'," + " `file_name5` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû5'," + " `file_index5` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý5'," + " `test_timelong5` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤5'," + " `data_type5` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ5'," + " `test_curr5` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷5'," + " `test_cap5` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿5'," + " `cap_std5` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿5'," + " `mon_count5` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿5'," + " `mon_vol5` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ5'," + " `stop_type5` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò5'," + " `download_flag5` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ5'," + " `download_state5` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬5'," + " `file_name6` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû6'," + " `file_index6` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý6'," + " `test_timelong6` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤6'," + " `data_type6` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ6'," + " `test_curr6` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷6'," + " `test_cap6` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿6'," + " `cap_std6` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿6'," + " `mon_count6` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿6'," + " `mon_vol6` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ6'," + " `stop_type6` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò6'," + " `download_flag6` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ6'," + " `download_state6` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬6'," + " `file_name7` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû7'," + " `file_index7` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý7'," + " `test_timelong7` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤7'," + " `data_type7` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ7'," + " `test_curr7` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷7'," + " `test_cap7` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿7'," + " `cap_std7` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿7'," + " `mon_count7` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿7'," + " `mon_vol7` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ7'," + " `stop_type7` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò7'," + " `download_flag7` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬7'," + " `download_state7` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬7'," + " `file_name8` varchar(255) NOT NULL DEFAULT '' COMMENT 'ÎļþÃû8'," + " `file_index8` int(11) NOT NULL DEFAULT '0' COMMENT 'ÎļþË÷Òý8'," + " `test_timelong8` int(11) NOT NULL DEFAULT '0' COMMENT '²âÊÔʱ³¤8'," + " `data_type8` int(11) NOT NULL DEFAULT '0' COMMENT 'Êý¾ÝÀàÐÍ8'," + " `test_curr8` float NOT NULL DEFAULT '0' COMMENT '²âÊÔµçÁ÷8'," + " `test_cap8` float NOT NULL DEFAULT '0' COMMENT '²âÊÔÈÝÁ¿8'," + " `cap_std8` int(11) NOT NULL DEFAULT '0' COMMENT '±ê³ÆÈÝÁ¿8'," + " `mon_count8` int(11) NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÊýÁ¿8'," + " `mon_vol8` float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹÀàÐÍ8'," + " `stop_type8` int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹Ô­Òò8'," + " `download_flag8` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ±êʶ8'," + " `download_state8` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬8'," + " `stop_reason` int(11) NOT NULL DEFAULT '0' COMMENT 'Ò쳣ֹͣԭÒò'," + " `download_state` int(11) NOT NULL DEFAULT '0' COMMENT 'ÏÂÔØ×´Ì¬[1:ÏÂÔØÎļþ;2:Éú³ÉÎļþ;3:½âÎöÊý¾Ý;4:µ¼ÈëÍê³É]'," + " `now_data_block` int(11) NOT NULL DEFAULT '0' COMMENT 'µ±Ç°ÏÂÔØ½ø¶È'," + " `total_data_block` int(11) NOT NULL DEFAULT '0' COMMENT '×ܵÄÊý¾Ý¿éÊý'," + " PRIMARY KEY (`num`)," + " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" + ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;"; Sql_Mysql sql = new Sql_Mysql(pool.getConn()); ResultSet res = null; try { if(true == recreate) { sql.sqlMysqlExecute(sql_str01); } sql.sqlMysqlExecute(sql_str02); for(int i=0;i<8;i++) { //Ìí¼Ó×Ö¶ÎLiBattGroupCount res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fgcd_filedownload'" + " AND column_name='now_data_block"+(i+1)+"'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Fgcd_filedownload_Table + " ADD COLUMN `now_data_block"+(i+1)+"` int(11) NOT NULL DEFAULT '0' COMMENT 'Îļþ"+(i+1)+"µ±Ç°ÏÂÔØ½ø¶È';"); } //Ìí¼Ó×Ö¶ÎLiBattGroupCount res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" + " WHERE table_schema='db_ram_db'" + " AND table_name='tb_fgcd_filedownload'" + " AND column_name='total_data_block"+(i+1)+"'"); if(false == res.next()) { sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Fgcd_filedownload_Table + " ADD COLUMN `total_data_block"+(i+1)+"` int(11) NOT NULL DEFAULT '0' COMMENT 'Îļþ"+(i+1)+"×ܵÄÊý¾Ý¿éÊý';"); } } } catch (SQLException e) { e.printStackTrace(); } finally { sql.close_con(); } } /** * УÑ鵱ǰÉ豸ÊÇ·ñÊÇ﮵çBTS * @param dev_id * @return */ public static boolean checkLiBTSDevType(int dev_id) { if(dev_id/100000 == 9131) { return true; } return false; } }