-- ===========================
-- 部门表添加服务单和调度单编码字段
-- ===========================

-- 添加服务单编码字段
ALTER TABLE sys_dept 
ADD COLUMN service_order_class VARCHAR(20) NULL COMMENT '服务单编码(对应旧系统OrderClass vType=1)' AFTER department_id;

-- 添加调度单编码字段
ALTER TABLE sys_dept 
ADD COLUMN dispatch_order_class VARCHAR(20) NULL COMMENT '调度单编码(对应旧系统OrderClass vType=2)' AFTER service_order_class;

-- 添加索引
ALTER TABLE sys_dept ADD INDEX idx_service_order_class (service_order_class);
ALTER TABLE sys_dept ADD INDEX idx_dispatch_order_class (dispatch_order_class);

-- 查看表结构
DESC sys_dept;
