package com.electrical.TwoKW;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.List;
|
|
import com.sql.MysqlConnPool;
|
import com.sql.Sql_Mysql;
|
|
public class Electrical_2KWTask_SQL {
|
|
/**
|
* ³õʼ»¯Êý¾Ý¿â±í
|
* @param pool
|
*/
|
public static void init(MysqlConnPool pool) {
|
createDB_Electric2MWSystem(pool);
|
|
createTb_electric2MW_inf(pool);
|
|
//initTb_electric2MW_inf(pool);
|
|
createTb_electric2MW_rt(pool);
|
|
createTb_electric2MW_control(pool);
|
|
|
createTb_electric2MW_state(pool);
|
|
}
|
|
/**
|
* ³õʼ»¯¸ºÔØÐÅÏ¢±í
|
* @param pool
|
*/
|
public static void initTb_electric2MW_inf(MysqlConnPool pool) {
|
String sql_str= " replace INTO " + Sql_Mysql.Tb_electric2MW_inf + "(electric2KW_id,electric2KW_ip,electric2KW_name,electric2KW_type) VALUES(6001,'127.0.0.1','2MW','1'),(6002,'127.0.0.1','2MW','1')";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
/**
|
* ´´½¨2MWµçԴϵͳÊý¾Ý¿â
|
* @param pool
|
*/
|
public static void createDB_Electric2MWSystem(MysqlConnPool pool) {
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute("CREATE DATABASE IF NOT EXISTS " + Sql_Mysql.DB_Electric2MWSystem);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
/**
|
* ´´½¨2MWÐÅÏ¢±í
|
* @param pool
|
*/
|
public static void createTb_electric2MW_inf(MysqlConnPool pool) {
|
String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_electric2MW_inf + " (" +
|
" num bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," +
|
" electric2KW_id int(11) NOT NULL DEFAULT '5001' COMMENT 'µçÔ´id'," +
|
" electric2KW_ip varchar(255) NOT NULL DEFAULT '127.0.0.1' COMMENT 'µçÔ´ip'," +
|
" electric2KW_name varchar(255) NOT NULL DEFAULT 'A×é' COMMENT 'µçÔ´Ãû³Æ'," +
|
" electric2KW_type int(11) NOT NULL DEFAULT '2' COMMENT 'µçÔ´ÀàÐÍ'," +
|
" note varchar(255) NOT NULL DEFAULT ''," +
|
" PRIMARY KEY (num)," +
|
" UNIQUE KEY electric2KW_id_key (electric2KW_id) USING BTREE " +
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
/**
|
* ´´½¨2MWʵʱÐÅÏ¢±í
|
* @param pool
|
*/
|
public static void createTb_electric2MW_rt(MysqlConnPool pool) {
|
String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_electric2MW_rt + " (" +
|
" num bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," +
|
" electric2KW_id int(11) NOT NULL DEFAULT '5001' COMMENT 'µçÔ´id'," +
|
" upper_pulse_block int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏλ»úÂö³å·âËø'," +
|
" consvolcurrstatus int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹºãÁ÷ģʽ״̬'," +
|
" constantvolflag int(11) NOT NULL DEFAULT '0' COMMENT '4²¢»ò2´®2²¢ºãѹ±ê־λ'," +
|
" main_circuit_connmode int(11) NOT NULL DEFAULT '0' COMMENT 'Ö÷µç·Á¬½Óģʽ'," +
|
" remote_start int(11) NOT NULL DEFAULT '0' COMMENT 'Ô¶³ÌÆô¶¯'," +
|
" fault_reset int(11) NOT NULL DEFAULT '0' COMMENT '¹ÊÕϸ´Î»'," +
|
" conscurrswitch int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷Çл»'," +
|
" constantvol float NOT NULL DEFAULT '0' COMMENT 'A»ú×é4²¢»ò2´®2²¢ºãѹ'," +
|
" volset_confirm int(11) NOT NULL DEFAULT '0' COMMENT 'µçѹ¸ø¶¨È·ÈÏ'," +
|
" currset_confirm int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷¸ø¶¨È·ÈÏ'," +
|
" remote_stop int(11) NOT NULL DEFAULT '0' COMMENT 'Ô¶³ÌÍ£Ö¹'," +
|
" start_screen_set int(11) NOT NULL DEFAULT '0' COMMENT 'Æô¶¯´¥ÃþÆÁ¸ø¶¨'," +
|
" start_upper_set int(11) NOT NULL DEFAULT '0' COMMENT 'Æô¶¯ÉÏλ»ú¸ø¶¨'," +
|
" consvolswitch int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹÇл»'," +
|
" othermode int(11) NOT NULL DEFAULT '0' COMMENT '4²¢»ò2´®2²¢ÒÔÍâģʽ'," +
|
" consvol_distribution int(11) NOT NULL DEFAULT '0' COMMENT 'ËÄ´®ºãѹµçѹ·ÖÅäλ'," +
|
" local_remote_control int(11) NOT NULL DEFAULT '0' COMMENT '¾ÍµØÔ¶³Ì¿ØÖÆ×´Ì¬'," +
|
|
" pulse_blocking int(11) NOT NULL DEFAULT '0' COMMENT 'Âö³å·âËø'," +
|
" dc_voltage_state int(11) NOT NULL DEFAULT '0' COMMENT '¸ßѹ¿ª¹Ø×´Ì¬'," +
|
|
" curve_charge_mode int(11) NOT NULL DEFAULT '0' COMMENT 'ÇúÏß³äµçģʽ״̬'," +
|
" start_curve_charge_mode int(11) NOT NULL DEFAULT '0' COMMENT 'Æô¶¯ÇúÏß³äµçģʽ'," +
|
" stop_curve_charge_mode int(11) NOT NULL DEFAULT '0' COMMENT 'Í£Ö¹ÇúÏß³äµçģʽ'," +
|
" note varchar(255) NOT NULL DEFAULT ''," +
|
" PRIMARY KEY (num)," +
|
" UNIQUE KEY electric2KW_id_key (electric2KW_id) USING BTREE " +
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
/**
|
* ´´½¨2MWʵʱÐÅϢ״̬±í
|
* @param pool
|
*/
|
public static void createTb_electric2MW_state(MysqlConnPool pool) {
|
String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_electric2MW_state + " (" +
|
" num bigint(20) NOT NULL AUTO_INCREMENT," +
|
" electric2KW_id int(11) NOT NULL," +
|
" brachdcvol float NOT NULL DEFAULT '0' COMMENT '·ÖÖ±Á÷µçѹ'," +
|
" brachdccurr float NOT NULL DEFAULT '0' COMMENT '·ÖÖ±Á÷µçÁ÷'," +
|
" alldcvol float NOT NULL DEFAULT '0' COMMENT '×ÜÖ±Á÷µçѹ'," +
|
" alldccurr float NOT NULL DEFAULT '0' COMMENT '×ÜÖ±Á÷µçÁ÷'," +
|
" stopchargevol_one float NOT NULL DEFAULT '0' COMMENT 'µÚ1½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_two float NOT NULL DEFAULT '0' COMMENT 'µÚ2½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_three float NOT NULL DEFAULT '0' COMMENT 'µÚ3½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_four float NOT NULL DEFAULT '0' COMMENT 'µÚ4½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_five float NOT NULL DEFAULT '0' COMMENT 'µÚ5½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" controlangle float NOT NULL DEFAULT '0' COMMENT '¿ØÖƽÇ'," +
|
" localgivevol float NOT NULL DEFAULT '0' COMMENT 'µ±Ç°¸ø¶¨µçѹ'," +
|
" volset float NOT NULL DEFAULT '0' COMMENT 'µçѹÉ趨ֵ'," +
|
" localgivecurr float NOT NULL DEFAULT '0' COMMENT 'µ±Ç°¸ø¶¨µçÁ÷'," +
|
" currset float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷É趨ֵ'," +
|
" chargecurr_one float NOT NULL DEFAULT '0' COMMENT 'µÚ1½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_two float NOT NULL DEFAULT '0' COMMENT 'µÚ2½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_three float NOT NULL DEFAULT '0' COMMENT 'µÚ3½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_four float NOT NULL DEFAULT '0' COMMENT 'µÚ4½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_five float NOT NULL DEFAULT '0' COMMENT 'µÚ5½×¶Î³äµçµçÁ÷Öµ'," +
|
" consvolmode_chargecurr float NOT NULL DEFAULT '0' COMMENT 'תΪºãѹģʽ³äµçµçѹֵ'," +
|
" note varchar(255) NOT NULL DEFAULT '' COMMENT '±¸ÓÃ'," +
|
" PRIMARY KEY (num)," +
|
" KEY index_electric2KW_id (electric2KW_id) USING BTREE" +
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
|
|
|
/**
|
* ´´½¨2MW¿ØÖÆÐÅÏ¢±í
|
* @param pool
|
*/
|
public static void createTb_electric2MW_control(MysqlConnPool pool) {
|
String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_electric2MW_control + " (" +
|
" num bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," +
|
" electric2KW_id int(11) NOT NULL DEFAULT '5001' COMMENT 'µçÔ´id'," +
|
" consvolmode_chargecurr float NOT NULL DEFAULT '0' COMMENT 'תΪºãѹģʽ³äµçµçѹֵ'," +
|
" chargecurr_five float NOT NULL DEFAULT '0' COMMENT 'µÚ5½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_four float NOT NULL DEFAULT '0' COMMENT 'µÚ4½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_three float NOT NULL DEFAULT '0' COMMENT 'µÚ3½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_two float NOT NULL DEFAULT '0' COMMENT 'µÚ2½×¶Î³äµçµçÁ÷Öµ'," +
|
" chargecurr_one float NOT NULL DEFAULT '0' COMMENT 'µÚ1½×¶Î³äµçµçÁ÷Öµ'," +
|
" currset float NOT NULL DEFAULT '0' COMMENT 'µçÁ÷É趨ֵ'," +
|
" volset float NOT NULL DEFAULT '0' COMMENT 'µçѹÉ趨ֵ'," +
|
" stopchargevol_five float NOT NULL DEFAULT '0' COMMENT 'µÚ5½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_four float NOT NULL DEFAULT '0' COMMENT 'µÚ4½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_three float NOT NULL DEFAULT '0' COMMENT 'µÚ3½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_two float NOT NULL DEFAULT '0' COMMENT 'µÚ2½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" stopchargevol_one float NOT NULL DEFAULT '0' COMMENT 'µÚ1½×¶Î³äµçÖÕÖ¹µçѹ'," +
|
" upper_pulse_block int(11) NOT NULL DEFAULT '0' COMMENT 'ÉÏλ»úÂö³å·âËø'," +
|
" remote_start int(11) NOT NULL DEFAULT '0' COMMENT 'Ô¶³ÌÆô¶¯'," +
|
" fault_reset int(11) NOT NULL DEFAULT '0' COMMENT '¹ÊÕϸ´Î»'," +
|
" conscurrswitch int(11) NOT NULL DEFAULT '0' COMMENT 'ºãÁ÷Çл»'," +
|
" constantvol int(11) NOT NULL DEFAULT '0' COMMENT '4²¢»ò2´®2²¢ºãѹ'," +
|
" volset_confirm int(11) NOT NULL DEFAULT '0' COMMENT 'µçѹ¸ø¶¨È·ÈÏ'," +
|
" currset_confirm int(11) NOT NULL DEFAULT '0' COMMENT 'µçÁ÷¸ø¶¨È·ÈÏ'," +
|
" remote_stop int(11) NOT NULL DEFAULT '0' COMMENT 'Ô¶³ÌÍ£Ö¹'," +
|
" start_screen_set int(11) NOT NULL DEFAULT '0' COMMENT 'Æô¶¯´¥ÃþÆÁ¸ø¶¨'," +
|
" start_upper_set int(11) NOT NULL DEFAULT '0' COMMENT 'Æô¶¯ÉÏλ»ú¸ø¶¨'," +
|
" consvolswitch int(11) NOT NULL DEFAULT '0' COMMENT 'ºãѹÇл»'," +
|
" othermode int(11) NOT NULL COMMENT '4²¢»ò2´®2²¢ÒÔÍâģʽ'," +
|
" consvol_distribution int(11) NOT NULL DEFAULT '0' COMMENT 'ËÄ´®ºãѹµçѹ·ÖÅäλ'," +
|
" PRIMARY KEY (num)," +
|
" UNIQUE KEY electric2KW_id_key (electric2KW_id) USING BTREE" +
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
/**
|
* ²éѯËùÓеÄ2mwµçԴϵͳ
|
* @param pool
|
* @param electric
|
*/
|
public static void queryAllElectrical2MW(MysqlConnPool pool,List<Electric_inf_2kw> einfs) {
|
String sql_str = " select * from " + Sql_Mysql.Tb_electric2MW_inf+ " order by electric2KW_id asc ";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
ResultSet res = null;
|
try {
|
res = sql.sqlMysqlQuery(sql_str);
|
while(res.next()) {
|
Electric_inf_2kw einf=new Electric_inf_2kw();
|
einf.setElectric2KW_id(res.getInt("electric2kw_id"));
|
einf.setElectric2KW_ip(res.getString("electric2kw_ip"));
|
einf.setElectric2KW_name(res.getString("electric2kw_name"));
|
einf.setElectric2KW_type(res.getInt("electric2kw_type"));
|
einfs.add(einf);
|
}
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
if(res != null) {
|
try {
|
res.close();
|
} catch (SQLException e) {
|
e.printStackTrace();
|
}
|
}
|
sql.close_con();
|
}
|
}
|
|
//²åÈë»ò¸üÐÂ2mwµçԴϵͳʵʱÐÅÏ¢±í
|
public static void replace_electric2MW_rt(MysqlConnPool pool,Electric_Rt_2kw ert) {
|
String sql_str = " replace into "+ Sql_Mysql.Tb_electric2MW_rt+"(electric2KW_id) "
|
+ " values("+ert.electric2KW_id+")";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
//²åÈë»ò¸üÐÂ2mwµçԴϵͳÐÅÏ¢±í
|
public static void replace_electric2MW_inf(MysqlConnPool pool,Electric_inf_2kw einf) {
|
String sql_str = " replace into "+ Sql_Mysql.Tb_electric2MW_inf+"(electric2KW_id) "
|
+ " values("+einf.electric2KW_id+")";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
//²åÈë»ò¸üÐÂ2mwµçÔ´¿ØÖÆÐÅÏ¢±í
|
public static void replace_electric2MW_Control(MysqlConnPool pool,Electric_Control_Single_2kw econtrol) {
|
String sql_str = " replace into "+ Sql_Mysql.Tb_electric2MW_control+"(electric2KW_id) "
|
+ " values("+econtrol.electric2KW_id+")";
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
//¸üÐÂ2mwµçԴʵʱÐÅÏ¢±í
|
public static void update_Electric_Rt_2KW(MysqlConnPool pool,Electric_Rt_2kw ert) {
|
String sql_str = " UPDATE "+ Sql_Mysql.Tb_electric2MW_rt +""
|
+ " SET upper_pulse_block = "+ert.upper_pulse_block+","
|
+ " consvolcurrstatus = "+ert.consvolcurrstatus+","
|
+ " constantvolflag = "+ert.constantvolflag+","
|
+ " main_circuit_connmode = "+ert.main_circuit_connmode+","
|
+ " remote_start = "+ert.remote_start+","
|
+ " fault_reset = "+ert.fault_reset+","
|
+ " conscurrswitch = "+ert.conscurrswitch+","
|
+ " constantvol = "+ert.constantvol+","
|
+ " volset_confirm = "+ert.volset_confirm+","
|
+ " currset_confirm = "+ert.currset_confirm+","
|
+ " remote_stop = "+ert.remote_stop+","
|
+ " start_screen_set = "+ert.start_screen_set+","
|
+ " start_upper_set = "+ert.start_upper_set+","
|
+ " consvolswitch = "+ert.consvolswitch+","
|
+ " othermode = "+ert.othermode+","
|
+ " consvol_distribution = "+ert.consvol_distribution+","
|
+ " local_remote_control = "+ert.local_remote_control+","
|
|
+ " pulse_blocking = "+ert.pulse_blocking+"," //Âö³å·âËø
|
+ " dc_voltage_state = "+ert.dc_voltage_state+"," //¸ßѹ¿ª¹Ø×´Ì¬
|
|
+ " curve_charge_mode = "+ert.curve_charge_mode+","
|
+ " start_curve_charge_mode = "+ert.start_curve_charge_mode+","
|
+ " stop_curve_charge_mode = "+ert.stop_curve_charge_mode+" "
|
+ " WHERE electric2KW_id = " + ert.electric2KW_id;
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
|
|
//¸üÐÂ2mwµçÔ´¿ØÖÆÐÅÏ¢±í
|
public static void update_Electric_Control_2KW(MysqlConnPool pool,Electric_Control_Single_2kw econ) {
|
String sql_str = " UPDATE "+ Sql_Mysql.Tb_electric2MW_control +""
|
+ " SET consvolmode_chargecurr = "+econ.consvolmode_chargecurr+","
|
+ " chargecurr_five = "+econ.chargecurr_five+","
|
+ " chargecurr_four = "+econ.chargecurr_four+","
|
+ " chargecurr_three = "+econ.chargecurr_three+","
|
+ " chargecurr_two = "+econ.chargecurr_two+","
|
+ " chargecurr_one = "+econ.chargecurr_one+","
|
+ " currset = "+econ.currset+","
|
+ " volset = "+econ.volset+","
|
+ " stopchargevol_five = "+econ.stopchargevol_five+","
|
+ " stopchargevol_four = "+econ.stopchargevol_four+","
|
+ " stopchargevol_three = "+econ.stopchargevol_three+","
|
+ " stopchargevol_two = "+econ.stopchargevol_two+","
|
+ " stopchargevol_one = "+econ.stopchargevol_one+" "
|
+ " WHERE electric2KW_id = " + econ.electric2KW_id;
|
Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
/**
|
* ¸üÐÂÄ£ÄâÁ¿×´Ì¬±í
|
* @param conn_pool
|
* @param state
|
*/
|
public static void update_Electric_State_2KW(MysqlConnPool conn_pool, Electric_State_2kw state) {
|
String sql_str = " UPDATE "+Sql_Mysql.Tb_Electric_Control_Single +
|
" Set brachdcvol= " + state.brachdcvol +
|
",brachdccurr=" + state.brachdccurr +
|
",alldcvol=" + state.alldcvol +
|
",alldccurr=" + state.alldccurr +
|
",stopchargevol_one=" + state.stopchargevol_one +
|
",stopchargevol_two=" + state.stopchargevol_two +
|
",stopchargevol_three=" + state.stopchargevol_three +
|
",stopchargevol_four=" + state.stopchargevol_four +
|
",stopchargevol_five=" + state.stopchargevol_five +
|
",controlangle=" + state.controlangle +
|
",localgivevol=" + state.localgivevol +
|
",volset=" + state.volset +
|
",localgivecurr=" + state.localgivecurr +
|
",currset=" + state.currset +
|
",chargecurr_one=" + state.chargecurr_one +
|
",chargecurr_two=" + state.chargecurr_two +
|
",chargecurr_three=" + state.chargecurr_three +
|
",chargecurr_four=" + state.chargecurr_four +
|
",chargecurr_five=" + state.chargecurr_five +
|
",consvolmode_chargecurr=" +state.consvolmode_chargecurr+
|
" Where electric2KW_id = " + state.electric2KW_id;
|
Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
try {
|
sql.sqlMysqlExecute(sql_str);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
sql.close_con();
|
}
|
}
|
|
/**
|
* ²éѯµ¥µã¿ØÖƱí
|
* @param conn_pool
|
* @param control
|
*/
|
public static void queryElectric_Control_2KW(MysqlConnPool conn_pool,Electric_Control_Single_2kw control) {
|
String sql_str = "SELECT * FROM "+Sql_Mysql.Tb_electric2MW_control;
|
ResultSet res = null;
|
Sql_Mysql sql = new Sql_Mysql(conn_pool.getConn());
|
try {
|
res = sql.sqlMysqlQuery(sql_str);
|
while(res.next()) {
|
control.upper_pulse_block = res.getInt("upper_pulse_block"); //ÉÏλ»úÂö³å·âËø
|
control.remote_start= res.getInt("remote_start"); //Ô¶³ÌÆô¶¯
|
control.fault_reset= res.getInt("fault_reset"); //¹ÊÕϸ´Î»
|
control.conscurrswitch= res.getInt("conscurrswitch"); //ºãÁ÷Çл»
|
control.constantvol= res.getInt("constantvol"); //4²¢»ò2´®2²¢ºãѹ
|
control.volset_confirm= res.getInt("volset_confirm"); //µçѹ¸ø¶¨È·ÈÏ
|
control.currset_confirm= res.getInt("currset_confirm"); //µçÁ÷¸ø¶¨È·ÈÏ
|
control.remote_stop= res.getInt("remote_stop"); //Ô¶³ÌÍ£Ö¹
|
control.start_screen_set= res.getInt("start_screen_set"); //Æô¶¯´¥ÃþÆÁ¸ø¶¨
|
control.start_upper_set= res.getInt("start_upper_set"); //Æô¶¯ÉÏλ»ú¸ø¶¨
|
control.consvolswitch= res.getInt("consvolswitch"); //ºãѹÇл»
|
control.othermode= res.getInt("othermode"); //4²¢»ò2´®2²¢ÒÔÍâģʽ
|
control.consvol_distribution= res.getInt("consvol_distribution"); //ËÄ´®ºãѹµçѹ·ÖÅäλ
|
|
control.consvolmode_chargecurr= res.getFloat("consvolmode_chargecurr") ; // 'תΪºãѹģʽ³äµçµçѹֵ',
|
control.chargecurr_one = res.getFloat("chargecurr_one") ; // 'µÚ1½×¶Î³äµçµçÁ÷Öµ',
|
control.chargecurr_two = res.getFloat("chargecurr_two") ; // 'µÚ2½×¶Î³äµçµçÁ÷Öµ',
|
control.chargecurr_three = res.getFloat("chargecurr_three") ; // 'µÚ3½×¶Î³äµçµçÁ÷Öµ',
|
control.chargecurr_four = res.getFloat("chargecurr_four") ; // 'µÚ4½×¶Î³äµçµçÁ÷Öµ',
|
control.chargecurr_five = res.getFloat("chargecurr_five") ; // 'µÚ5½×¶Î³äµçµçÁ÷Öµ',
|
control.currset = res.getFloat("currset") ; // 'µçÁ÷É趨ֵ',
|
|
control.volset = res.getFloat("volset") ; // 'µçѹÉ趨ֵ',
|
control.stopchargevol_one = res.getFloat("stopchargevol_one") ; // 'µÚ1½×¶Î³äµçÖÕÖ¹µçѹ',
|
control.stopchargevol_two = res.getFloat("stopchargevol_two") ; // 'µÚ2½×¶Î³äµçÖÕÖ¹µçѹ',
|
control.stopchargevol_three = res.getFloat("stopchargevol_three") ; // 'µÚ3½×¶Î³äµçÖÕÖ¹µçѹ',
|
control.stopchargevol_four = res.getFloat("stopchargevol_four") ; // 'µÚ4½×¶Î³äµçÖÕÖ¹µçѹ',
|
control.stopchargevol_five = res.getFloat("stopchargevol_five") ; // 'µÚ5½×¶Î³äµçÖÕÖ¹µçѹ',
|
}
|
} catch (SQLException e) {
|
e.printStackTrace();
|
} finally {
|
if(res != null) {
|
try {
|
res.close();
|
} catch (SQLException e) {
|
e.printStackTrace();
|
}
|
}
|
sql.close_con();
|
}
|
}
|
|
public static void updateElectrical_2KW_Control(MysqlConnPool pool,Electric_Control_Single_2kw control) {
|
//String sql_str = " update " + Sql_Mysql;
|
|
}
|
|
|
}
|