-- ---------------------------------------------------------------------------------
-- 上课时间表增加字段
-- ---------------------------------------------------------------------------------
ALTER TABLE `class_time`   
  ADD COLUMN `create_user_id` BIGINT NULL   COMMENT '创建人id' AFTER `modify_date`,
  ADD COLUMN `modify_user_id` BIGINT NULL   COMMENT '修改人id' AFTER `create_user_id`;

  
-- ---------------------------------------------------------------------------------
-- 物品申购增加购买事项字段
-- ---------------------------------------------------------------------------------
ALTER TABLE `wf_subscription`   
  ADD COLUMN `item_content` VARCHAR(2000) NULL   COMMENT '购买事项' AFTER `status`;

-- ---------------------------------------------------------------------------------
-- 教师听课
-- ---------------------------------------------------------------------------------
DROP TABLE IF EXISTS wf_teacher_listen;
CREATE TABLE `wf_teacher_listen` (
  `id` BIGINT NOT NULL COMMENT '主键',
  `user_id` BIGINT DEFAULT NULL COMMENT '听课教师(xjr_user)',
  `class_id` BIGINT DEFAULT NULL COMMENT '听课班级(base_class)',
  `course_name` VARCHAR(50) DEFAULT NULL COMMENT '上课课程名称',
  `teacher_id` BIGINT DEFAULT NULL COMMENT '上课老师(xjr_user)',
  `schedule_date` DATE DEFAULT NULL COMMENT '上课日期',
  `weeks` INT DEFAULT NULL COMMENT '星期几(1-7)',
  `weeks_cn` VARCHAR(200) DEFAULT NULL COMMENT '星期中文',
  `time_number` INT NOT NULL COMMENT '节次',
  `folder_id` BIGINT DEFAULT NULL COMMENT '附件图片',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='教师听课';

-- ---------------------------------------------------------------------------------
-- 课时补充
-- ---------------------------------------------------------------------------------
DROP TABLE IF EXISTS wf_teacher_course_time;
CREATE TABLE `wf_teacher_course_time` (
  `id` BIGINT NOT NULL COMMENT '主键',
  `apply_user_id` BIGINT DEFAULT NULL COMMENT '教师(xjr_user)',
  `dept_id` BIGINT DEFAULT NULL COMMENT '部门id(xjr_department)',
  `course_time_type` VARCHAR(50) DEFAULT NULL COMMENT '课时类型(xjr_dictionary_item[course_time_type])',
  `course_time` DOUBLE(6,2) DEFAULT NULL COMMENT '补充课时',
  `schedule_date` DATE DEFAULT NULL COMMENT '上课日期',
  `remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
  `explains` VARCHAR(500) DEFAULT NULL COMMENT '说明',
  `teacher_ids` LONGTEXT DEFAULT NULL COMMENT '补课人员',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='课时补充';

ALTER TABLE `course_table`   
  ADD COLUMN `adjust_type` VARCHAR(50) NULL   COMMENT '调课顶课(顶课:course_substitute 调课:course_exchange)';

ALTER TABLE `wf_course_adjust` 
CHANGE `course_id` `course_id` VARCHAR(500) NULL COMMENT '课程id(base_course_subject)', 
CHANGE `exchange_course_id` `exchange_course_id` VARCHAR(500) NULL COMMENT '对调课程id(base_course_subject)';

-- ---------------------------------------------------------------------------------
-- 学生留宿申请增加class_id
-- ---------------------------------------------------------------------------------
ALTER TABLE `wf_room_stay_overnight`   
  ADD COLUMN `class_id` BIGINT DEFAULT 0  NULL   COMMENT '班级id' AFTER `status`;
  
-- ---------------------------------------------------------------------------------
-- 海康推送表增加字段
-- ---------------------------------------------------------------------------------
ALTER TABLE `hikvision_data`   
  ADD COLUMN `send_data` TEXT NULL   COMMENT '发送数据' AFTER `hikvision_id`;

 