sqlManage.sql 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. /*
  2. 数据库更新的sql语句跟随git进行提交。
  3. 每次git更新之后,请务必仔细留意并阅读数据库更新脚本文档sqlManageUpdate.md
  4. */
  5. /*
  6. ---------------------------------------------------------------------
  7. -- @author andy.wu
  8. -- @description 公共备注表(ahrs_public_notes)新增文件路径字段(attachment)
  9. -- @time 2023.2.20 16:07
  10. -- @IndexNumber serial_1 对应sql文档的序号
  11. ---------------------------------------------------------------------
  12. alter table ahrs_public_notes
  13. add attachment varchar(255) comment '附件路径';
  14. */
  15. /*
  16. ---------------------------------------------------------------------
  17. -- @author linian
  18. -- @description 修改招聘的学历、学位字典排序
  19. -- @time 2023.2.22 10:02
  20. -- @IndexNumber serial_2
  21. ---------------------------------------------------------------------
  22. UPDATE sys_dict_data SET dict_sort = '1' WHERE dict_type = 'recruit_education' AND dict_value = '5';
  23. UPDATE sys_dict_data SET dict_sort = '2' WHERE dict_type = 'recruit_education' AND dict_value = '4';
  24. UPDATE sys_dict_data SET dict_sort = '3' WHERE dict_type = 'recruit_education' AND dict_value = '3';
  25. UPDATE sys_dict_data SET dict_sort = '4' WHERE dict_type = 'recruit_education' AND dict_value = '2';
  26. UPDATE sys_dict_data SET dict_sort = '5' WHERE dict_type = 'recruit_education' AND dict_value = '1';
  27. UPDATE sys_dict_data SET dict_sort = '6' WHERE dict_type = 'recruit_education' AND dict_value = '6';
  28. UPDATE sys_dict_data SET dict_sort = '7' WHERE dict_type = 'recruit_education' AND dict_value = '7';
  29. UPDATE sys_dict_data SET dict_sort = '0' WHERE dict_type = 'recruit_degree' AND dict_value = '5';
  30. UPDATE sys_dict_data SET dict_sort = '1' WHERE dict_type = 'recruit_degree' AND dict_value = '4';
  31. UPDATE sys_dict_data SET dict_sort = '2' WHERE dict_type = 'recruit_degree' AND dict_value = '3';
  32. UPDATE sys_dict_data SET dict_sort = '3' WHERE dict_type = 'recruit_degree' AND dict_value = '2';
  33. UPDATE sys_dict_data SET dict_sort = '4' WHERE dict_type = 'recruit_degree' AND dict_value = '1';
  34. UPDATE sys_dict_data SET dict_sort = '5' WHERE dict_type = 'recruit_degree' AND dict_value = '0';
  35. */
  36. /*
  37. -----------------------------------------------------------------------
  38. -- @author andy.wu
  39. -- @description 调动信息表(ahrs_post_transfer),新增人事综合管理部门意见(rszhgl_dept_comment),新增调出单位意见(export_dept_comment)字段
  40. -- @time 2023.2.24 16:07
  41. -- @IndexNumber serial_3
  42. -----------------------------------------------------------------------
  43. */
  44. alter table ahrs_post_transfer
  45. add rszhgl_dept_comment varchar(255) comment '人事综合管理部门意见';
  46. alter table ahrs_post_transfer
  47. add export_dept_comment varchar(255) comment '调出单位意见';
  48. /*
  49. -----------------------------------------------------------------------
  50. -- @author andy.wu
  51. -- @description 创建消息通知表(sys_message_notice) 用于消息通知模块
  52. -- @time 2023.2.28 16:20
  53. -- @IndexNumber serial_4
  54. -----------------------------------------------------------------------
  55. */
  56. create table sys_message_notice
  57. (
  58. message_id bigint auto_increment comment '消息id'
  59. primary key,
  60. message_content varchar(255) null comment '消息内容',
  61. message_execution_time datetime null comment '执行时间',
  62. create_by varchar(255) default 'admin' null comment '创建人',
  63. status char(2) default '0' null comment '状态(0正常,1作废)'
  64. )
  65. comment '消息通知表';
  66. /*
  67. -----------------------------------------------------------------------
  68. -- @author andy.wu
  69. -- @description 新增定时任务 ,每半小时查询一次数据库更新redis的消息有序列表 (已作废)
  70. -- @time 2023.3.5 12:34
  71. -- @IndexNumber serial_5
  72. -----------------------------------------------------------------------
  73. */
  74. # INSERT INTO `sys_job`(`job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '定时查询消息更新数据库', 'DEFAULT', 'MessageForRedisTask.messageForRedisTask()', '0 0/30 * * * ?', '3', '1', '0', 'admin', '2023-03-01 15:51:56', '', '2023-03-01 15:55:36', '');
  75. /*
  76. -----------------------------------------------------------------------
  77. -- @author linian
  78. -- @description 将角色名称中代理改为辅助
  79. -- @time 2023.3.9 10:22
  80. -- @IndexNumber serial_6
  81. -----------------------------------------------------------------------
  82. */
  83. update sys_role set role_name = '人事综合管理部门终审领导辅助' where role_key = 'manageOperatorAgent';
  84. update sys_role set role_name = '人事综合管理部门初审领导辅助' where role_key = 'managePriLeaderAgent';
  85. update sys_role set role_name = '人事综合管理部门操作员辅助' where role_key = 'manageHigLeaderAgent';
  86. /*
  87. -----------------------------------------------------------------------
  88. -- @author linian
  89. -- @description 人员状态中主管部门取消,统一改为 事业单位到事业单位交流
  90. -- @time 2023.3.9 10:22
  91. -- @IndexNumber serial_7
  92. -----------------------------------------------------------------------
  93. */
  94. UPDATE sys_dict_data SET dict_label = '事业单位到事业单位交流' WHERE dict_type = 'per_status' AND dict_value = '2301';
  95. UPDATE sys_dict_data SET status = '1' WHERE dict_type = 'per_status' AND dict_value = '2304';
  96. /*
  97. -----------------------------------------------------------------------
  98. -- @author andy.wu
  99. -- @description 消息表新增执行结束时间 message_end_time,删除定时刷新redis的任务
  100. -- @time 2023.3.10 9:26
  101. -- @IndexNumber serial_8
  102. -----------------------------------------------------------------------
  103. */
  104. alter table sys_message_notice add message_end_time datetime comment '执行结束时间';
  105. delete from sys_job where job_name='定时查询消息更新数据库';
  106. /*
  107. -----------------------------------------------------------------------
  108. -- @author linian
  109. -- @description 创建短信记录表,用于记录保存每一次的短信内容
  110. -- @time 2023.3.16 10:22
  111. -- @IndexNumber serial_9
  112. -----------------------------------------------------------------------
  113. */
  114. create table sys_msg_record
  115. (
  116. id varchar(36) not null comment '短信记录id'
  117. primary key,
  118. tel varchar(16) null comment '发送号码',
  119. msg varchar(2048) null comment '短信内容',
  120. send_result varchar(128) null comment '发送返回结果',
  121. send_time datetime not null comment '发送时间',
  122. sender varchar(32) null comment '发送人',
  123. remark varchar(256) null comment '备注',
  124. version varchar(4) null comment '版本',
  125. create_by varchar(32) null comment '创建人',
  126. create_time datetime null comment '创建时间',
  127. update_by varchar(32) null comment '修改人',
  128. update_time datetime null comment '修改时间',
  129. del_flag varchar(2) null comment '删除标识 00 未删除 01 已删除'
  130. )
  131. comment '短信记录表';
  132. /*
  133. -----------------------------------------------------------------------
  134. -- @author linian
  135. -- @description 添加短信日志菜单及子菜单
  136. -- @time 2023.3.16 10:22
  137. -- @IndexNumber serial_10
  138. -----------------------------------------------------------------------
  139. */
  140. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '短信日志', 2053, 6, '/system/msgLog', 'menuItem', 'C', '0', 'system:msgLog:view', '#', 'admin', '2022-11-17 15:25:40', '', null, '');
  141. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '日志查询', 2306, 1, '#', 'menuItem', 'F', '', 'system:msgLog:list', '#', 'admin', '2022-11-17 15:26:08', 'admin', '2022-11-17 15:26:39', '');
  142. /*
  143. -----------------------------------------------------------------------
  144. -- @author wengchengjian
  145. -- @description 将人员表的人员状态是不同主管单位间调用的改成单位间调动
  146. -- @time 2023.3.17 9:13 serial_11
  147. -----------------------------------------------------------------------
  148. */
  149. UPDATE ahrs_personnel SET personnel_status = '2301' WHERE personnel_status = '2304'
  150. /*
  151. -----------------------------------------------------------------------
  152. -- @author linian
  153. -- @description 处分表添加处分截止时间
  154. -- @time 2023.3.17 10:06
  155. -- @IndexNumber serial_12
  156. -----------------------------------------------------------------------
  157. */
  158. alter table ahrs_disposition
  159. add approval_end_time datetime null comment '处分截止时间' after approval_time;
  160. /*
  161. -----------------------------------------------------------------------
  162. -- @author linian
  163. -- @description 修改添加处分字典值
  164. -- @time 2023.3.17 14:26
  165. -- @IndexNumber serial_13
  166. -----------------------------------------------------------------------
  167. */
  168. -- 先删除原有的字典值
  169. delete from sys_dict_data where dict_type = 'dis_kind';
  170. -- 再添加新的字典值
  171. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 1, '党的纪律处分', '1', null, 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:30:03', '', '2023-03-17 10:44:23', null, '');
  172. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 1, '党内警告', '101', '1', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:36:02', '', '2023-03-17 10:44:27', null, '');
  173. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 2, '党内严重警告', '102', '1', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:36:19', '', '2023-03-17 10:44:30', null, '');
  174. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 3, '撤销党内职务', '103', '1', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:36:37', '', '2023-03-17 10:44:33', null, '');
  175. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 4, '留党察看', '104', '1', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:36:59', '', '2023-03-17 10:44:41', null, '');
  176. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 5, '开除党籍', '105', '1', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:37:37', '', '2023-03-17 10:44:47', null, '');
  177. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 2, '政务处分', '2', null, 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:31:43', '', '2023-03-17 10:44:50', null, '');
  178. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES (1, '警告', '201', '2', 'dis_kind', '', '', 'N', '0', '', '2020-04-08 19:19:37', '', '2023-03-17 10:47:07', null, '');
  179. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 2, '记过', '202', '2', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:33:12', '', '2023-03-17 10:47:12', null, '');
  180. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 3, '记大过', '203', '2', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:35:21', '', '2023-03-17 10:47:27', null, '');
  181. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 4, '降低岗位等级', '204', '2', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:33:44', '', '2023-03-17 10:47:52', null, '');
  182. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 5, '撤职', '205', '2', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:35:34', '', '2023-03-17 10:52:10', null, '');
  183. INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_parent_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark, ancestors) VALUES ( 6, '开除', '206', '2', 'dis_kind', null, null, 'N', '0', '', '2023-03-15 15:34:54', '', '2023-03-17 10:52:17', null, '');
  184. -- 将处分表中的原有字典值变更
  185. update ahrs_disposition set disposition_kind = '201' where disposition_kind = '01';
  186. update ahrs_disposition set disposition_kind = '202' where disposition_kind = '02';
  187. update ahrs_disposition set disposition_kind = '204' where disposition_kind = '03';
  188. update ahrs_disposition set disposition_kind = '206' where disposition_kind = '0104';
  189. /*
  190. -----------------------------------------------------------------------
  191. -- @author linian
  192. -- @description 添加系统更新日志菜单及子菜单
  193. -- @time 2023.3.17 16:37
  194. -- @IndexNumber serial_14
  195. -----------------------------------------------------------------------
  196. */
  197. /*
  198. *先执行第一句然后把第一句的ID放在后面四句的上级菜单ID
  199. */
  200. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '系统更新日志', 2053, 5, '/ahrs/sysLog', 'menuItem', 'C', '0', 'ahrs:sysLog:view', '#', 'admin', '2022-11-07 16:58:16', '', null, '');
  201. select * from sys_menu where menu_name='系统更新日志';
  202. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '日志查询', 2310, 1, '#', 'menuItem', 'F', '', 'ahrs:sysLog:list', '#', 'admin', '2022-11-07 16:59:13', '', null, '');
  203. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '日志新增', 2310, 2, '#', 'menuItem', 'F', '', 'ahrs:sysLog:add', '#', 'admin', '2022-11-07 16:59:53', '', null, '');
  204. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '日志删除', 2310, 3, '#', 'menuItem', 'F', '', 'ahrs:sysLog:remove', '#', 'admin', '2022-11-07 17:00:46', '', null, '');
  205. INSERT INTO sys_menu ( menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ( '日志修改', 2310, 4, '#', 'menuItem', 'F', '', 'ahrs:userRole:edit', '#', 'admin', '2022-11-07 17:01:08', '', null, '');
  206. /*
  207. -----------------------------------------------------------------------
  208. -- @author linian
  209. -- @description 创建系统更新日志表,用于保存系统更新日志的内容
  210. -- @time 2023.3.17 16:37
  211. -- @IndexNumber serial_15
  212. -----------------------------------------------------------------------
  213. */
  214. create table sys_log
  215. (
  216. log_id varchar(32) not null
  217. primary key,
  218. log_code varchar(32) not null comment '日志编码',
  219. log_title varchar(512) null comment '日志标题',
  220. log_content blob not null comment '日志内容',
  221. create_time datetime not null comment '创建时间',
  222. creater varchar(32) null comment '创建人',
  223. update_time datetime not null comment '更新时间',
  224. updater varchar(32) null comment '更新人员',
  225. delete_flag varchar(2) not null DEFAULT '00' comment '删除标识 00未删除 01已删除'
  226. )
  227. comment '系统日志';
  228. /*
  229. -----------------------------------------------------------------------
  230. -- @author andy.wu
  231. -- @description 消息表新增删除标志 del_flag
  232. -- @time 2023.3.17 16:51
  233. -- @IndexNumber serial_16
  234. -----------------------------------------------------------------------
  235. */
  236. alter table sys_message_notice add del_flag char(2) DEFAULT '0' comment '删除标志'
  237. /*
  238. -----------------------------------------------------------------------
  239. -- @author linian
  240. -- @description 招聘计划变动和招聘计划子表添加年龄条件字段,用于灵活判断招聘人员年龄是否超标
  241. -- @time 2023.3.23 09:28
  242. -- @IndexNumber serial_17
  243. -----------------------------------------------------------------------
  244. */
  245. alter table ahrs_recruit_plan_change
  246. add age_condition varchar(16) null comment '年龄条件' after age;
  247. alter table ahrs_recruit_plan_child
  248. add age_condition varchar(16) null comment '年龄条件' after age;
  249. /*
  250. -----------------------------------------------------------------------
  251. -- @author ding
  252. -- @description 新增人员备注表
  253. -- @time 2023.3.23 09:35
  254. -- @IndexNumber serial_18
  255. -----------------------------------------------------------------------
  256. */
  257. CREATE TABLE `ahrs_personnel_remark` (
  258. `id` int NOT NULL AUTO_INCREMENT COMMENT '备注id',
  259. `remark_dept_id` int NULL COMMENT '被备注单位id',
  260. `remark_dept_name` varchar(255) NULL COMMENT '被备注单位名称',
  261. `remark_idcard` varchar(255) NULL COMMENT '被备注的人',
  262. `remark_name` varchar(255) NULL COMMENT '被备注人名',
  263. `user_name` varchar(255) NULL COMMENT '备注人',
  264. `dept_name` varchar(255) NULL COMMENT '备注单位名称',
  265. `dept_id` int NULL COMMENT '备注单位id',
  266. `title` varchar(500) NULL COMMENT '备注内容',
  267. `attachment` varchar(255) NULL COMMENT '附件',
  268. `del_flag` varchar(255) NULL DEFAULT 0 COMMENT '是否删除',
  269. `create_by` varchar(255) NULL COMMENT '创建人',
  270. `create_time` datetime NULL COMMENT '创建时间',
  271. `update_by` varchar(255) NULL COMMENT '修改人',
  272. `update_time` datetime NULL COMMENT '修改时间',
  273. PRIMARY KEY (`id`)
  274. ) COMMENT = '人员备注表';
  275. /*
  276. -----------------------------------------------------------------------
  277. -- @author ding
  278. -- @description 人员备注菜单添加和权限配置
  279. -- @time 2023.3.23 09:35
  280. -- @IndexNumber serial_19
  281. -----------------------------------------------------------------------
  282. */
  283. INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2310, '人员备注控制', 2308, 2, '#', 'menuItem', 'F', '', 'ahrs:personnleRemark:viewTwo', '#', 'admin', '2023-03-24 10:46:31', 'admin', '2023-03-24 10:48:47', '');
  284. INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2309, '人员备注新增', 2308, 0, '#', 'menuItem', 'F', '', 'ahrs:personnleRemark:add', '#', 'admin', '2023-03-23 13:51:43', '', NULL, '');
  285. INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2308, '人员备注', 2077, 1, '#', 'menuItem', 'C', '', 'ahrs:personnleRemark:view', '#', 'admin', '2023-03-23 09:45:00', 'admin', '2023-03-23 10:18:45', '');
  286. /*操作员权限配置*/
  287. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (104, 2308);
  288. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (104, 2309);
  289. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (104, 2310);
  290. /*初审权限配置*/
  291. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (105, 2308);
  292. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (105, 2309);
  293. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (105, 2310);
  294. /*终审权限配置*/
  295. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (106, 2308);
  296. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (106, 2309);
  297. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (106, 2310);
  298. /*
  299. -----------------------------------------------------------------------
  300. -- @author wengchengjian
  301. -- @description 岗位变更表增加'确认函中修改后的备注'字段
  302. -- @time 2023.3.24 17:00
  303. -- @IndexNumber serial_20
  304. -----------------------------------------------------------------------
  305. */
  306. ALTER TABLE `ahrs_post_change`
  307. ADD COLUMN `confirmation_note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '确认函中修改后的备注' AFTER `org_staff_grades`;
  308. /*
  309. -----------------------------------------------------------------------
  310. -- @author wengchengjian
  311. -- @description 人员备注 显示已删除记录按钮 和 删除按钮 菜单添加 和 权限控制(仅操作员有这俩个权限)
  312. -- @time 2023.3.24 17:00
  313. -- @IndexNumber serial_20
  314. -----------------------------------------------------------------------
  315. */
  316. INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2312, '显示全部记录(包括删除)', 2308, 4, '#', 'menuItem', 'F', '', 'ahrs:personnleRemark:all', '#', 'admin', '2023-03-29 10:29:04', '', NULL, '');
  317. INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2311, '人员备注删除', 2308, 3, '#', 'menuItem', 'F', '', 'ahrs:personnleRemark:remove', '#', 'admin', '2023-03-29 10:09:01', '', NULL, '');
  318. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (104, 2311);
  319. INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (104, 2312);
  320. /*
  321. -----------------------------------------------------------------------
  322. -- @author andi.wu
  323. -- @description 用户表新增人员附件字段attachment
  324. -- @time 2023.03.30
  325. -- @IndexNumber serial_21
  326. -----------------------------------------------------------------------
  327. */
  328. alter table sys_user
  329. add attachment varchar(255) default '' comment '用户附件' after remark;
  330. /*
  331. -----------------------------------------------------------------------
  332. -- @author andi.wu
  333. -- @description 用户信息修改记录表新增附件字段
  334. -- @time 2023.03.30
  335. -- @IndexNumber serial_22
  336. -----------------------------------------------------------------------
  337. */
  338. alter table sys_user_change_log
  339. add attachment varchar(255) default '' comment '用户附件' after remark;
  340. /*
  341. -----------------------------------------------------------------------
  342. -- @author linian
  343. -- @description 备注,字数不足200的放大到200字
  344. -- @time 2023.4.12
  345. -- @IndexNumber serial_23
  346. -----------------------------------------------------------------------
  347. */
  348. alter table ahrs_recruit_plan_child modify remark varchar(1024) null comment '备注';
  349. alter table ahrs_post_transfer modify remark varchar(1024) default '' null comment '备注';
  350. alter table ahrs_recruit_plan_change modify remark varchar(1024) null comment '备注';
  351. alter table ahrs_review_apply modify remark varchar(1024) default '' null comment '备注';
  352. alter table ahrs_review_main modify remark varchar(1024) null comment '备注';
  353. alter table ahrs_review_personnel modify remark varchar(1024) default '' null comment '备注';
  354. alter table ahrs_second_post_change modify remark varchar(1024) null comment '备注';
  355. alter table ahrs_second_post_lsb modify remark varchar(1024) default '' null comment '备注';
  356. alter table sys_dict_data modify remark varchar(1024) null comment '备注';
  357. /*
  358. -----------------------------------------------------------------------
  359. -- @author wengchengjian
  360. -- @description 修改用户表的初始化审批权限
  361. -- @time 2023.04.12
  362. -- @IndexNumber serial_24
  363. -----------------------------------------------------------------------
  364. */
  365. UPDATE sys_user SET initialize = '' WHERE initialize IS NULL;
  366. /*
  367. -----------------------------------------------------------------------
  368. -- @author ding
  369. -- @description 岗位变动排序字段默认值设置为0 处理原本为null的数据
  370. -- @time 2023.4.12
  371. -- @IndexNumber serial_25
  372. -----------------------------------------------------------------------
  373. */
  374. ALTER TABLE `ahrs_post_change` MODIFY COLUMN `sort` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 0 COMMENT '排序' AFTER `user_status`;
  375. ALTER TABLE `ahrs_personnel_change` MODIFY COLUMN `sort` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 0 COMMENT '排序' AFTER `name`;
  376. UPDATE ahrs_personnel_change set sort = 0 WHERE sort is NULL or sort = '';
  377. UPDATE ahrs_post_change set sort = 0 WHERE sort is NULL or sort = '';
  378. /*
  379. -----------------------------------------------------------------------
  380. -- @author andi.wu
  381. -- @description 所有事业单位初始化状态关闭
  382. -- @time 2023.4.18
  383. -- @IndexNumber serial_26
  384. -----------------------------------------------------------------------
  385. */
  386. update sys_dept set initialized_permissions='0' where dept_category='3';
  387. /*
  388. -----------------------------------------------------------------------
  389. -- @author andi.wu
  390. -- @description 消息表增加显示位置字段
  391. -- @time 2023.5.4
  392. -- @IndexNumber serial_27
  393. -----------------------------------------------------------------------
  394. */
  395. alter table sys_message_notice
  396. add type_flag char(2) default '0' comment '显示标志(目前支持在首页和登录页显示)';
  397. /*
  398. -----------------------------------------------------------------------
  399. -- @author andi.wu
  400. -- @description 文件排序字段设置为int类型
  401. -- @time 2023.5.12
  402. -- @IndexNumber serial_28
  403. -----------------------------------------------------------------------
  404. */
  405. alter table ahrs_file
  406. modify sort int(11) null comment '排序字段';
  407. /*
  408. -----------------------------------------------------------------------
  409. -- @author andi.wu
  410. -- @description 用户表附件字段为null的都改为''
  411. -- @time 2023.6.1
  412. -- @IndexNumber serial_29
  413. -----------------------------------------------------------------------
  414. */
  415. update sys_user set attachment='' where attachment is null;
  416. update sys_user_change_log set attachment='' where attachment is null;
  417. /*
  418. -----------------------------------------------------------------------
  419. -- @author andi.wu
  420. -- @description 申报表新增备注字段
  421. -- @time 2023.6.14
  422. -- @IndexNumber serial_30
  423. -----------------------------------------------------------------------
  424. */
  425. alter table ahrs_declaration
  426. add comment varchar(1000) default '' comment '备注信息';
  427. /*
  428. -----------------------------------------------------------------------
  429. -- @author andi.wu
  430. -- @description 新增用户申请表
  431. -- @time 2023.6.19
  432. -- @IndexNumber serial_31
  433. -----------------------------------------------------------------------
  434. */
  435. create table ahrs_user_apply
  436. (
  437. apply_id bigint auto_increment comment '申请id'
  438. primary key,
  439. apply_dept_id bigint null comment '申请单位id',
  440. apply_dept_name varchar(255) null comment '申请单位名',
  441. apply_user_name varchar(255) null comment '申请人姓名',
  442. user_name varchar(255) null comment '用户名',
  443. simple_name varchar(255) null comment '用户简称',
  444. phonenumber varchar(255) null comment '手机号',
  445. password varchar(255) null comment '密码',
  446. key1 varchar(255) null comment '密钥',
  447. idcard varchar(255) null comment '身份证号',
  448. email varchar(255) null comment '邮箱',
  449. landline varchar(255) null comment '座机号码',
  450. apply_target_dept_name varchar(255) null comment '目标单位名',
  451. attachment varchar(255) null comment '附件',
  452. remark varchar(255) null comment '备注',
  453. apply_content char(2) default '0' null comment '申请内容(0新建用户 1启用用户 2作废用户)',
  454. del_flag char(2) default '0' null comment '删除标志(0未删除 1已删除)',
  455. apply_time datetime null comment '申请时间',
  456. apply_status char(2) default '0' null comment '审批情况(0同意 1拒绝 2忽略 )',
  457. salt varchar(255) null comment '随机盐',
  458. role_ids bigint null comment '角色id',
  459. recipient_id bigint null comment '接收人id',
  460. login_name varchar(255) null comment '登录名',
  461. apply_target_dept_id bigint null comment '目标单位id',
  462. status char(2) default '0' null comment '状态',
  463. user_id bigint null comment '用户id'
  464. )
  465. comment '用户申请表' collate = utf8_bin;
  466. /*
  467. -----------------------------------------------------------------------
  468. -- @author zeyuan
  469. -- @description act_hi_comment流程意见表添加 节点是否通过记录
  470. -- @time 2023.6.27
  471. -- @IndexNumber serial_32
  472. -----------------------------------------------------------------------
  473. */
  474. ALTER TABLE `act_hi_comment`
  475. ADD COLUMN `OPINION` varchar(50) NULL COMMENT '本次节点是否通过' AFTER `FULL_MSG_`;
  476. /*
  477. -----------------------------------------------------------------------
  478. -- @author andi.wu
  479. -- @description 用户表增加申请字段
  480. -- @time 2023.6.28
  481. -- @IndexNumber serial_33
  482. -----------------------------------------------------------------------
  483. */
  484. alter table sys_user
  485. add approve_status char(2) default '1' comment '审批用户标识(0同意 1不同意 默认为1)';
  486. /*
  487. -----------------------------------------------------------------------
  488. -- @author andi.wu
  489. -- @description 文件表新增显示标识字段
  490. -- @time 2023.8.31
  491. -- @IndexNumber serial_34
  492. -----------------------------------------------------------------------
  493. */
  494. alter table ahrs_file
  495. add show_flag char(2) not null default '0' comment '显示标识(主要用于上级指定文件给下级看)(省级为1,市级为2,默认为0)';
  496. # 创建两个联合索引
  497. create index ahrs_file_union_class
  498. on ahrs_file (classification, dept_id, del_flag, status);
  499. create index show_del_status_dept_id_
  500. on ahrs_file (show_flag, del_flag, status, dept_id);
  501. /*
  502. -----------------------------------------------------------------------
  503. -- @author andi.wu
  504. -- @description 新增港澳台字典数据,修改人员表字段foreigner的字节数为3
  505. -- @time 2023.9.5
  506. -- @IndexNumber serial_35
  507. -----------------------------------------------------------------------
  508. */
  509. insert into sys_dict_type( dict_name, dict_type, status, create_by, create_time )
  510. values( '港澳台同胞类型', 'hongkong_macao_taiwan_type', '0', 'admin', sysdate());
  511. insert into sys_dict_data ( dict_sort, dict_label, dict_value, dict_type, list_class, is_default, status, create_time )
  512. values ( 1, '否', '000', 'hongkong_macao_taiwan_type', 'default', 'Y', '0', sysdate() );
  513. insert into sys_dict_data ( dict_sort, dict_label, dict_value, dict_type, list_class, is_default, status, create_time )
  514. values ( 2, '港澳居民', '001', 'hongkong_macao_taiwan_type', 'default', 'Y', '0', sysdate() );
  515. insert into sys_dict_data ( dict_sort, dict_label, dict_value, dict_type, list_class, is_default, status, create_time )
  516. values ( 3, '台湾同胞', '002', 'hongkong_macao_taiwan_type', 'default', 'Y', '0', sysdate() );
  517. insert into sys_dict_data ( dict_sort, dict_label, dict_value, dict_type, list_class, is_default, status, create_time )
  518. values ( 4, '外籍人士', '003', 'hongkong_macao_taiwan_type', 'default', 'Y', '0', sysdate() ) ;
  519. insert into sys_dict_data ( dict_sort, dict_label, dict_value, dict_type, list_class, is_default, status, create_time )
  520. values ( 5, '留学归国', '004', 'hongkong_macao_taiwan_type', 'default', 'Y', '0', sysdate() );
  521. alter table ahrs_personnel
  522. modify foreigner char(3) default '000' null comment '是否港澳台及外籍人士';
  523. alter table ahrs_personnel_now
  524. modify foreigner char(3) default '' null comment '是否港澳台及外籍人士';
  525. alter table ahrs_personnel_lsb
  526. modify foreigner char(3) default '' null comment '是否港澳台及外籍人士';
  527. /*
  528. -----------------------------------------------------------------------
  529. -- @author andi.wu
  530. -- @description 人员历史变更表新增操作类型字段
  531. -- @time 2023.9.11
  532. -- @IndexNumber serial_36
  533. -----------------------------------------------------------------------
  534. */
  535. alter table sys_user_change_log
  536. add operate_type char(2) default '' not null comment '操作类型';
  537. /*
  538. -----------------------------------------------------------------------
  539. -- @author andi.wu
  540. -- @description 岗位变动表状态字段备注修改
  541. -- @time 2023.11.13
  542. -- @IndexNumber serial_37
  543. -----------------------------------------------------------------------
  544. */
  545. alter table ahrs_post_transfer
  546. modify status varchar(10) default '0' null comment '调动信息状态(0-未提交,1-已提交,2-同意,3-不同意,4-暂置)';
  547. /*
  548. -----------------------------------------------------------------------
  549. -- @author wengchengjian
  550. -- @description 招聘人员的学位字段改成手写的
  551. -- @time 2023.12.15
  552. -- @IndexNumber serial_38
  553. -----------------------------------------------------------------------
  554. */
  555. ALTER TABLE `ahrs_recruit_personnel_lsb`
  556. MODIFY COLUMN `degree` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学位' AFTER `education_certificate`;
  557. ALTER TABLE `ahrs_recruit_personnel_change`
  558. MODIFY COLUMN `degree` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学位' AFTER `education_certificate`;
  559. ALTER TABLE `ahrs_recruit_personnel`
  560. MODIFY COLUMN `degree` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '学位' AFTER `education_certificate`;
  561. UPDATE ahrs_recruit_personnel_lsb set degree = CONCAT('{"tree":"',degree,'"}');
  562. UPDATE ahrs_recruit_personnel_change set degree = CONCAT('{"tree":"',degree,'"}');
  563. UPDATE ahrs_recruit_personnel set degree = CONCAT('{"tree":"',degree,'"}');
  564. /*
  565. -----------------------------------------------------------------------
  566. -- @author wengchengjian
  567. -- @description 人员的是否港澳台的默认值修改
  568. -- @time 2024.1.30
  569. -- @IndexNumber serial_39
  570. -----------------------------------------------------------------------
  571. */
  572. ALTER TABLE `ahrs_personnel`
  573. MODIFY COLUMN `foreigner` char(3) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '是否港澳台及外籍人士' AFTER `personnel_status`;
  574. /*
  575. -----------------------------------------------------------------------
  576. -- @author wengchengjian
  577. -- @description 招聘结果修改字典和增加职称字段
  578. -- @time 2024.2.1
  579. -- @IndexNumber serial_40
  580. -----------------------------------------------------------------------
  581. */
  582. ALTER TABLE `ahrs_recruit_personnel_lsb`
  583. ADD COLUMN `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '职称' AFTER `letter`;
  584. ALTER TABLE `ahrs_recruit_personnel_change`
  585. ADD COLUMN `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '职称' AFTER `back_by`;
  586. ALTER TABLE `ahrs_recruit_personnel`
  587. ADD COLUMN `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '职称' AFTER `status`;
  588. INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_parent_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `REMARK`, `ancestors`) VALUES (0, '博士研究生', '0', NULL, 'recruit_per_education', NULL, NULL, 'N', '0', '', '2022-10-26 19:31:45', 'admin', '2022-10-26 19:33:48', NULL, '');
  589. UPDATE sys_dict_data set dict_label = '硕士研究生' WHERE dict_code = 17234;