V1.31 edit at date 2022-06-16
1.新增初始化创建表`web_site`.`tb_map_outline`"表[首页轮廓图表]
2.新增初始化创建表`db_battinf`.`tb_battmon_standardcurve`表[标准曲线表]
| | |
| | | |
| | | V1.30 edit at date 2022-06-13 |
| | | 1.修复新老平台升级时账号密码长度不够bug |
| | | 2.修复用户表无用户时,默认插入的superuser,admin账号显示注销 |
| | | 3.修复插入账号sys_admin为锁定状态 |
| | | |
| | | V1.31 edit at date 2022-06-16 |
| | | 1.新增初始化创建表`web_site`.`tb_map_outline`"表[首页轮廓图表] |
| | | CREATE TABLE `tb_map_outline` ( |
| | | `id` int(11) NOT NULL AUTO_INCREMENT, |
| | | `province` varchar(15) DEFAULT NULL, |
| | | `city` varchar(255) DEFAULT NULL, |
| | | `distinct` varchar(255) DEFAULT NULL, |
| | | `name` varchar(255) DEFAULT NULL, |
| | | `status` tinyint(1) DEFAULT NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; |
| | | 2.新增初始化创建表`db_battinf`.`tb_battmon_standardcurve`表[标准曲线表] |
| | | CREATE TABLE `tb_battmon_standardcurve` ( |
| | | `num` int(11) NOT NULL AUTO_INCREMENT, |
| | | `monvolstd` float NOT NULL DEFAULT '0', |
| | | `moncapstd` float NOT NULL DEFAULT '0', |
| | | `battproducer` varchar(64) NOT NULL DEFAULT '', |
| | | `battmodel` varchar(64) NOT NULL DEFAULT '', |
| | | `note` varchar(64) NOT NULL DEFAULT '', |
| | | PRIMARY KEY (`num`) |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; |
| | | |
| | |
| | | |
| | | <root> |
| | | <mysql_ramdb_recreate_en>false</mysql_ramdb_recreate_en> |
| | | <mysql_server_ip>127.0.0.1</mysql_server_ip> |
| | | <mysql_server_ip>192.168.10.79</mysql_server_ip> |
| | | <!--SOURCE_BATTDATA_TYPE_FBSDEV = 0--> |
| | | <!--SOURCE_BATTDATA_TYPE_SQLSERVER = 1--> |
| | | <!--SOURCE_BATTDATA_TYPE_C_INTERFACE = 2--> |
| | |
| | | " 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 { |
| | |
| | | createA059_Station_Inf_TABLE(pool,recreate); //一体机预加载配置信息 |
| | | |
| | | createBattinf_Guides_TABLE(pool, recreate); |
| | | |
| | | createBattmon_Standardcurve_TABLE(pool,recreate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建标准曲线表 |
| | | * @param pool |
| | | * @param recreate |
| | | */ |
| | | private static void createBattmon_Standardcurve_TABLE(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battmon_Standardcurve_TABLE; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battmon_Standardcurve_TABLE + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `monvolstd` float NOT NULL DEFAULT '0'," + |
| | | " `moncapstd` float NOT NULL DEFAULT '0'," + |
| | | " `battproducer` varchar(64) NOT NULL DEFAULT ''," + |
| | | " `battmodel` varchar(64) NOT NULL DEFAULT ''," + |
| | | " `note` varchar(64) NOT NULL DEFAULT ''," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=27 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(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Date; |
| | | |
| | | import com.base.Com; |
| | | import com.sql.MysqlConnPool; |
| | | import com.sql.Sql_Mysql; |
| | | |
| | |
| | | // sql.sqlMysqlExecute(sql_str01); |
| | | // } |
| | | sql.sqlMysqlUseDB(Sql_Mysql.DB_USER); |
| | | |
| | | sql.sqlMysqlExecute(sql_str02); |
| | | |
| | | //添加加密告警upassword |
| | |
| | | } |
| | | |
| | | |
| | | //修改usnid的长度 |
| | | //修改usnid的长度改成varchar(200) |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_user'" |
| | | + " AND table_name='tb_user_inf'" |
| | |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.TB_UserInf |
| | | + " CHANGE COLUMN `uSnId` `uSnId` VARCHAR(200) NOT NULL DEFAULT '123456';"); |
| | | } |
| | | //修改password的长度 |
| | | //修改password的长度改成varchar(200) |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns" |
| | | + " WHERE table_schema='db_user'" |
| | | + " AND table_name='tb_user_inf'" |
| | |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | | //默认没有添加用户信息时添加superuser |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1001', '" + upstr + "', 'admin', 'admin', 'employeeid', '12345678912', '12345678912', 'abcde@mail.com', '', '1980-01-01', '2015-12-09', '男', '广东省', 'protitle', 'authority', '默认班组', 'duties', 'tasks', '1', 'note', '"+upstr+"', '', '', '48505834353130373639353153594E4F', '28', '0','0','0','0','0','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','0','0');"); |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1002', '" + upstr + "', 'superuser', '1234567', '100010000', '12345678', '15346259512', '123456789@qq.com', '', '1990-04-20', '2016-03-28', '男', '湖北省', '软件工程师', 'authority111', '默认班组', 'dutie', '完成软件的研发工作', '0', 'note', '"+upstr+"', '', '', '14031C0F0136063E', '27', '0','0','0','0','0','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','0','0');"); |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1001', '" + upstr + "', 'admin', 'admin', 'employeeid', '12345678912', '12345678912', 'abcde@mail.com', '', '1980-01-01', '2015-12-09', '男', '广东省', 'protitle', 'authority', '默认班组', 'duties', 'tasks', '1', 'note', '"+upstr+"', '', '', '48505834353130373639353153594E4F', '28', '0','0','0','0','1','" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms) + "','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','0','0');"); |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+" VALUES ('1002', '" + upstr + "', 'superuser', '1234567', '100010000', '12345678', '15346259512', '123456789@qq.com', '', '1990-04-20', '2016-03-28', '男', '湖北省', '软件工程师', 'authority111', '默认班组', 'dutie', '完成软件的研发工作', '0', 'note', '"+upstr+"', '', '', '14031C0F0136063E', '27', '0','0','0','0','1','" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms) + "','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','2022-05-19 14:53:44','0','0');"); |
| | | } |
| | | } |
| | | |
| | |
| | | sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.TB_UserInf + " SET uId = 0 WHERE uName = '未登录的用户账号'"); |
| | | } |
| | | |
| | | //添加默认账号sys_admin |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'sys_admin';"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | | //默认没有添加用户信息时添加'未登录的用户账号' |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+"(uId,uSnId,uName,uMobilephone,uJobGroup,upassword,login_type,uRole,type,status,last_login_time,password_update_time,create_time,visit_time,visit_ip) VALUES(1,'" + upstr + "', 'sys_admin','','默认班组','" + upstr + "',1,0,1,1,'2022-02-14 16:02:01',null,'2021-12-14 16:16:04','00:00:00~23:59:59','*');"); |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+"(uId,uSnId,uName,uMobilephone,uJobGroup,upassword,login_type,uRole,type,status,last_login_time,password_update_time,create_time,visit_time,visit_ip) VALUES(1,'" + upstr + "', 'sys_admin','','默认班组','" + upstr + "',1,0,1,1,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"',null,'2021-12-14 16:16:04','00:00:00~23:59:59','*');"); |
| | | } |
| | | } |
| | | |
| | | //添加默认账号audit_admin |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'audit_admin';"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | //sql.sqlMysqlExecute("UPDATE db_user.tb_user_inf SET status = 1,last_login_time = NOW();"); |
| | | |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | createTB_3D_STATION_Table(pool, recreate); //创建3D机房信息表 |
| | | |
| | | createTB_Map_Outline_Table(pool, recreate); //创建首页轮廓图表 |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | private static void createTB_Map_Outline_Table(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.TB_Map_Outline_Table; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.TB_Map_Outline_Table+ " (" + |
| | | " `id` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `province` varchar(15) DEFAULT NULL," + |
| | | " `city` varchar(255) DEFAULT NULL," + |
| | | " `distinct` varchar(255) DEFAULT NULL," + |
| | | " `name` varchar(255) DEFAULT NULL," + |
| | | " `status` tinyint(1) DEFAULT NULL," + |
| | | " PRIMARY KEY (`id`) USING BTREE" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=33 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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | private static void createTb_Weather_City2_Table(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Weather_City2_Table; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Weather_City2_Table + " (" + |
| | |
| | | public static final String Eletmp_Table = WEB_Site +".`tb_eletmp`"; //模板表 |
| | | public static final String Peak_Statistics_Table = WEB_Site +".`tb_peak_statistics`"; //消峰填谷电价统计表 |
| | | public static final String Weather_City2_Table = WEB_Site +".`tb_weather_city2`"; //天气表 |
| | | public static final String TB_3D_STATION_Table = WEB_Site +".`tb_3d_station`"; |
| | | public static final String TB_3D_STATION_Table = WEB_Site +".`tb_3d_station`"; //3D机房表 |
| | | public static final String TB_Map_Outline_Table = WEB_Site +".`tb_map_outline`"; //首页轮廓图表 |
| | | |
| | | |
| | | |
| | |
| | | |
| | | public final static String A059_Station_Inf_TABLE = DB_BATT_INF + ".`tb_a059_station_inf`"; //充放电一体机配置机房 |
| | | public final static String Battinf_Guides_TABLE = DB_BATT_INF + ".`tb_battinf_guides`"; //电池组各参数参考线 |
| | | public final static String Battmon_Standardcurve_TABLE = DB_BATT_INF + ".`tb_battmon_standardcurve`"; //标准曲线表 |
| | | |
| | | |
| | | |
| | |
| | | |
| | | V1.30 edit at date 2022-06-13 |
| | | 1.修复新老平台升级时账号密码长度不够bug |
| | | 2.修复用户表无用户时,默认插入的superuser,admin账号显示注销 |
| | | 3.修复插入账号sys_admin为锁定状态 |
| | | |
| | | V1.31 edit at date 2022-06-16 |
| | | 1.新增初始化创建表`web_site`.`tb_map_outline`"表[首页轮廓图表] |
| | | CREATE TABLE `tb_map_outline` ( |
| | | `id` int(11) NOT NULL AUTO_INCREMENT, |
| | | `province` varchar(15) DEFAULT NULL, |
| | | `city` varchar(255) DEFAULT NULL, |
| | | `distinct` varchar(255) DEFAULT NULL, |
| | | `name` varchar(255) DEFAULT NULL, |
| | | `status` tinyint(1) DEFAULT NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; |
| | | 2.新增初始化创建表`db_battinf`.`tb_battmon_standardcurve`表[标准曲线表] |
| | | CREATE TABLE `tb_battmon_standardcurve` ( |
| | | `num` int(11) NOT NULL AUTO_INCREMENT, |
| | | `monvolstd` float NOT NULL DEFAULT '0', |
| | | `moncapstd` float NOT NULL DEFAULT '0', |
| | | `battproducer` varchar(64) NOT NULL DEFAULT '', |
| | | `battmodel` varchar(64) NOT NULL DEFAULT '', |
| | | `note` varchar(64) NOT NULL DEFAULT '', |
| | | PRIMARY KEY (`num`) |
| | | ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; |
| | | |
| | |
| | | /**************************************************************************/ |
| | | /**************************************************************************/ |
| | | public final static boolean app_debug = false; |
| | | public final static float m_VersionNum = (float) 1.30; |
| | | public final static float m_VersionNum = (float) 1.31; |
| | | public final static String m_Version = "Welcome To Use BTS DB BUILDER V" + m_VersionNum + " RC_20180908"; |
| | | /**************************************************************************/ |
| | | /**************************************************************************/ |