| | |
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | |
| | | //插入负载默认数据
|
| | | public static void insertDynamicload(MysqlConnPool conn_pool, Dynamicload_State_rt state) {
|
| | | String sql_str = " replace into " + Sql_Mysql.Tb_Dynamicload_State_Rt_Table + "(dev_id) values("+state.getDev_id()+")";
|
| | | Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
| | | try {
|
| | | //System.out.println(sql_str);
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | //加载负载实时数据
|
| | | public static void updateDynamicload(MysqlConnPool conn_pool, Dynamicload_State_rt state) {
|
| | | String sql_str = " UPDATE " + Sql_Mysql.Tb_Dynamicload_State_Rt_Table
|
| | |
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | //插入4MW电源默认数据
|
| | | public static void insert4MWPower(MysqlConnPool conn_pool, Electric_state state) {
|
| | | String sql_str = " replace into " + Sql_Mysql.Tb_Electric_State_Table + "(electric_id) values("+state.getElectric_id()+")";
|
| | | Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
| | | try {
|
| | | //System.out.println(sql_str);
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | //加载4MW电源实时数据
|
| | | public static void update4MWPower(MysqlConnPool conn_pool, Electric_state state) {
|
| | | String sql_str = " update "+ Sql_Mysql.Tb_Electric_State_Table +" "
|
| | |
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | //插入2MW电源默认数据
|
| | | public static void insert2MWPower(MysqlConnPool conn_pool, Electric_State_2kw state) {
|
| | | String sql_str = " replace into " + Sql_Mysql.Tb_Electric2mw_State_Table + "(electric2KW_id) values("+state.getElectric2KW_id()+")";
|
| | | Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
| | | try {
|
| | | //System.out.println(sql_str);
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | sql.close_con();
|
| | | }
|
| | | }
|
| | | //加载2MW电源实时数据
|
| | | public static void update2MWPower(MysqlConnPool conn_pool, Electric_State_2kw state) {
|
| | | String sql_str = " UPDATE "+Sql_Mysql.Tb_Electric2mw_State_Table +
|