-- MySQL Script generated by MySQL Workbench
-- Sun Apr 28 10:32:05 2019
-- Model: New Model    Version: 1.0
-- MySQL Workbench Forward Engineering

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

-- -----------------------------------------------------
-- Schema aroad
-- -----------------------------------------------------

-- -----------------------------------------------------
-- Schema aroad
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `aroad` DEFAULT CHARACTER SET utf8 ;
USE `aroad` ;

-- -----------------------------------------------------
-- Table `aroad`.`info_templates`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `aroad`.`info_templates` ;

CREATE TABLE IF NOT EXISTS `aroad`.`info_templates` (
  `template_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '模板id',
  `template_name` varchar(50) NOT NULL COMMENT '模板名称',
  `template_type` varchar(20) NOT NULL COMMENT '模板类型',
  `template_content` longtext NOT NULL COMMENT '模板内容',
  `template_use` varchar(100) NOT NULL COMMENT '模板用途',
  `create_dept_id` int(11) NOT NULL COMMENT '创建单位id',
  `creater_id` int(11) NOT NULL COMMENT '创建人id',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`template_id`))
ENGINE = InnoDB
COMMENT = '信息模板表';

-- -----------------------------------------------------
-- Table `aroad`.`info_informations`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `aroad`.`info_informations` ;

CREATE TABLE IF NOT EXISTS `aroad`.`info_informations` (
  `info_id` INT NOT NULL AUTO_INCREMENT COMMENT '信息id',
  `template_id` INT NOT NULL COMMENT '模板id',
  `info_title` VARCHAR(100) NOT NULL COMMENT '信息标题',
  `info_content` TEXT NOT NULL COMMENT '信息内容',
  `info_remark` VARCHAR(100) NULL COMMENT '信息备注',
  `reporter_id` INT NOT NULL COMMENT '发布人id',
  `reporting_time` DATETIME NOT NULL COMMENT '上报时间',
  PRIMARY KEY (`info_id`))
ENGINE = InnoDB
COMMENT = '信息表';


-- -----------------------------------------------------
-- Table `aroad`.`info_receivers`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `aroad`.`info_receivers` ;

CREATE TABLE IF NOT EXISTS `aroad`.`info_receivers` (
  `id` INT NOT NULL AUTO_INCREMENT COMMENT '主键',
  `info_id` INT NOT NULL COMMENT '信息id',
  `receiver_id` INT NOT NULL COMMENT '接收人id',
  PRIMARY KEY (`id`))
ENGINE = InnoDB
COMMENT = '信息接收人表';


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;




-- 信息报送
INSERT INTO `sys_menu` (
	`parent_id`,
	`component`,
	`permission`,
	`type`,
	`path`,
	`icon`,
	`menu_id`,
	`del_flag`,
	`create_time`,
	`sort`,
	`update_time`,
	`name`
)
VALUES
	(
		'-1',
		'',
		'',
		'0',
		'/info',
		'icon-bangzhushouji',
		'80000',
		'0',
		'2018-01-20 13:17:19',
		'9',
		'2018-07-29 13:38:19',
		'信息报送'
	);

-- 模板管理
INSERT INTO `sys_menu` (
	`parent_id`,
	`component`,
	`permission`,
	`type`,
	`path`,
	`icon`,
	`menu_id`,
	`del_flag`,
	`create_time`,
	`sort`,
	`update_time`,
	`name`
)
VALUES
	(
		'80000',
		'views/info/infotemplates/index',
		'',
		'0',
		'/attendance',
		'icon-bangzhushouji',
		'81000',
		'0',
		'2018-01-20 13:17:19',
		'2',
		'2018-07-29 13:38:19',
		'模板管理'
	);

-- 信息编制
INSERT INTO `sys_menu` (
	`parent_id`,
	`component`,
	`permission`,
	`type`,
	`path`,
	`icon`,
	`menu_id`,
	`del_flag`,
	`create_time`,
	`sort`,
	`update_time`,
	`name`
)
VALUES
	(
		'80000',
		'views/info/infoinformations/index',
		'',
		'0',
		'/attendance',
		'icon-bangzhushouji',
		'82000',
		'0',
		'2018-01-20 13:17:19',
		'2',
		'2018-07-29 13:38:19',
		'信息编制'
	);

-- 添加信息模板
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
    values ( '81000', null, 'infotemplate_add', '1', null, '1', '81001', '0', '2018-05-15 21:35:18', '0', '2018-07-29 13:38:59', '添加');
-- 删除信息模板
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
    values ( '81000', null, 'infotemplate_remove', '1', null, '1', '81002', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '删除');
-- 编辑信息模板
insert into `sys_menu` ( `parent_id`, `component`, `permission`, `type`, `path`, `icon`, `menu_id`, `del_flag`, `create_time`, `sort`, `update_time`, `name`)
    values ( '81000', null, 'infotemplate_edit', '1', null, '1', '81003', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '编辑');

