/*
 Navicat MySQL Data Transfer

 Source Server         : imingsoft.cn
 Source Server Type    : MySQL
 Source Server Version : 50725
 Source Host           : imingsoft.cn:3307
 Source Schema         : db-mall-1-8

 Target Server Type    : MySQL
 Target Server Version : 50725
 File Encoding         : 65001

 Date: 07/02/2020 17:02:59
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for mdiy_dict
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_dict`;
CREATE TABLE `mdiy_dict`  (
  `dict_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `app_id` int(11) NULL DEFAULT NULL COMMENT '应用编号',
  `dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '' COMMENT '数据值',
  `dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '标签名',
  `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型',
  `dict_description` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述',
  `dict_sort` int(10) NOT NULL DEFAULT 0 COMMENT '排序（升序）',
  `dict_parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '0' COMMENT '父级编号',
  `is_child` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '子业务数据类型',
  `dict_remarks` varchar(1000) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注信息',
  `create_by` int(64) NULL DEFAULT 0 COMMENT '创建者',
  `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` int(64) NULL DEFAULT 0 COMMENT '更新者',
  `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `del` int(1) NOT NULL DEFAULT 0 COMMENT '删除标记',
  PRIMARY KEY (`dict_id`) USING BTREE,
  INDEX `fk_mdiy_dict`(`app_id`) USING BTREE,
  INDEX `dict_value`(`dict_value`) USING BTREE,
  INDEX `dict_label`(`dict_label`) USING BTREE,
  CONSTRAINT `mdiy_dict_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 684 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '字典表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mdiy_form
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_form`;
CREATE TABLE `mdiy_form`  (
  `form_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id',
  `form_tips_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '自定义表单提示文字',
  `form_table_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '自定义表单表名',
  `form_app_id` int(11) NOT NULL COMMENT '自定义表单关联的应用编号',
  `create_by` int(11) NULL DEFAULT NULL,
  `create_date` datetime(0) NULL DEFAULT NULL,
  `update_by` int(11) NULL DEFAULT NULL,
  `update_date` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`form_id`) USING BTREE,
  INDEX `fk_mdiy_form`(`form_app_id`) USING BTREE,
  CONSTRAINT `mdiy_form_ibfk_1` FOREIGN KEY (`form_app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '自定义表单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mdiy_model
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_model`;
CREATE TABLE `mdiy_model`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `model_json` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'json',
  `model_app_id` int(11) NULL DEFAULT NULL COMMENT '应用编号',
  `model_table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模型表名',
  `model_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模型名称',
  `model_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模型类型',
  `del` int(1) NULL DEFAULT NULL COMMENT '删除标记',
  `update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  `update_by` int(11) NULL DEFAULT NULL COMMENT '修改人',
  `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `create_by` int(11) NULL DEFAULT NULL COMMENT '创建人',
  `model_field` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `model_custom_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '自定义模型' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mdiy_page
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_page`;
CREATE TABLE `mdiy_page`  (
  `page_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id',
  `page_app_id` int(11) NOT NULL COMMENT '应用id',
  `page_model_id` int(11) NULL DEFAULT NULL COMMENT '模块id',
  `page_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自定义页面绑定模板的路径',
  `page_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自定义页面标题',
  `page_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字典分类字段',
  `page_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自定义页面访问路径',
  `create_date` datetime(0) NULL DEFAULT NULL,
  `create_by` int(11) NULL DEFAULT NULL,
  `update_by` int(11) NULL DEFAULT NULL,
  `update_date` datetime(0) NULL DEFAULT NULL,
  `del` int(1) NULL DEFAULT 0,
  PRIMARY KEY (`page_id`) USING BTREE,
  INDEX `index_page_key`(`page_key`) USING BTREE,
  INDEX `index_page_app_id`(`page_app_id`) USING BTREE,
  INDEX `index_page_model_id`(`page_model_id`) USING BTREE,
  CONSTRAINT `mdiy_page_ibfk_1` FOREIGN KEY (`page_app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 143 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '自定义页面表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mdiy_tag
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_tag`;
CREATE TABLE `mdiy_tag`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自定义标签编号',
  `tag_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签名称',
  `tag_type` int(1) NULL DEFAULT NULL COMMENT '标签类型',
  `tag_description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '标签' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mdiy_tag_sql
-- ----------------------------
DROP TABLE IF EXISTS `mdiy_tag_sql`;
CREATE TABLE `mdiy_tag_sql`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自定义sql编号',
  `tag_id` int(11) NOT NULL COMMENT '自定义标签编号',
  `tag_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '自定义sql支持ftl写法',
  `sort` int(11) NULL DEFAULT NULL COMMENT '排序升序',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_mdiy_tag_id`(`tag_id`) USING BTREE,
  CONSTRAINT `mdiy_tag_sql_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `mdiy_tag` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '标签对应多个sql语句' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
