| | |
| | | createBatt_Maint_Inf_TABLE(pool, recreate); |
| | | |
| | | createBatt_Alm_Param_TABLE(pool, recreate); |
| | | |
| | | createBattspare_TABLE(pool, recreate); |
| | | |
| | | createBattscrap_TABLE(pool, recreate); |
| | | |
| | | createBattspare_Record_TABLE(pool, recreate); |
| | | } |
| | | |
| | | private static void createBattspare_Record_TABLE(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battspare_Record_TABLE; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battspare_Record_TABLE + " (" + |
| | | " `id` int(11) NOT NULL AUTO_INCREMENT," + |
| | | " `spare_id` int(11) DEFAULT NULL COMMENT '备件id'," + |
| | | " `operation_num` int(11) DEFAULT NULL COMMENT '出/入库数量'," + |
| | | " `operation_type` int(11) DEFAULT NULL COMMENT '出入库类型:-1,出库;1,入库;0,初始化库存'," + |
| | | " `operation_time` datetime DEFAULT NULL COMMENT '操作时间'," + |
| | | " `spare_num` int(11) DEFAULT NULL COMMENT '当前的备件数量'," + |
| | | " PRIMARY KEY (`id`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 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 createBattscrap_TABLE(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battscrap_TABLE; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battscrap_TABLE + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " `battProducer` varchar(15) DEFAULT '理士' COMMENT '电池品牌'," + |
| | | " `BattModel` varchar(15) DEFAULT 'DJ300' COMMENT '电池型号'," + |
| | | " `battspare_time` date DEFAULT '2021-08-01' COMMENT '入库时间'," + |
| | | " `MonCount` int(11) DEFAULT '24' COMMENT '单体数量'," + |
| | | " `baojiGroup_id` int(11) DEFAULT NULL COMMENT '所属包机组id'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=10 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(); |
| | | } |
| | | } |
| | | |
| | | private static void createBattspare_TABLE(MysqlConnPool pool, boolean recreate) { |
| | | String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battspare_TABLE; |
| | | String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battspare_TABLE + " (" + |
| | | " `num` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键'," + |
| | | " `battProducer` varchar(15) DEFAULT '理士' COMMENT '电池品牌'," + |
| | | " `BattModel` varchar(15) DEFAULT 'DJ300' COMMENT '电池型号'," + |
| | | " `battinuse_time` date DEFAULT '2021-08-01' COMMENT '投入使用时间'," + |
| | | " `battscrap_time` date DEFAULT '2021-08-01' COMMENT '报废时间'," + |
| | | " `stationName` varchar(128) DEFAULT '' COMMENT '原使用机房'," + |
| | | " `battGroupName` varchar(128) DEFAULT '' COMMENT '原电池组名'," + |
| | | " PRIMARY KEY (`num`)" + |
| | | ") ENGINE=InnoDB AUTO_INCREMENT=10 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(); |
| | | } |
| | | } |
| | | |
| | | /** |