SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `omc_db`.`sys_user`;
CREATE TABLE `omc_db`.`sys_user`  (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
  `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号',
  `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户昵称',
  `user_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'sys' COMMENT '用户类型（sys系统用户）',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱',
  `phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号码',
  `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户性别（0未知 1男 2女）',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态（0停用 1正常）',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志（0代表存在 1代表删除）',
  `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后登录IP',
  `login_date` bigint(20) NULL DEFAULT 0 COMMENT '最后登录时间',
  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` bigint(20) NULL DEFAULT 0 COMMENT '创建时间',
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` bigint(20) NULL DEFAULT 0 COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic;

INSERT IGNORE INTO
    `omc_db`.`sys_user` (
        `user_id`,
        `dept_id`,
        `user_name`,
        `nick_name`,
        `user_type`,
        `email`,
        `phonenumber`,
        `sex`,
        `avatar`,
        `password`,
        `status`,
        `del_flag`,
        `login_ip`,
        `login_date`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        1,
        NULL,
        'supervisor',
        'supervisor',
        'sys',
        '',
        '',
        '',
        '',
        '$2a$10$QgIcp6yuOEGrEU0TNU12K.uQRLbcufesEU7hiRYlRSSdUO7OAkoTq',
        '1',
        '0',
        '192.168.2.114',
        1698920815347,
        'admin',
        1697091656500,
        'supervisor',
        1698920815347,
        ''
    );

INSERT IGNORE INTO
    `omc_db`.`sys_user` (
        `user_id`,
        `dept_id`,
        `user_name`,
        `nick_name`,
        `user_type`,
        `email`,
        `phonenumber`,
        `sex`,
        `avatar`,
        `password`,
        `status`,
        `del_flag`,
        `login_ip`,
        `login_date`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        2,
        NULL,
        'admin',
        'admin',
        'sys',
        '',
        '',
        '',
        '',
        '$2a$10$QgIcp6yuOEGrEU0TNU12K.uQRLbcufesEU7hiRYlRSSdUO7OAkoTq',
        '1',
        '0',
        '192.168.2.219',
        1699338435424,
        'admin',
        1697091656500,
        'admin',
        1699338435425,
        ''
    );

INSERT IGNORE INTO
    `omc_db`.`sys_user` (
        `user_id`,
        `dept_id`,
        `user_name`,
        `nick_name`,
        `user_type`,
        `email`,
        `phonenumber`,
        `sex`,
        `avatar`,
        `password`,
        `status`,
        `del_flag`,
        `login_ip`,
        `login_date`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        100,
        NULL,
        'manager',
        'manager',
        'sys',
        '',
        '',
        '1',
        '',
        '$2a$10$RND3fUw9Ai.WcggYSI57tu.u3OIlktdPxFzlWkmiHC1paV038t0I2',
        '1',
        '0',
        '192.168.2.114',
        1698661596191,
        'admin',
        1698661521780,
        'admin',
        1699340083864,
        'manager'
    );

INSERT IGNORE INTO
    `omc_db`.`sys_user` (
        `user_id`,
        `dept_id`,
        `user_name`,
        `nick_name`,
        `user_type`,
        `email`,
        `phonenumber`,
        `sex`,
        `avatar`,
        `password`,
        `status`,
        `del_flag`,
        `login_ip`,
        `login_date`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        101,
        NULL,
        'monitor',
        'monitor',
        'sys',
        '',
        '',
        '1',
        '',
        '$2a$10$t3zpKQ0olECotFyI1yO43.tCoS0EXoSRBDcqwl09xvrsmn14qFHHy',
        '1',
        '0',
        '',
        0,
        'admin',
        1698661684898,
        'admin',
        1698740853724,
        ''
    );
    
SET FOREIGN_KEY_CHECKS=1;    