# 设备清单主表 create table uav_device_list ( id int primary key auto_increment comment '主键id', device_sn varchar(64) not null comment '设备唯一识别码, 对外使用, 由业务员录入', uav_id int not null comment '无人机id', subsystem int not null comment '所属子系统, enum: 0-飞行器平台子系统, 1-动力子系统, 2-飞行控制子系统, 3-电气子系统, 4-机载数据链子系统', device_type_id int not null comment '设备类型id', device_name varchar(30) not null comment '设备名, 同一类设备可能有多个, 可用别名区分', device_model varchar(30) comment '型号', manufacturer varchar(100) comment '生产厂家', install_date date not null comment '装机日期', utilized_time int not null default 0 comment '已使用时间 (小时)', expected_life int comment '预计寿命(年)', status tinyint not null comment '设备状态, enum: 0-停用, 1-在用', note text comment '备注', create_time datetime, update_time datetime, key idx_uav_id (uav_id), key idx_subsystem (subsystem), unique key uk_uav_device (uav_id, device_sn) comment '同一飞机的设备sn不能重复', unique key uk_device_status (device_sn, status) comment '一个设备只能处于一个状态' ) comment '无人机设备清单表';