NIO-F3-Java/youchain-system/DB_SQL.sql

104 lines
6.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#2023-11-3 AGV
CREATE TABLE `base_agv_scene` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`dept_id` bigint(20) DEFAULT NULL COMMENT '仓库ID',
`code` varchar(20) NOT NULL COMMENT '代码',
`name` varchar(20) NOT NULL COMMENT '名称',
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='AGV场景表';
ALTER TABLE `base_area` ADD COLUMN `agv_scene_id` bigint(20) DEFAULT NULL COMMENT 'avg场景id';
ALTER TABLE `base_item` ADD COLUMN `agv_scene_id` bigint(20) DEFAULT NULL COMMENT 'avg场景id';
#
INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (21, 'item_type', '货物类型', 'admin', 'admin', '2023-11-03 11:49:03', '2023-11-03 11:49:03');
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (69, 21, '前桶', 'QT', 1, 'admin', 'admin', '2023-11-03 11:49:34', '2023-11-03 11:49:34');
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (69, 21, '后桶', 'HT', 2, 'admin', 'admin', '2023-11-03 11:49:34', '2023-11-03 11:49:34');
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (70, 21, '门封', 'MF', 3, 'admin', 'admin', '2023-11-03 13:39:13', '2023-11-03 13:39:13');
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (71, 21, '小件', 'XJ', 4, 'admin', 'admin', '2023-11-03 13:39:24', '2023-11-03 13:39:24');
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (72, 21, 'ZCZ', '轴承座', 5, 'admin', 'admin', '2023-11-03 13:39:39', '2023-11-03 13:39:39');
#
ALTER table data_asn_detail add point_id bigint(20) DEFAULT NULL COMMENT '点位序号';
#
alter table base_box add `IP` varchar(50) DEFAULT NULL COMMENT 'IP' ;
alter table base_box add `lamp_status` varchar(50) DEFAULT '0' COMMENT '指示灯状态';
alter table base_box add `lamp_code` varchar(50) DEFAULT NULL COMMENT '按钮盒编号';
#
CREATE TABLE `sys_lamp_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`ip` varchar(50) DEFAULT NULL COMMENT 'ip',
`button_box` varchar(50) DEFAULT NULL COMMENT '所属按钮盒',
`button_code` varchar(50) DEFAULT NULL COMMENT '按钮编码',
`operation_type` varchar(50) DEFAULT NULL COMMENT '操作类型',
`request_content` varchar(255) DEFAULT NULL COMMENT '请求内容',
`return_content` varchar(255) DEFAULT NULL COMMENT '返回内容',
`return_state` varchar(50) DEFAULT NULL COMMENT '返回状态',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='指示灯日志';
#
update base_item it set it.good_type='ZC' where good_type='ZCZ';
#data_agv_task
alter table data_agv_task add `be_scan` int(11) DEFAULT NULL COMMENT '是否扫描' ;
update data_agv_task set be_scan=0 where be_scan is null ;
#
ALTER table base_point add item_code VARCHAR(50) COMMENT '点位物料编码';
#
alter table base_point add rows int(11) DEFAULT NULL COMMENT '' ;
alter table base_point add col int(11) DEFAULT NULL COMMENT '' ;
alter table base_point add line int(11) DEFAULT NULL COMMENT '' ;
update base_point set rows=0,col=0,line=0 where rows is null;
#
CREATE TABLE `base_zcjxb` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`modbus_tcp_task_finish` tinyint(1) DEFAULT '0' COMMENT 'Modbus-tcp的任务是否启用',
`modbus_tcp_point` varchar(255) DEFAULT NULL COMMENT 'Modbus-tcp对应的地标点',
`modbus_tcp_item` varchar(255) DEFAULT NULL COMMENT 'Modbus-tcp对应的物料',
`modbus_tcp_slave_id` int(11) DEFAULT NULL COMMENT '从机ID',
`task_off_on_a` tinyint(1) DEFAULT '0' COMMENT 'a车点位是否有任务',
`task_off_on_b` tinyint(1) DEFAULT '0' COMMENT 'b车点位是否有任务',
`code` int(11) DEFAULT NULL COMMENT '机械臂机台号',
`ip` varchar(100) NOT NULL COMMENT 'ip地址',
`port` int(11) NOT NULL COMMENT '端口号',
`communication_type` varchar(255) DEFAULT NULL COMMENT '通信类型',
`address` int(11) DEFAULT NULL COMMENT '地址',
`data_length` int(11) DEFAULT NULL COMMENT '数据长度',
`offset_a1` int(11) DEFAULT NULL COMMENT '偏移量-A返回空车',
`offset_b1` int(11) DEFAULT NULL COMMENT '偏移量-B返回空车',
`offset_a2` int(11) DEFAULT NULL COMMENT '偏移量-A叫料',
`offset_b2` int(11) DEFAULT NULL COMMENT '偏移量-B叫料',
`offset_a3` int(11) DEFAULT NULL COMMENT '偏移量-A车有料',
`offset_b3` int(11) DEFAULT NULL COMMENT '偏移量-B车有料',
`point_a1` varchar(255) DEFAULT NULL COMMENT 'A车的地标点',
`point_b1` varchar(255) DEFAULT NULL COMMENT 'B车的地标点',
`item_a1` varchar(255) DEFAULT NULL COMMENT 'A车的物料',
`item_b1` varchar(255) DEFAULT NULL COMMENT 'B车的物料',
`enabled` tinyint(1) DEFAULT '0' COMMENT '是否启用',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`update_by` varchar(255) DEFAULT NULL COMMENT '更新人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8 COMMENT='机械臂';
#
ALTER TABLE `base_zcjxb` ADD COLUMN task_name varchar(255) DEFAULT NULL COMMENT '任务名称';
#
alter table `base_zcjxb` add `read_value` int(2) DEFAULT NULL COMMENT '读取的值' ;
alter table `base_zcjxb` add `error_txt` text COMMENT '异常日志';