| | |
| | | |
| | | createFbs9100_SetParam_Temp_Table(pool, recreate); //本年度二次核容放电参数 |
| | | |
| | | createFault_Upload_Application_Table(pool, recreate); //故障隐患上传表,用于故障隐患考核 |
| | | |
| | | System.out.println(" DB_web_site init end at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)); |
| | | } |
| | | |
| | |
| | | " `end_time` datetime DEFAULT NULL COMMENT '归档时间'," + |
| | | " `task_level` int(11) DEFAULT NULL COMMENT '任务级别'," + |
| | | " `is_in_time` tinyint(4) DEFAULT NULL COMMENT '是否及时'," + |
| | | " `process_level` varchar(45) DEFAULT NULL COMMENT '流程所在层级'," + |
| | | " `alarm_order_id` int(11) DEFAULT NULL COMMENT '告警工单id'," + |
| | | " `status` tinyint(4) DEFAULT NULL COMMENT '工单状态 0:自动派单,2:人工派单,3:工单T1处理中,4:工单T2处理中,5:归档'," + |
| | | " `file_name` varchar(45) DEFAULT NULL COMMENT '附件名称'," + |
| | |
| | | " PRIMARY KEY (`id`)" + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作流主表';"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | ResultSet res = null; |
| | | try { |
| | | sql.sqlMysqlExecute(str_str); |
| | | |
| | | |
| | | /************************** 添加 process_level 字段 **************************************/ |
| | | String sql_str03 = " SELECT * FROM information_schema.columns " |
| | | + " WHERE table_schema= 'web_site' " |
| | | + " AND table_name='tb_workflow_main' " |
| | | + " AND column_name='process_level'"; |
| | | res = sql.sqlMysqlQuery(sql_str03); |
| | | if(false == res.next()) { |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Tb_Workflow_Main_Table |
| | | + " ADD COLUMN `process_level` varchar(45) DEFAULT NULL 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 |
| | | */ |
| | | public static void createFault_Upload_Application_Table(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str_del = " DROP TABLE IF EXISTS "+Sql_Mysql.Tb_Fault_Upload_Application_Table; |
| | | String sql_str = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Tb_Fault_Upload_Application_Table + " (" + |
| | | " `id` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `alarm_num` int(11) DEFAULT NULL COMMENT '告警实时表的id'," + |
| | | " `alarm_type` int(11) DEFAULT NULL COMMENT '告警分类:1-电池,2-设备,3-电源'," + |
| | | " `station_id` int(11) DEFAULT NULL," + |
| | | " `type` int(11) DEFAULT NULL," + |
| | | " `description` varchar(500) DEFAULT NULL," + |
| | | " `upload_user_id` int(11) DEFAULT NULL," + |
| | | " `confirm_user_id` int(11) DEFAULT NULL," + |
| | | " `confirm_description` varchar(500) DEFAULT NULL," + |
| | | " `confirm_time` datetime DEFAULT NULL," + |
| | | " `status` tinyint(4) DEFAULT NULL COMMENT '0:待确认,1确认属实,-1确认不属实'," + |
| | | " `create_time` datetime DEFAULT NULL," + |
| | | " `main_id` int(11) DEFAULT NULL," + |
| | | " PRIMARY KEY (`id`)" + |
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='故障隐患上传表,用于故障隐患考核';"; |
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn()); |
| | | ResultSet res = null; |
| | | |
| | | try { |
| | | if(recreate) { |
| | | sql.sqlMysqlExecute(sql_str_del); |
| | | } |
| | | sql.sqlMysqlExecute(sql_str); |
| | | |
| | | |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if(null != res) { |
| | | try { |
| | | res.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | sql.close_con(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置指定的线程重启[ 告警线程; ] |