insert into td_person_from(from_id, from_code, from_name, status) value(12, 'live_share','直播分享',1)

CREATE TABLE ta_live_activity(
    `live_activity_id` INT NOT NULL AUTO_INCREMENT  COMMENT '直播活动id' ,
    `live_activity_title` VARCHAR(128)    COMMENT '直播活动标题' ,
    `org_id` INT    COMMENT '公司id' ,
    `city_id` INT    COMMENT '所属城市' ,
    `building_id` VARCHAR(128)    COMMENT '所属楼盘' ,
    `live_app` VARCHAR(32)    COMMENT '直播小程序' ,
    `live_room_param` VARCHAR(3072)    COMMENT '房间参数' ,
    `list_img` TEXT    COMMENT '封面图1' ,
    `detail_img` TEXT    COMMENT '封面图2' ,
    `live_detail_type` VARCHAR(32)    COMMENT '详情类型 0是模板，1是自定义' ,
    `detail_type_img` TEXT    COMMENT '详情图' ,
    `visit_num` INT    COMMENT '访问人数' ,
    `status` INT    COMMENT '状态' ,
    `qr_code` VARCHAR(3072)    COMMENT '二维码' ,
    `live_start_date` DATETIME    COMMENT '直播开始时间' ,
    `live_end_date` DATETIME    COMMENT '直播结束时间' ,
    `create_date` DATETIME    COMMENT '创建时间' ,
    `create_user` VARCHAR(64)    COMMENT '创建人' ,
    `update_date` DATETIME    COMMENT '修改时间' ,
    `update_user` VARCHAR(64)    COMMENT '修改人' ,
    `weight` INT    COMMENT '权重' ,
	`live_app_path` VARCHAR(3072)    COMMENT '直播跳转路径' ,
    PRIMARY KEY (live_activity_id)
) COMMENT = '直播活动表 ';;


CREATE TABLE td_live_dict(
    `id` VARCHAR(32) NOT NULL   COMMENT 'id' ,
    `live_plat_name` VARCHAR(128)    COMMENT '直播平台名称' ,
    `live_plat_value` VARCHAR(32)    COMMENT '直播平台id' ,
    `status` INT    COMMENT '状态' ,
    `create_date` DATETIME    COMMENT '创建时间' ,
    PRIMARY KEY (id)
) COMMENT = '直播字典表 ';;


INSERT INTO `td_miniapp_template_type` (`code`, `name`, `remark`, `create_date`) VALUES ('house', '选房结果通知', '选房结果通知', '2020-02-22 23:59:59');




INSERT INTO `sys_menu`(`menu_id`, `code`, `name`, `parent_code`, `icon`, `app_type`, `status`, `menu_root`, `sort_num`) VALUES (96, '/house', '在线选房', '-1', NULL, 'estateagent-admin', 1, 96, 13);
INSERT INTO `sys_menu`(`menu_id`, `code`, `name`, `parent_code`, `icon`, `app_type`, `status`, `menu_root`, `sort_num`) VALUES (97, '/house/list', '房源管理', '96', NULL, 'estateagent-admin', 1, 96, 1);
INSERT INTO `sys_menu`(`menu_id`, `code`, `name`, `parent_code`, `icon`, `app_type`, `status`, `menu_root`, `sort_num`) VALUES (98, '/activity/liveActivity/list/index', '直播活动', '4', NULL, 'estateagent-admin', 1, 4, 4);


insert INTO ta_role_menu (role_id,menu_id) SELECT role_id,96 from ta_role WHERE is_admin = 1;
insert INTO ta_role_menu (role_id,menu_id) SELECT role_id,97 from ta_role WHERE is_admin = 1;
insert INTO ta_role_menu (role_id,menu_id) SELECT role_id,98 from ta_role WHERE is_admin = 1;


INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (184, 97, '新增', 1, 'admin.salesBatch.add.post', NULL);
INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (185, 97, '删除', 1, 'admin.salesBatch.del', NULL);
INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (186, 97, '查看详情', 1, 'admin.salesBatch.detail.get', NULL);
INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (187, 98, '新增', 1, 'admin.live.add.post', NULL);
INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (188, 98, '删除', 1, 'admin.live.del', NULL);
INSERT INTO `sys_button_in_menu`(`btn_id`, `menu_id`, `name`, `status`, `code`, `remark`) VALUES (189, 98, '查看详情', 1, 'admin.live.detail.get', NULL);

insert INTO ta_role_button (role_id,btn_id) SELECT role_id,184 from ta_role WHERE is_admin = 1;
insert INTO ta_role_button (role_id,btn_id) SELECT role_id,185 from ta_role WHERE is_admin = 1;
insert INTO ta_role_button (role_id,btn_id) SELECT role_id,186 from ta_role WHERE is_admin = 1;
insert INTO ta_role_button (role_id,btn_id) SELECT role_id,187 from ta_role WHERE is_admin = 1;
insert INTO ta_role_button (role_id,btn_id) SELECT role_id,188 from ta_role WHERE is_admin = 1;
insert INTO ta_role_button (role_id,btn_id) SELECT role_id,189 from ta_role WHERE is_admin = 1;

INSERT INTO `estateagents`.`td_live_dict` (`id`, `live_plat_name`, `live_plat_value`, `status`, `create_date`) VALUES ('1', 'now', 'wxb825ab501296672e', '1', '2020-02-20 21:10:41');
INSERT INTO `estateagents`.`td_live_dict` (`id`, `live_plat_name`, `live_plat_value`, `status`, `create_date`) VALUES ('2', '斗鱼 ', 'wxca1e7ba3fe18ff12', '1', '2020-02-20 21:10:44');
INSERT INTO `estateagents`.`td_live_dict` (`id`, `live_plat_name`, `live_plat_value`, `status`, `create_date`) VALUES ('3', '虎牙 ', 'wx74767bf0b684f7d3', '1', '2020-02-20 21:10:47');
INSERT INTO `estateagents`.`td_live_dict` (`id`, `live_plat_name`, `live_plat_value`, `status`, `create_date`) VALUES ('4', '映客', 'wx6fa58869f7b65e7f', '0', '2020-02-20 21:10:51');
INSERT INTO `estateagents`.`td_live_dict` (`id`, `live_plat_name`, `live_plat_value`, `status`, `create_date`) VALUES ('5', '一直播', 'wxc4f812079fc9ff0d', '1', '2020-02-20 21:11:50');


INSERT INTO `td_biz_event_type`(`type_id`, `type_name`, `status`, `create_date`, `parent_type_id`) VALUES ('house', '房源', 1, '2020-02-21 14:04:06', NULL);