/*
SQLyog 企业版 - MySQL GUI v8.14 
MySQL - 8.0.28 : Database - model2d3d_viewer_back
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`model2d3d_viewer_back` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `model2d3d_viewer_back`;

/*Table structure for table `basic_company` */

DROP TABLE IF EXISTS `basic_company`;

CREATE TABLE `basic_company` (
                                 `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
                                 `parent_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                 `company_name` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                 `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
                                 `create_time` bigint DEFAULT NULL,
                                 `modify_time` bigint DEFAULT NULL,
                                 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='企业表';

/*Data for the table `basic_company` */

insert  into `basic_company`(`id`,`parent_id`,`company_name`,`flag`,`create_time`,`modify_time`) values ('1','-1','MiniSolution',0,1658978002231,1658978002231);
/*Table structure for table `basic_menu` */

DROP TABLE IF EXISTS `basic_menu`;

CREATE TABLE `basic_menu` (
                              `id` bigint NOT NULL AUTO_INCREMENT,
                              `parent_menu_id` bigint DEFAULT NULL,
                              `menu_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `menu_name_en` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `menu_name_jp` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `remark` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `menu_level` int DEFAULT '1' COMMENT '菜单级别',
                              `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
                              `create_time` bigint DEFAULT NULL,
                              PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Data for the table `basic_menu` */

/*Table structure for table `basic_role` */

DROP TABLE IF EXISTS `basic_role`;

CREATE TABLE `basic_role` (
                              `id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
                              `company_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `role_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `description` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
                              `creator_id` bigint DEFAULT NULL,
                              `create_time` bigint DEFAULT NULL,
                              `modifier_id` bigint DEFAULT NULL,
                              `modify_time` bigint DEFAULT NULL,
                              PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `basic_role_menu_relation` */

DROP TABLE IF EXISTS `basic_role_menu_relation`;

CREATE TABLE `basic_role_menu_relation` (
                                            `role_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                            `menu_id` bigint DEFAULT NULL,
                                            `creator_id` bigint DEFAULT NULL,
                                            `create_time` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


/*Table structure for table `basic_role_user_relation` */

DROP TABLE IF EXISTS `basic_role_user_relation`;

CREATE TABLE `basic_role_user_relation` (
                                            `user_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                            `role_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                            `creator_id` bigint DEFAULT NULL,
                                            `create_time` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


/*Table structure for table `basic_user` */

DROP TABLE IF EXISTS `basic_user`;

CREATE TABLE `basic_user` (
                              `id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
                              `company_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
                              `shop_uuid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `login_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `password_modify_time` bigint DEFAULT NULL,
                              `salt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `mobile_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                              `last_login_time` bigint DEFAULT NULL,
                              `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
                              `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
                              `expire_time` bigint DEFAULT '4114487556000',
                              `create_time` bigint DEFAULT NULL,
                              `creator_id` bigint DEFAULT NULL,
                              `modify_time` bigint DEFAULT NULL,
                              `modifier_id` bigint DEFAULT NULL,
                              PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Data for the table `basic_user` */

insert  into `basic_user`(`id`,`company_id`,`shop_uuid`,`username`,`login_name`,`password`,`password_modify_time`,`salt`,`email`,`mobile_number`,`last_login_time`,`remark`,`flag`,`expire_time`,`create_time`,`creator_id`,`modify_time`,`modifier_id`) values ('1','1','1','admin_name','admin','nVg+buw0YAs=',1670312031273,'09bc3a7898','1053492832@qq.com',NULL,1743496632944,NULL,0,4114487556000,NULL,NULL,NULL,NULL);
/*Table structure for table `login_history` */

DROP TABLE IF EXISTS `login_history`;

CREATE TABLE `login_history` (
                                 `id` bigint NOT NULL AUTO_INCREMENT,
                                 `user_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                 `request_ip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                 `login_time` bigint DEFAULT NULL,
                                 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
