20240311_sql.sql 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. -- -----------------------------------------------------------
  2. -- 材料缴交任务类别调整
  3. -- -----------------------------------------------------------
  4. DROP PROCEDURE IF EXISTS createCom;
  5. DELIMITER $$
  6. CREATE
  7. PROCEDURE createCom()
  8. BEGIN
  9. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='material_type' AND COLUMN_NAME = 'material_category') THEN
  10. ALTER TABLE `material_type`
  11. ADD COLUMN `material_category` VARCHAR(50) NULL COMMENT '任务类型(可多选 xjr_dictionary_detail[material_category])' AFTER `name`,
  12. ADD COLUMN `folder_id` BIGINT NULL COMMENT '文件模板' AFTER `material_category`,
  13. ADD COLUMN `form_release_id` BIGINT NULL COMMENT '表单发布(xjr_form_release)' AFTER `folder_id`;
  14. END IF;
  15. END$$
  16. DELIMITER ;
  17. CALL createCom;
  18. DROP PROCEDURE createCom;
  19. -- -----------------------------------------------------------
  20. -- 材料缴交任务
  21. -- -----------------------------------------------------------
  22. DROP PROCEDURE IF EXISTS createCom;
  23. DELIMITER $$
  24. CREATE
  25. PROCEDURE createCom()
  26. BEGIN
  27. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='material_task' AND COLUMN_NAME = 'material_category') THEN
  28. ALTER TABLE `material_task`
  29. ADD COLUMN `material_category` VARCHAR(50) NULL COMMENT '任务类型(可多选 xjr_dictionary_detail[material_category])';
  30. END IF;
  31. END$$
  32. DELIMITER ;
  33. CALL createCom;
  34. DROP PROCEDURE createCom;
  35. -- ------------------------------------------------
  36. -- 攀宝学期对应
  37. -- ------------------------------------------------
  38. DROP TABLE IF EXISTS pb_semester_config;
  39. CREATE TABLE `pb_semester_config` (
  40. `id` BIGINT NOT NULL,
  41. `create_user_id` BIGINT DEFAULT NULL,
  42. `create_date` DATETIME(3) DEFAULT NULL,
  43. `modify_user_id` BIGINT DEFAULT NULL,
  44. `modify_date` DATETIME(3) DEFAULT NULL,
  45. `delete_mark` INT DEFAULT NULL,
  46. `enabled_mark` INT DEFAULT NULL,
  47. `base_semester_id` BIGINT DEFAULT NULL COMMENT '学期',
  48. `beltcode` VARCHAR(30) DEFAULT NULL COMMENT '攀宝学期code',
  49. `beltname` VARCHAR(30) DEFAULT NULL COMMENT '攀宝学期名称',
  50. PRIMARY KEY (`id`) USING BTREE
  51. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='攀宝学期对应';
  52. ALTER TABLE `pb_v_xsxxsfytb`
  53. ADD INDEX (`Studentcode`),
  54. ADD INDEX (`qfje`);