-- ----------------------------
2023-9-11
-- ----------------------------
ALTER TABLE mortals_xhx_user ADD COLUMN  `staffId` varchar(64)      COMMENT '员工Id，关联用户员工表';
ALTER TABLE mortals_xhx_user ADD COLUMN  `openId` varchar(64)      COMMENT '微信openId';

ALTER TABLE mortals_xhx_user ADD COLUMN  `serviceAprParams` varchar(1024) default ''     COMMENT '事件服务接口请求参数';
ALTER TABLE mortals_xhx_user ADD COLUMN  `customerId` bigint(20)    COMMENT '客户ID';
ALTER TABLE mortals_xhx_user ADD COLUMN  `shareCode` varchar(64)      COMMENT '员工分享码';


-- ----------------------------
-- 员工离职信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_staff_leave`;
CREATE TABLE mortals_xhx_staff_leave(
    `id` bigint(20)   AUTO_INCREMENT   COMMENT '序号，主键，自增长',
    `name` varchar(64)      COMMENT '员工姓名',
    `photoPath` varchar(255)      COMMENT '照片',
    `email` varchar(128)      COMMENT '邮件地址',
    `phoneNumber` varchar(128)      COMMENT '联系电话',
    `companyIds` varchar(128)      COMMENT '所属公司',
    `companyName` varchar(128)      COMMENT '所属公司名称',
    `positionName` varchar(128)      COMMENT '职位名称',
    `staffStatus` tinyint(2)    DEFAULT '3'  COMMENT '员工状态(1.正式,2.试用,3.离职)',
    `leaveDate` datetime      COMMENT '离职时间',
    `remark` varchar(255)      COMMENT '备注',
    `sumViews` int(4)    DEFAULT '0'  COMMENT '累计查看次数',
    `viewsByDay` int(4)    DEFAULT '0'  COMMENT '当日查看次数',
    `sendBusinessCardTimes` int(4)    DEFAULT '0'  COMMENT '发送名片次数',
    `createUserId` bigint(20) NOT NULL     COMMENT '创建用户',
    `createTime` datetime NOT NULL     COMMENT '创建时间',
    `updateUserId` bigint(20)      COMMENT '更新用户',
    `updateTime` datetime      COMMENT '更新时间',
PRIMARY KEY  (`id`)
,KEY `name` (`name`) USING BTREE
,KEY `companyIds` (`companyIds`) USING BTREE
,KEY `staffStatus` (`staffStatus`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='员工离职信息';



-- ----------------------------
-- 员工离职信息菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '员工离职信息', '/staff/leave/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);

-- ----------------------------
-- 员工离职信息资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '员工离职信息-菜单管理-查看', '/staff/leave/list,/staff/leave/view,/staff/leave/info,/staff/leave/export,/staff/leave/exportExcel,/staff/leave/downloadTemplate,/staff/leave/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '员工离职信息-菜单管理-维护', '/staff/leave/add,/staff/leave/edit,/staff/leave/delete,/staff/leave/logicDelete,/staff/leave/save,/staff/leave/importData', 3, 0, NULL, NULL, NULL, 0);

