SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE `tb_goods_config` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id' ,
`orgId`  int(11) NULL DEFAULT NULL COMMENT '项目Id' ,
`type`  int(11) NULL DEFAULT NULL COMMENT '1 企业审核 2物业审核' ,
`roleId`  int(11) NULL DEFAULT NULL COMMENT '角色Id' ,
`sort`  int(11) NULL DEFAULT NULL COMMENT '排序' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
ROW_FORMAT=Dynamic
;

ALTER TABLE `tb_goods_release` ADD COLUMN `type`  int(11) NULL DEFAULT NULL COMMENT '审批类型' AFTER `userId`;

ALTER TABLE `tb_goods_release` ADD COLUMN `roleId`  int(11) NULL DEFAULT NULL COMMENT '审批角色' AFTER `type`;

ALTER TABLE `tb_goods_release` ADD COLUMN `sort`  int(11) NULL DEFAULT NULL COMMENT '审批排序' AFTER `roleId`;

CREATE TABLE `tb_servicetypeinfo_child` (
`id`  int(11) NOT NULL AUTO_INCREMENT COMMENT '服务二级id' ,
`service_id`  int(11) NULL DEFAULT NULL COMMENT '服务Id' ,
`child_name`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '服务二级权限' ,
`code`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
ROW_FORMAT=Dynamic
;

ALTER TABLE `tb_virtualarchitecture` ADD COLUMN `level`  int(2) NULL DEFAULT 1 COMMENT '1.普通 2.代理' AFTER `meal_card`;

CREATE TABLE `tb_virtualarchitecture_agent` (
`pd`  bigint(11) NOT NULL AUTO_INCREMENT ,
`id`  int(11) NOT NULL COMMENT '企业id' ,
`agent_id`  int(11) NOT NULL COMMENT '代理企业id' ,
PRIMARY KEY (`pd`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
ROW_FORMAT=Dynamic
;

CREATE TABLE `tb_virtualarchitecture_range` (
`pd`  bigint(11) NOT NULL AUTO_INCREMENT ,
`id`  int(11) NOT NULL COMMENT '企业id' ,
`room_id`  int(11) NOT NULL COMMENT '房间号id' ,
`floor_id`  int(11) NULL DEFAULT NULL COMMENT '楼层Id' ,
`build_id`  int(11) NULL DEFAULT NULL COMMENT '楼栋Id' ,
PRIMARY KEY (`pd`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
ROW_FORMAT=Dynamic
;

ALTER TABLE `tb_vir_perm_config` ADD COLUMN `checkRole`  int(11) NULL DEFAULT 0 COMMENT '审核放行员 0不是 1是' AFTER `virId`;

CREATE TABLE `tr_vir_service_child` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT ,
`virPermId`  int(11) NULL DEFAULT NULL COMMENT '企业权限类型ID' ,
`serviceChildId`  int(11) NULL DEFAULT NULL COMMENT '服务功能二级ID' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
ROW_FORMAT=Dynamic;

SET FOREIGN_KEY_CHECKS=1;

INSERT INTO `tb_servicetypeinfo_child` (`id`, `service_id`, `child_name`, `code`) VALUES ('1', '111', '审核', '1000');
