sqlManage.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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;