CREATE TABLE `smart_assess`.`sys_user`  (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录账号',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '用户昵称/姓名',
`identity` tinyint NOT NULL COMMENT '用户身份(0代表监管用户，1代表机构用户，2代表专家用户)',
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '邮箱',
`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '手机号码',
`sex` tinyint NULL DEFAULT 2 COMMENT '用户性别(0男，1女，2未知，默认2)',
`avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '头像路径',
`password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
`salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '盐加密',
`status` tinyint NULL DEFAULT 0 COMMENT '账号状态(0正常，1停用，默认0)',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0代表存在，1代表删除，默认0)',
`user_type` tinyint NULL DEFAULT 0 COMMENT '账号类型(0代表工作人员，1代表领导，默认0)',
`manage_region` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '管辖地区',
`expert_type` tinyint NULL DEFAULT 0 COMMENT '专家类型(0代表安全评价，1代表检验检测，默认0)',
`agency_id` bigint NULL DEFAULT NULL COMMENT '机构id',
`post` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '职务',
`job_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '职称',
`major` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '专业方向',
`state` tinyint(2) NULL DEFAULT 1 COMMENT '审批状态(0暂存，1审核中，2审批通过，3审批驳回，4已作废 默认1)',
`login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '最后登录ip',
`login_date` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后登录时间',
`pwd_update_date` datetime NULL DEFAULT NULL COMMENT '密码最后更新时间',
`version` int NULL DEFAULT 0 COMMENT '乐观锁',
`create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '创建者',
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '更新者',
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL  COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE,
INDEX `index_username`(`username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-- admin  admin@3.1416
insert into sys_user values(1,'admin', '国科鸿宇', 0, 'gkhy@163.com', '15888888888', 0, '', '1d3a86b6057285745c07a08dcc8ab078', '111111', 0, 0, 0,'',null,null,'','','',1,'127.0.0.1', sysdate(), sysdate(),1, 'admin', sysdate(), '', sysdate(), '管理员');
-- administrator  admin@3.1416
insert into sys_user values(2,'administrator', '智慧安评管理员', 0, 'gkhy2@163.com', '15888888889', 0, '', '275b57c4363e285d8beed63edfe350ee', '222222', 0, 0, 0,'',null,null,'','','',1,'127.0.0.1', sysdate(), sysdate(),1, 'admin', sysdate(), '', sysdate(), '管理员');
