20240328_sql.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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='official_document_received' AND COLUMN_NAME = 'meeting_time') THEN
  10. ALTER TABLE `official_document_received`
  11. ADD COLUMN `meeting_time` DATETIME NULL COMMENT '会议时间' AFTER `file_id`,
  12. ADD COLUMN `meeting_address` VARCHAR(50) NULL COMMENT '会议地点' AFTER `meeting_time`,
  13. ADD COLUMN `attendees` VARCHAR(3000) NULL COMMENT '与会人员' AFTER `meeting_address`;
  14. END IF;
  15. END$$
  16. DELIMITER ;
  17. CALL createCom;
  18. DROP PROCEDURE createCom;
  19. ALTER TABLE official_document_received
  20. ADD user_ids VARCHAR(512) NULL COMMENT '传阅人(可多选)';
  21. -- -----------------------------------------------------------
  22. -- 学籍表中增加考号
  23. -- -----------------------------------------------------------
  24. DROP PROCEDURE IF EXISTS createCom;
  25. DELIMITER $$
  26. CREATE
  27. PROCEDURE createCom()
  28. BEGIN
  29. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='base_student_school_roll' AND COLUMN_NAME = 'candidate_number') THEN
  30. ALTER TABLE `base_student_school_roll`
  31. ADD COLUMN `candidate_number` VARCHAR(20) NULL COMMENT '考号' AFTER `roll_modality`;
  32. END IF;
  33. END$$
  34. DELIMITER ;
  35. CALL createCom;
  36. DROP PROCEDURE createCom;
  37. -- ------------------------------------------------
  38. -- 资产管理
  39. -- ------------------------------------------------
  40. DROP TABLE IF EXISTS wf_asset_manage;
  41. CREATE TABLE `wf_asset_manage` (
  42. `id` BIGINT NOT NULL,
  43. `create_user_id` BIGINT DEFAULT NULL,
  44. `create_date` DATETIME(3) DEFAULT NULL,
  45. `modify_user_id` BIGINT DEFAULT NULL,
  46. `modify_date` DATETIME(3) DEFAULT NULL,
  47. `delete_mark` INT DEFAULT NULL,
  48. `enabled_mark` INT DEFAULT NULL,
  49. `asset_type` VARCHAR(30) DEFAULT NULL COMMENT '资产类型',
  50. `asset_category` VARCHAR(30) DEFAULT NULL COMMENT '资产类别',
  51. `asset_species` VARCHAR(30) DEFAULT NULL COMMENT '资产种类',
  52. `name` VARCHAR(100) DEFAULT NULL COMMENT '名称',
  53. `dept_id` BIGINT DEFAULT NULL COMMENT '所属部门[xjr_department]',
  54. `user_id` BIGINT DEFAULT NULL COMMENT '使用人id[xjr_user]',
  55. `amount` DECIMAL(8,2) DEFAULT NULL COMMENT '金额',
  56. `status` SMALLINT DEFAULT 0 COMMENT '状态(0:未结束 1:结束)',
  57. `area_type` VARCHAR(50) DEFAULT NULL COMMENT '区域类型',
  58. `folder_id` BIGINT DEFAULT NULL COMMENT '附件id',
  59. `base_office_build_id` BIGINT DEFAULT NULL COMMENT '楼栋id',
  60. `floor_number` INT DEFAULT NULL COMMENT '楼层',
  61. `room_number` VARCHAR(50) DEFAULT NULL COMMENT '门牌号',
  62. PRIMARY KEY (`id`) USING BTREE
  63. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='资产管理';
  64. -- -----------------------------------------------------------
  65. -- 教室增加门牌号
  66. -- -----------------------------------------------------------
  67. DROP PROCEDURE IF EXISTS createCom;
  68. DELIMITER $$
  69. CREATE
  70. PROCEDURE createCom()
  71. BEGIN
  72. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='base_classroom' AND COLUMN_NAME = 'number') THEN
  73. ALTER TABLE `base_classroom`
  74. ADD COLUMN `number` VARCHAR(50) NULL COMMENT '门牌号' AFTER `status`;
  75. END IF;
  76. END$$
  77. DELIMITER ;
  78. CALL createCom;
  79. DROP PROCEDURE createCom;
  80. -- -----------------------------------------------------------
  81. -- 表单增加样式类型字段
  82. -- -----------------------------------------------------------
  83. DROP PROCEDURE IF EXISTS createCom;
  84. DELIMITER $$
  85. CREATE
  86. PROCEDURE createCom()
  87. BEGIN
  88. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='xjr_workflow_schema' AND COLUMN_NAME = 'style_type') THEN
  89. ALTER TABLE `xjr_workflow_schema`
  90. ADD COLUMN `style_type` INT DEFAULT 0 NULL COMMENT '样式(0:表单 1:表格)' AFTER `modify_user_id`;
  91. END IF;
  92. END$$
  93. DELIMITER ;
  94. CALL createCom;
  95. DROP PROCEDURE createCom;
  96. -- ------------------------------------------------
  97. -- 考核模板
  98. -- ------------------------------------------------
  99. DROP TABLE IF EXISTS assessment_template;
  100. CREATE TABLE `assessment_template` (
  101. `id` BIGINT NOT NULL,
  102. `create_user_id` BIGINT DEFAULT NULL,
  103. `create_date` DATETIME(3) DEFAULT NULL,
  104. `modify_user_id` BIGINT DEFAULT NULL,
  105. `modify_date` DATETIME(3) DEFAULT NULL,
  106. `delete_mark` INT DEFAULT NULL,
  107. `enabled_mark` INT DEFAULT NULL,
  108. `name` VARCHAR(100) DEFAULT NULL COMMENT '名称',
  109. `score` BIGINT DEFAULT NULL COMMENT '分数',
  110. PRIMARY KEY (`id`) USING BTREE
  111. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核模板';
  112. -- ------------------------------------------------
  113. -- 考核模板题目
  114. -- ------------------------------------------------
  115. DROP TABLE IF EXISTS assessment_question;
  116. CREATE TABLE `assessment_question` (
  117. `id` BIGINT NOT NULL,
  118. `create_user_id` BIGINT DEFAULT NULL,
  119. `create_date` DATETIME(3) DEFAULT NULL,
  120. `modify_user_id` BIGINT DEFAULT NULL,
  121. `modify_date` DATETIME(3) DEFAULT NULL,
  122. `delete_mark` INT DEFAULT NULL,
  123. `enabled_mark` INT DEFAULT NULL,
  124. `sort_code` INT DEFAULT NULL,
  125. `name` VARCHAR(100) DEFAULT NULL COMMENT '题目题干',
  126. `score` BIGINT DEFAULT NULL COMMENT '分数',
  127. `type` VARCHAR(100) DEFAULT NULL COMMENT '题目类型',
  128. `category` INT DEFAULT NULL COMMENT '类别(1:大题 2:小题 3:选项)',
  129. `parent_id` BIGINT DEFAULT NULL COMMENT '父级id',
  130. `required` SMALLINT DEFAULT 1 COMMENT '小题是否必填(1:是 0:否)',
  131. `assessment_template_id` BIGINT DEFAULT NULL COMMENT '考核模板id(assessment_template)',
  132. PRIMARY KEY (`id`) USING BTREE
  133. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核模板题目';
  134. -- ------------------------------------------------
  135. -- 考核计划
  136. -- ------------------------------------------------
  137. DROP TABLE IF EXISTS assessment_template_plan;
  138. CREATE TABLE `assessment_template_plan` (
  139. `id` BIGINT NOT NULL,
  140. `create_user_id` BIGINT DEFAULT NULL,
  141. `create_date` DATETIME(3) DEFAULT NULL,
  142. `modify_user_id` BIGINT DEFAULT NULL,
  143. `modify_date` DATETIME(3) DEFAULT NULL,
  144. `delete_mark` INT DEFAULT NULL,
  145. `enabled_mark` INT DEFAULT NULL,
  146. `name` VARCHAR(100) DEFAULT NULL COMMENT '名称',
  147. `score` BIGINT DEFAULT NULL COMMENT '分数',
  148. `start_time` DATETIME DEFAULT NULL COMMENT '计划开始时间',
  149. `end_time` DATETIME DEFAULT NULL COMMENT '计划结束时间',
  150. `status` INT DEFAULT 0 COMMENT '状态(0:未发布 1:已发布 2:作废)',
  151. `type` VARCHAR(30) DEFAULT 0 COMMENT '选人方式(全部:all 随机:random)',
  152. `random_number` INT DEFAULT NULL COMMENT '随机人数',
  153. `assessment_template_id` BIGINT DEFAULT NULL COMMENT '考核模板id(assessment_template)',
  154. base_semester_id BIGINT DEFAULT NULL COMMENT '学期id(base_semester)',
  155. PRIMARY KEY (`id`) USING BTREE
  156. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核计划';
  157. -- ------------------------------------------------
  158. -- 考核模板题目
  159. -- ------------------------------------------------
  160. DROP TABLE IF EXISTS assessment_plan_question;
  161. CREATE TABLE `assessment_plan_question` (
  162. `id` BIGINT NOT NULL,
  163. `create_user_id` BIGINT DEFAULT NULL,
  164. `create_date` DATETIME(3) DEFAULT NULL,
  165. `modify_user_id` BIGINT DEFAULT NULL,
  166. `modify_date` DATETIME(3) DEFAULT NULL,
  167. `delete_mark` INT DEFAULT NULL,
  168. `enabled_mark` INT DEFAULT NULL,
  169. `sort_code` INT DEFAULT NULL,
  170. `name` VARCHAR(100) DEFAULT NULL COMMENT '题目题干',
  171. `score` BIGINT DEFAULT NULL COMMENT '分数',
  172. `type` VARCHAR(100) DEFAULT NULL COMMENT '题目类型',
  173. `category` INT DEFAULT NULL COMMENT '类别(1:大题 2:小题 3:选项)',
  174. `parent_id` BIGINT DEFAULT NULL COMMENT '父级id',
  175. `required` SMALLINT DEFAULT 1 COMMENT '小题是否必填(1:是 0:否)',
  176. `assessment_template_plan_id` BIGINT DEFAULT NULL COMMENT '考核计划id(assessment_template_plan)',
  177. PRIMARY KEY (`id`) USING BTREE
  178. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核模板题目';
  179. -- ------------------------------------------------
  180. -- 考核计划答题参与班级
  181. -- ------------------------------------------------
  182. DROP TABLE IF EXISTS assessment_plan_answer_class;
  183. CREATE TABLE `assessment_plan_answer_class` (
  184. `id` BIGINT NOT NULL,
  185. `create_user_id` BIGINT DEFAULT NULL,
  186. `create_date` DATETIME(3) DEFAULT NULL,
  187. `modify_user_id` BIGINT DEFAULT NULL,
  188. `modify_date` DATETIME(3) DEFAULT NULL,
  189. `delete_mark` INT DEFAULT NULL,
  190. `enabled_mark` INT DEFAULT NULL,
  191. `class_id` BIGINT DEFAULT NULL COMMENT '班级id',
  192. `is_confirm` INT DEFAULT 0 COMMENT '班主任是否确认(0:否 1:是)',
  193. `assessment_template_plan_id` BIGINT DEFAULT NULL COMMENT '考核计划id(assessment_template_plan)',
  194. PRIMARY KEY (`id`) USING BTREE
  195. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核计划答题参与班级';
  196. -- ------------------------------------------------
  197. -- 考核计划答题参与学生
  198. -- ------------------------------------------------
  199. DROP TABLE IF EXISTS assessment_plan_answer_student;
  200. CREATE TABLE `assessment_plan_answer_student` (
  201. `id` BIGINT NOT NULL,
  202. `create_user_id` BIGINT DEFAULT NULL,
  203. `create_date` DATETIME(3) DEFAULT NULL,
  204. `modify_user_id` BIGINT DEFAULT NULL,
  205. `modify_date` DATETIME(3) DEFAULT NULL,
  206. `delete_mark` INT DEFAULT NULL,
  207. `enabled_mark` INT DEFAULT NULL,
  208. `student_user_id` BIGINT DEFAULT NULL COMMENT '学生id',
  209. `is_confirm` INT DEFAULT 0 COMMENT '班主任是否确认(0:否 1:是)',
  210. `submit_status` INT DEFAULT 0 COMMENT '状态(0:未答题 1:已答题)',
  211. `assessment_template_plan_id` BIGINT DEFAULT NULL COMMENT '考核计划id(assessment_template_plan)',
  212. PRIMARY KEY (`id`) USING BTREE
  213. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核计划答题参与学生';
  214. -- ------------------------------------------------
  215. -- 考核答题结果
  216. -- ------------------------------------------------
  217. DROP TABLE IF EXISTS assessment_plan_answer_result;
  218. CREATE TABLE `assessment_plan_answer_result` (
  219. `id` BIGINT NOT NULL,
  220. `create_user_id` BIGINT DEFAULT NULL,
  221. `create_date` DATETIME(3) DEFAULT NULL,
  222. `modify_user_id` BIGINT DEFAULT NULL,
  223. `modify_date` DATETIME(3) DEFAULT NULL,
  224. `delete_mark` INT DEFAULT NULL,
  225. `enabled_mark` INT DEFAULT NULL,
  226. `student_user_id` BIGINT DEFAULT NULL COMMENT '学生id',
  227. `question_id` BIGINT DEFAULT NULL COMMENT '选项id(assessment_plan_question[category=2的id])',
  228. `answer_id` VARCHAR(40) DEFAULT NULL COMMENT '选项id(assessment_plan_question[category=3的id])',
  229. `assessment_template_plan_id` BIGINT DEFAULT NULL COMMENT '考核计划id(assessment_template_plan)',
  230. PRIMARY KEY (`id`) USING BTREE
  231. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考核答题结果';
  232. DROP TABLE IF EXISTS day_time_select;
  233. CREATE TABLE `day_time_select` (
  234. `time` DOUBLE DEFAULT NULL
  235. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;