aidmt-ms/sql/hazardous_work_ticket_creat...

42 lines
2.6 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 高风险作业票表:字段与 work_ticket 类似,当工作票 risk_type=高风险 时同步一条记录;用 risk_content涉及风险内容替代 risk_type
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `work_ticket_hazardous`;
CREATE TABLE `work_ticket_hazardous` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`ticket_id` bigint(20) NOT NULL COMMENT '工作票IDwork_ticket.ticket_id',
`ticket_number` varchar(100) DEFAULT NULL COMMENT '票证编号',
`project_id` bigint(20) DEFAULT NULL COMMENT '所属项目ID',
`work_location` varchar(200) DEFAULT NULL COMMENT '作业地点',
`supervisor_id` bigint(20) DEFAULT NULL COMMENT '作业负责人ID',
`supervisor_name` varchar(100) DEFAULT NULL COMMENT '作业负责人姓名',
`supervisor_position` varchar(100) DEFAULT NULL COMMENT '作业负责人职位',
`work_content` varchar(500) DEFAULT NULL COMMENT '作业内容',
`risk_content` varchar(500) DEFAULT NULL COMMENT '涉及风险内容',
`work_start_time` varchar(50) DEFAULT NULL COMMENT '作业开始时间',
`work_end_time` varchar(50) DEFAULT NULL COMMENT '作业结束时间',
`general_safety_measures` text COMMENT '通用安全措施JSON数组',
`custom_safety_measures` text COMMENT '自定义安全措施JSON数组',
`team_member_qualifications` text COMMENT '作业班成员资质确认JSON数组',
`need_monitoring_camera` char(1) DEFAULT NULL COMMENT '是否需申领移动监控球机0否1是',
`camera_application_id` bigint(20) DEFAULT NULL COMMENT '监控球机申请ID',
`status` varchar(50) DEFAULT NULL COMMENT '状态0草稿1待审核2已签发3已驳回4已作废',
`reviewer` varchar(64) DEFAULT NULL COMMENT '审核人',
`review_time` varchar(50) DEFAULT NULL COMMENT '审核时间',
`review_comment` varchar(500) DEFAULT NULL COMMENT '审核意见',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0存在 2删除',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_ticket_id` (`ticket_id`) COMMENT '一个工作票仅一条高风险关联',
KEY `idx_project_id` (`project_id`),
KEY `idx_del_flag` (`del_flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='高风险作业票表(字段与 work_ticket 类似risk_content=涉及风险内容)';
SET FOREIGN_KEY_CHECKS = 1;