🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~[sql] /* Navicat Premium Data Transfer Source Server : dfc Source Server Type : MySQL Source Server Version : 50717 Source Host : localhost:3306 Source Schema : chaoshensu Target Server Type : MySQL Target Server Version : 50717 File Encoding : 65001 Date: 14/06/2018 17:32:40 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for admin_record -- ---------------------------- DROP TABLE IF EXISTS `admin_record`; CREATE TABLE `admin_record` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) NOT NULL COMMENT '管理id', `content` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作内容', `record` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作记录id', `result` tinyint(4) NOT NULL COMMENT '操作结果', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, CONSTRAINT `admin_record_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 90 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理操作记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for admin_user -- ---------------------------- DROP TABLE IF EXISTS `admin_user`; CREATE TABLE `admin_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登录时间', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录session_id', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `idx_admin_phone`(`phone`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for area_range -- ---------------------------- DROP TABLE IF EXISTS `area_range`; CREATE TABLE `area_range` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '筛选名称', `min_area` int(11) NOT NULL COMMENT '最小面积', `max_area` int(11) NOT NULL COMMENT '最大面积', `order` int(11) NOT NULL COMMENT '前端排序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_area_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '面积区间' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for banner -- ---------------------------- DROP TABLE IF EXISTS `banner`; CREATE TABLE `banner` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `img` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片地址', `url` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片路径', `order` int(11) NOT NULL COMMENT '图片排序', `show` tinyint(4) NOT NULL COMMENT '图片是否在前端显示', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加/发布时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_show`(`show`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'banner' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for browsing_history -- ---------------------------- DROP TABLE IF EXISTS `browsing_history`; CREATE TABLE `browsing_history` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `h_i_id` int(11) NOT NULL COMMENT '房源id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '浏览时间', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, CONSTRAINT `browsing_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `browsing_history_ibfk_2` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 81 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '浏览记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for city -- ---------------------------- DROP TABLE IF EXISTS `city`; CREATE TABLE `city` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '市名', `province_id` int(11) NOT NULL COMMENT '省id', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_city_name`(`name`) USING BTREE, INDEX `province_id`(`province_id`) USING BTREE, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '市' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for collect -- ---------------------------- DROP TABLE IF EXISTS `collect`; CREATE TABLE `collect` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `h_i_id` int(11) NOT NULL COMMENT '房源id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '收藏时间', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, CONSTRAINT `collect_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `collect_ibfk_2` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房源收藏' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for community -- ---------------------------- DROP TABLE IF EXISTS `community`; CREATE TABLE `community` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小区名称', `county_id` int(11) NOT NULL COMMENT '所在地区', `source` tinyint(4) NOT NULL COMMENT '来源', `landmark_id` int(11) NOT NULL COMMENT '对应的地标', `address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小区详细地址', `longitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在经度', `latitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在纬度', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_xq_name`(`name`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, INDEX `landmark_id`(`landmark_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, CONSTRAINT `community_ibfk_1` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `community_ibfk_2` FOREIGN KEY (`landmark_id`) REFERENCES `landmark` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `community_ibfk_3` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `community_ibfk_4` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小区信息表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for config -- ---------------------------- DROP TABLE IF EXISTS `config`; CREATE TABLE `config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `about` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '委托的房源', `protocol` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '协议', `watermark` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '水印', `deposit` bigint(20) NOT NULL COMMENT '看房押金', `allot_mode` tinyint(4) NOT NULL COMMENT '派单方式', `p_min` bigint(20) NOT NULL COMMENT '物业推荐最低佣金', `p_max` bigint(20) NOT NULL COMMENT '物业推荐最高佣金', `p_num` int(11) NOT NULL COMMENT '物业每天开门获利上限', `h_deposit` bigint(20) NOT NULL COMMENT '租房订金', `expire_day` int(11) NOT NULL COMMENT '租房到期提前提醒', `lock_time` int(11) NOT NULL COMMENT '电子锁到期时间', `show_time` int(11) NOT NULL COMMENT '看房时间', `over_time` int(11) NOT NULL COMMENT '超过时间', `amount` bigint(20) NOT NULL COMMENT '扣除押金', `deal_sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '成交奖励金', `overdue_day` tinyint(4) NOT NULL DEFAULT 1 COMMENT '租房逾期天数', `rent_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租住须知', `refund_explanation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '退款说明', `deposit_refund` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '押金退还事项', `extra_charge` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '额外收费说明', `long_rent_refund` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '长租退款说明', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '其他配置' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for cooperation_company -- ---------------------------- DROP TABLE IF EXISTS `cooperation_company`; CREATE TABLE `cooperation_company` ( `id` int(11) NOT NULL AUTO_INCREMENT, `company_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司名', `company_address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司详细地址', `principal_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人姓名', `principal_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人手机号', `account_type` tinyint(4) NOT NULL COMMENT '账户类型', `account_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账户姓名', `account_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '开户支行', `account` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收款账号', `s_time` date NOT NULL COMMENT '合作开始时间', `e_time` date NOT NULL COMMENT '合作结束时间', `divided_way` tinyint(4) NOT NULL COMMENT '分利方式', `day_money` bigint(20) NOT NULL DEFAULT 0 COMMENT '按天的金额', `proportion` int(11) NOT NULL DEFAULT 0 COMMENT '比例数据', `cooperation_deposit` bigint(20) NOT NULL DEFAULT 0 COMMENT '合作押金', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', PRIMARY KEY (`id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, CONSTRAINT `cooperation_company_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `cooperation_company_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '合作公司信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for cooperation_sale -- ---------------------------- DROP TABLE IF EXISTS `cooperation_sale`; CREATE TABLE `cooperation_sale` ( `id` int(11) NOT NULL AUTO_INCREMENT, `store_id` int(11) NOT NULL COMMENT '门店id', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '销售姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '销售状态', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `idx_c_sale_phone`(`phone`) USING BTREE, INDEX `idx_c_sale_name`(`name`) USING BTREE, INDEX `idx_c_sale_status`(`status`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, INDEX `store_id`(`store_id`) USING BTREE, CONSTRAINT `cooperation_sale_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `cooperation_sale_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `cooperation_sale_ibfk_3` FOREIGN KEY (`store_id`) REFERENCES `cooperation_store` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '合作公司下的销售信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for cooperation_sale_info -- ---------------------------- DROP TABLE IF EXISTS `cooperation_sale_info`; CREATE TABLE `cooperation_sale_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sale_id` int(11) NOT NULL COMMENT '销售id', `openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信openid', `photo` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '销售状态', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录状态', `nickname` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登录时间', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `sex` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别', PRIMARY KEY (`id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, CONSTRAINT `cooperation_sale_info_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '合作销售个人资料' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for cooperation_sale_mail -- ---------------------------- DROP TABLE IF EXISTS `cooperation_sale_mail`; CREATE TABLE `cooperation_sale_mail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间', `c_sale_id` int(11) NOT NULL COMMENT '销售id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否阅读', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_cxs_title`(`title`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `cooperation_sale_mail_ibfk_1` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '销售站内信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for cooperation_store -- ---------------------------- DROP TABLE IF EXISTS `cooperation_store`; CREATE TABLE `cooperation_store` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门店名', `county_id` int(11) NOT NULL COMMENT '门店地址', `address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门店详细地址', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店长姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店长手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码', `session_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录状态', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '用户状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后一次登录时间', `company_id` int(11) NOT NULL COMMENT '公司id', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', PRIMARY KEY (`id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, INDEX `company_id`(`company_id`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, CONSTRAINT `cooperation_store_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `cooperation_store_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `cooperation_store_ibfk_3` FOREIGN KEY (`company_id`) REFERENCES `cooperation_company` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `cooperation_store_ibfk_4` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '合作公司下的门店信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for county -- ---------------------------- DROP TABLE IF EXISTS `county`; CREATE TABLE `county` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '县(区)名', `city_id` int(11) NOT NULL COMMENT '市id', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_county_name`(`name`) USING BTREE, INDEX `city_id`(`city_id`) USING BTREE, CONSTRAINT `county_ibfk_1` FOREIGN KEY (`city_id`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '县(区)' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for door_lock -- ---------------------------- DROP TABLE IF EXISTS `door_lock`; CREATE TABLE `door_lock` ( `id` int(11) NOT NULL AUTO_INCREMENT, `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电子锁序号', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '完善时间', `status` tinyint(4) NOT NULL DEFAULT 0, `password` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电子锁密码', PRIMARY KEY (`id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, CONSTRAINT `door_lock_ibfk_1` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '电子锁' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for entrust_contract -- ---------------------------- DROP TABLE IF EXISTS `entrust_contract`; CREATE TABLE `entrust_contract` ( `id` int(11) NOT NULL AUTO_INCREMENT, `l_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房东姓名', `l_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房东手机号', `l_id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房东身份证号', `h_address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房源详细地址', `r_s_time` datetime(0) NOT NULL COMMENT '租房开始时间', `r_e_time` datetime(0) NOT NULL COMMENT '租房结束时间', `p_time` json NOT NULL COMMENT '付款时间段', `is_pay` tinyint(4) NOT NULL COMMENT '是否代缴水电气', `is_settle` tinyint(4) NOT NULL COMMENT '水电气是否结清', `water` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '水初始值', `electric` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电初始值', `gas` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '气初始值', `s_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '监督电话', `a_type` tinyint(4) NOT NULL COMMENT '账户类型', `c_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司名/个人名', `p_m` tinyint(4) NOT NULL COMMENT '收款方式', `payee` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收款人姓名', `account` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收款人账号', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `r_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租客姓名', `r_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租客手机号', `r_id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租客身份证号', `facility` json NULL COMMENT '房间设施', `other` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其他说明', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '完善时间', PRIMARY KEY (`id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, INDEX `r_id`(`r_id`) USING BTREE, CONSTRAINT `entrust_contract_ibfk_1` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `entrust_contract_ibfk_2` FOREIGN KEY (`r_id`) REFERENCES `room` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '租前合同' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for external_long_commission -- ---------------------------- DROP TABLE IF EXISTS `external_long_commission`; CREATE TABLE `external_long_commission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `min` bigint(20) NOT NULL COMMENT '最低租金', `max` bigint(20) NOT NULL COMMENT '最高租金', `proportion` tinyint(4) NOT NULL COMMENT '提成比例', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '外部长租提成' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for external_short_commission -- ---------------------------- DROP TABLE IF EXISTS `external_short_commission`; CREATE TABLE `external_short_commission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `min` bigint(20) NOT NULL COMMENT '最低租金', `max` bigint(20) NOT NULL COMMENT '最高租金', `proportion` tinyint(4) NOT NULL COMMENT '提成比例', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '外部短租提成' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for faq -- ---------------------------- DROP TABLE IF EXISTS `faq`; CREATE TABLE `faq` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '常见问题及答疑' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for house_entrust -- ---------------------------- DROP TABLE IF EXISTS `house_entrust`; CREATE TABLE `house_entrust` ( `id` int(11) NOT NULL AUTO_INCREMENT, `province_id` int(11) NOT NULL COMMENT '省id', `h_province` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在省名', `city_id` int(11) NOT NULL COMMENT '市id', `h_city` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在市名', `county_id` int(11) NOT NULL COMMENT '区id', `h_county` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在区名', `landmark_id` int(11) NULL DEFAULT NULL COMMENT '地标id', `h_landmark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地标名称', `community_id` int(11) NULL DEFAULT NULL COMMENT '小区id', `h_community` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区名称', `h_unit` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区单元', `h_swap` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否可调换', `metro_id` int(11) NULL DEFAULT NULL COMMENT '地铁线路id', `h_metro` int(11) NULL DEFAULT NULL COMMENT '地铁线路', `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id', `h_site` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地铁站点名', `h_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房源户型', `h_floor` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在楼层', `h_fitment` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房源装修', `h_sex` tinyint(4) NOT NULL DEFAULT 2 COMMENT '性别限制', `h_area` int(11) NOT NULL COMMENT '房源面积', `r_mode` int(11) NOT NULL COMMENT '出租方式', `h_rent` bigint(20) NOT NULL COMMENT '期望租金', `l_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房东姓名', `l_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房东电话', `h_facilities` json NULL COMMENT '配套设施', `other` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其他说明', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '委托时间', `source` tinyint(4) NOT NULL COMMENT '来源', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '房源状态', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id', `property_id` int(11) NULL DEFAULT NULL COMMENT '物业id', `g_sale_id` int(11) NULL DEFAULT NULL COMMENT '内部负责销售', `audit_time` timestamp(0) NULL DEFAULT NULL COMMENT '审核时间', `c_sale_id` int(11) NULL DEFAULT NULL COMMENT '第三方负责销售', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_h_source`(`source`) USING BTREE, INDEX `idx_h_status`(`status`) USING BTREE, INDEX `province_id`(`province_id`) USING BTREE, INDEX `city_id`(`city_id`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, INDEX `landmark_id`(`landmark_id`) USING BTREE, INDEX `community_id`(`community_id`) USING BTREE, INDEX `metro_id`(`metro_id`) USING BTREE, INDEX `site_id`(`site_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, INDEX `g_sale_id`(`g_sale_id`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `house_entrust_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_10` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_11` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_12` FOREIGN KEY (`g_sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_13` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_14` FOREIGN KEY (`landmark_id`) REFERENCES `landmark` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_15` FOREIGN KEY (`community_id`) REFERENCES `community` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_3` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_6` FOREIGN KEY (`metro_id`) REFERENCES `metro` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_7` FOREIGN KEY (`site_id`) REFERENCES `metro_site` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_8` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_entrust_ibfk_9` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房屋委托' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for house_info -- ---------------------------- DROP TABLE IF EXISTS `house_info`; CREATE TABLE `house_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `h_video` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '视频地址', `h_img` json NULL COMMENT '房间图片', `r_mode` int(11) NOT NULL COMMENT '出租方式', `h_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房源名称', `province_id` int(11) NOT NULL COMMENT '省id', `h_province` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在省名', `city_id` int(11) NOT NULL COMMENT '市id', `h_city` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在市名', `county_id` int(11) NOT NULL COMMENT '区id', `h_county` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在区名', `landmark_id` int(11) NULL DEFAULT NULL COMMENT '地标id', `h_landmark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地标名称', `community_id` int(11) NULL DEFAULT NULL COMMENT '小区id', `h_community` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区名称', `h_unit` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区单元', `metro_id` int(11) NULL DEFAULT NULL COMMENT '地铁线路id', `h_metro` int(11) NULL DEFAULT NULL COMMENT '地铁线路', `site_id` int(11) NULL DEFAULT NULL COMMENT '站点id', `h_site` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地铁站点名', `h_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房源户型', `h_floor` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在楼层', `h_fitment` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房源装修', `h_sex` tinyint(4) NOT NULL COMMENT '性别限制', `h_swap` tinyint(4) NOT NULL COMMENT '是否可调换', `h_contract` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否完善房源合同', `h_is_d_b` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否需要门禁', `h_area` int(11) NOT NULL COMMENT '房源面积', `h_facilities` json NULL COMMENT '配套设施', `h_l_rent` bigint(20) NULL DEFAULT NULL COMMENT '长租租金', `h_s_rent` bigint(20) NULL DEFAULT NULL COMMENT '短租租金', `h_l_p_m` int(11) NULL DEFAULT NULL COMMENT '长租支付方式', `h_l_p_n` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '长租支付方式名', `h_s_p_m` json NULL COMMENT '短租支付方式', `other` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其他说明', `h_p_c_id` int(11) NULL DEFAULT NULL COMMENT '物业公司id', `h_p_id` int(11) NULL DEFAULT NULL COMMENT '物业人员id', `is_empower` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否授权开门', `source` tinyint(4) NOT NULL COMMENT '来源', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id', `property_id` int(11) NULL DEFAULT NULL COMMENT '物业id', `g_sale_id` int(11) NULL DEFAULT NULL COMMENT '内部负责销售', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '房源状态', `commission` bigint(20) NOT NULL DEFAULT 0 COMMENT '人员佣金', `h_toward` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房屋朝向', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '完善时间', `audit` tinyint(4) NOT NULL DEFAULT 0 COMMENT '审核状态', `guard` json NULL COMMENT '门卫资料', `h_e_id` int(11) NULL DEFAULT NULL COMMENT '房源id', `h_is_look` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否完善电子锁', `s_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上架时间', `c_sale_id` int(11) NULL DEFAULT NULL COMMENT '第三方负责销售', `is_all_pay` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否全付', `special` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否是特殊房源', `special_remarks` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '特殊房源备注', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_h_source`(`source`) USING BTREE, INDEX `idx_h_status`(`status`) USING BTREE, INDEX `idx_h_audit`(`audit`) USING BTREE, INDEX `province_id`(`province_id`) USING BTREE, INDEX `city_id`(`city_id`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, INDEX `landmark_id`(`landmark_id`) USING BTREE, INDEX `community_id`(`community_id`) USING BTREE, INDEX `metro_id`(`metro_id`) USING BTREE, INDEX `site_id`(`site_id`) USING BTREE, INDEX `h_e_id`(`h_e_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, INDEX `g_sale_id`(`g_sale_id`) USING BTREE, INDEX `h_p_c_id`(`h_p_c_id`) USING BTREE, INDEX `h_p_id`(`h_p_id`) USING BTREE, INDEX `h_l_p_m`(`h_l_p_m`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `house_info_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_10` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_11` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_12` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_13` FOREIGN KEY (`g_sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_14` FOREIGN KEY (`h_p_c_id`) REFERENCES `property_company` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_15` FOREIGN KEY (`h_p_id`) REFERENCES `property` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_16` FOREIGN KEY (`h_l_p_m`) REFERENCES `payment_method` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_17` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_18` FOREIGN KEY (`landmark_id`) REFERENCES `landmark` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_19` FOREIGN KEY (`community_id`) REFERENCES `community` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_3` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_6` FOREIGN KEY (`metro_id`) REFERENCES `metro` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_7` FOREIGN KEY (`site_id`) REFERENCES `metro_site` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_8` FOREIGN KEY (`h_e_id`) REFERENCES `house_entrust` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `house_info_ibfk_9` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房源信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for house_type -- ---------------------------- DROP TABLE IF EXISTS `house_type`; CREATE TABLE `house_type` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '户型名', `order` int(11) NOT NULL COMMENT '前端排序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房屋户型' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for internal_long_commission -- ---------------------------- DROP TABLE IF EXISTS `internal_long_commission`; CREATE TABLE `internal_long_commission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `min` bigint(20) NOT NULL COMMENT '最低租金', `max` bigint(20) NOT NULL COMMENT '最高租金', `proportion` tinyint(4) NOT NULL COMMENT '提成比例', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '内部长租提成' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for internal_short_commission -- ---------------------------- DROP TABLE IF EXISTS `internal_short_commission`; CREATE TABLE `internal_short_commission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `min` bigint(20) NOT NULL COMMENT '最低租金', `max` bigint(20) NOT NULL COMMENT '最高租金', `proportion` tinyint(4) NOT NULL COMMENT '提成比例', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '内部短租提成' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for landmark -- ---------------------------- DROP TABLE IF EXISTS `landmark`; CREATE TABLE `landmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地标名', `longitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在经度', `latitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所在纬度', `county_id` int(11) NOT NULL COMMENT '区id', PRIMARY KEY (`id`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, CONSTRAINT `landmark_ibfk_1` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '地标' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for lease_time -- ---------------------------- DROP TABLE IF EXISTS `lease_time`; CREATE TABLE `lease_time` ( `id` int(11) NOT NULL AUTO_INCREMENT, `month` int(11) NOT NULL COMMENT '租住月数', `order` int(11) NOT NULL COMMENT '排列顺序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_lease_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '长租周期设置' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for life_pay -- ---------------------------- DROP TABLE IF EXISTS `life_pay`; CREATE TABLE `life_pay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `c_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '缴费中文名称', `e_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '缴费英文名称', `min_sum` bigint(20) NOT NULL COMMENT '缴费最低金额', `order` int(11) NOT NULL COMMENT '前端排序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_pay_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '生活缴费' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for look_house -- ---------------------------- DROP TABLE IF EXISTS `look_house`; CREATE TABLE `look_house` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `property_id` int(11) NULL DEFAULT NULL COMMENT '物业人员id', `sale_id` int(11) NULL DEFAULT NULL COMMENT '负责销售id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间', `k_time` timestamp(0) NULL DEFAULT NULL COMMENT '开门时间', `c_time` timestamp(0) NULL DEFAULT NULL COMMENT '关门时间', `end_time` timestamp(0) NULL DEFAULT NULL COMMENT '结束看房时间', `mode` tinyint(4) NOT NULL DEFAULT 0 COMMENT '开门方式', `c_sale_id` int(11) NULL DEFAULT NULL COMMENT '第三方负责销售', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '看房费用', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, INDEX `r_id`(`r_id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `look_house_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `look_house_ibfk_2` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `look_house_ibfk_3` FOREIGN KEY (`r_id`) REFERENCES `room` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `look_house_ibfk_4` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `look_house_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `look_house_ibfk_6` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 254 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '申请看房' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for mail -- ---------------------------- DROP TABLE IF EXISTS `mail`; CREATE TABLE `mail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间', `type` tinyint(4) NOT NULL COMMENT '发送对象', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站内信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for metro -- ---------------------------- DROP TABLE IF EXISTS `metro`; CREATE TABLE `metro` ( `id` int(11) NOT NULL AUTO_INCREMENT, `city_id` int(11) NOT NULL COMMENT '所在市', `name` int(11) NOT NULL COMMENT '线路名称', `order` int(11) NOT NULL COMMENT '排列顺序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_metro_order`(`order`) USING BTREE, INDEX `city_id`(`city_id`) USING BTREE, CONSTRAINT `metro_ibfk_1` FOREIGN KEY (`city_id`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '地铁线路筛选' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for metro_site -- ---------------------------- DROP TABLE IF EXISTS `metro_site`; CREATE TABLE `metro_site` ( `id` int(11) NOT NULL AUTO_INCREMENT, `metro_id` int(11) NOT NULL COMMENT '所属地铁线路', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '站点名称', `order` int(11) NOT NULL COMMENT '排列顺序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_site_order`(`order`) USING BTREE, INDEX `metro_id`(`metro_id`) USING BTREE, CONSTRAINT `metro_site_ibfk_1` FOREIGN KEY (`metro_id`) REFERENCES `metro` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '地铁站点名' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for migrations -- ---------------------------- DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `version` bigint(20) NOT NULL, `migration_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `start_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, `end_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, `breakpoint` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`version`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for open_the_record -- ---------------------------- DROP TABLE IF EXISTS `open_the_record`; CREATE TABLE `open_the_record` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NULL DEFAULT NULL COMMENT '用户id', `property_id` int(11) NULL DEFAULT NULL COMMENT '物业id', `d_id` int(11) NOT NULL COMMENT '电子锁id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开门时间', `mode` tinyint(255) NULL DEFAULT 0, `password` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电子锁密码', `status` tinyint(4) NOT NULL COMMENT '开锁状态 0 已开 1 失败', `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '失败原因', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, INDEX `d_id`(`d_id`) USING BTREE, CONSTRAINT `open_the_record_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `open_the_record_ibfk_2` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `open_the_record_ibfk_3` FOREIGN KEY (`d_id`) REFERENCES `door_lock` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房源每日统计' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for payment_method -- ---------------------------- DROP TABLE IF EXISTS `payment_method`; CREATE TABLE `payment_method` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付方式名称', `rent` int(11) NOT NULL COMMENT '缴纳租金月数', `bet` int(11) NOT NULL COMMENT '缴纳押金月数', `order` int(11) NOT NULL COMMENT '排列顺序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_method_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付方式设置' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property -- ---------------------------- DROP TABLE IF EXISTS `property`; CREATE TABLE `property` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `landline` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', `source` tinyint(4) NOT NULL COMMENT '来源', `p_c_id` int(11) NOT NULL COMMENT '所属物业公司', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '物业状态', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `idx_wyry_phone_name`(`phone`) USING BTREE, INDEX `idx_wyry_name`(`name`) USING BTREE, INDEX `idx_wyry_status`(`status`) USING BTREE, INDEX `p_c_id`(`p_c_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, CONSTRAINT `property_ibfk_1` FOREIGN KEY (`p_c_id`) REFERENCES `property_company` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `property_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `property_ibfk_3` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业人员' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_balance -- ---------------------------- DROP TABLE IF EXISTS `property_balance`; CREATE TABLE `property_balance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `property_id` int(11) NOT NULL COMMENT '物业id', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '余额金额', PRIMARY KEY (`id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, CONSTRAINT `property_balance_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业余额' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_cash -- ---------------------------- DROP TABLE IF EXISTS `property_cash`; CREATE TABLE `property_cash` ( `id` int(11) NOT NULL AUTO_INCREMENT, `property_id` int(11) NOT NULL COMMENT '物业id', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '提现金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `a_type` tinyint(4) NULL DEFAULT NULL COMMENT '提现账户类型', `account` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提现账号', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请提现时间', PRIMARY KEY (`id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, CONSTRAINT `property_cash_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业提现记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_company -- ---------------------------- DROP TABLE IF EXISTS `property_company`; CREATE TABLE `property_company` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司名称', `source` tinyint(4) NOT NULL COMMENT '来源', `community_id` int(11) NULL DEFAULT NULL COMMENT '关联小区', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `sale_id` int(11) NULL DEFAULT NULL COMMENT '销售id', `admin_id` int(11) NULL DEFAULT NULL COMMENT '管理id', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_wygs_name`(`name`) USING BTREE, INDEX `community_id`(`community_id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, INDEX `admin_id`(`admin_id`) USING BTREE, CONSTRAINT `property_company_ibfk_1` FOREIGN KEY (`community_id`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `property_company_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `property_company_ibfk_3` FOREIGN KEY (`admin_id`) REFERENCES `admin_user` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业公司' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_income_log -- ---------------------------- DROP TABLE IF EXISTS `property_income_log`; CREATE TABLE `property_income_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `source` tinyint(4) NOT NULL COMMENT '收入来源', `sum` bigint(20) NOT NULL COMMENT '收入金额', `property_id` int(11) NOT NULL COMMENT '物业id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间', PRIMARY KEY (`id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, CONSTRAINT `property_income_log_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业收入记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_info -- ---------------------------- DROP TABLE IF EXISTS `property_info`; CREATE TABLE `property_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `property_id` int(11) NOT NULL COMMENT '物业人员id', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码', `landline` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '座机号', `openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信openid', `photo` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像地址', `nickname` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称', `introduce` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '个人介绍', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录状态', `sex` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登录时间', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间', PRIMARY KEY (`id`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, CONSTRAINT `property_info_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业人员资料' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_mail -- ---------------------------- DROP TABLE IF EXISTS `property_mail`; CREATE TABLE `property_mail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间', `property_id` int(11) NOT NULL COMMENT '物业人员id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否阅读', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_wy_title`(`title`) USING BTREE, INDEX `property_id`(`property_id`) USING BTREE, CONSTRAINT `property_mail_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业站内信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for property_reward -- ---------------------------- DROP TABLE IF EXISTS `property_reward`; CREATE TABLE `property_reward` ( `id` int(11) NOT NULL AUTO_INCREMENT, `s_num` int(11) NOT NULL COMMENT '开始次数', `e_num` int(11) NOT NULL COMMENT '结束次数', `sum` bigint(20) NOT NULL COMMENT '收入金额', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '物业开门奖励设置' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for province -- ---------------------------- DROP TABLE IF EXISTS `province`; CREATE TABLE `province` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '省名', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_province_name`(`name`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '省' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for rbac_permissions -- ---------------------------- DROP TABLE IF EXISTS `rbac_permissions`; CREATE TABLE `rbac_permissions` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Lft` int(11) NOT NULL, `Rght` int(11) NOT NULL, `Title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `Description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, PRIMARY KEY (`ID`) USING BTREE, INDEX `Lft`(`Lft`) USING BTREE, INDEX `Rght`(`Rght`) USING BTREE, INDEX `Title`(`Title`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 78 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for rbac_rolepermissions -- ---------------------------- DROP TABLE IF EXISTS `rbac_rolepermissions`; CREATE TABLE `rbac_rolepermissions` ( `RoleID` int(11) NOT NULL, `PermissionID` int(11) NOT NULL, `AssignmentDate` int(11) NOT NULL, PRIMARY KEY (`RoleID`, `PermissionID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for rbac_roles -- ---------------------------- DROP TABLE IF EXISTS `rbac_roles`; CREATE TABLE `rbac_roles` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Lft` int(11) NOT NULL, `Rght` int(11) NOT NULL, `Title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `Description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, PRIMARY KEY (`ID`) USING BTREE, INDEX `Lft`(`Lft`) USING BTREE, INDEX `Rght`(`Rght`) USING BTREE, INDEX `Title`(`Title`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for rbac_userroles -- ---------------------------- DROP TABLE IF EXISTS `rbac_userroles`; CREATE TABLE `rbac_userroles` ( `UserID` int(11) NOT NULL, `RoleID` int(11) NOT NULL, `AssignmentDate` int(11) NOT NULL, PRIMARY KEY (`UserID`, `RoleID`) USING BTREE, CONSTRAINT `rbac_userroles_ibfk_1` FOREIGN KEY (`UserID`) REFERENCES `admin_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for rent_range -- ---------------------------- DROP TABLE IF EXISTS `rent_range`; CREATE TABLE `rent_range` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '筛选名称', `min_rent` bigint(20) NOT NULL COMMENT '最小租金', `max_rent` bigint(20) NOT NULL COMMENT '最大租金', `order` int(11) NOT NULL COMMENT '前端排序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_rent_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '租金区间' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for room -- ---------------------------- DROP TABLE IF EXISTS `room`; CREATE TABLE `room` ( `id` int(11) NOT NULL AUTO_INCREMENT, `r_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房间名', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_area` int(11) NOT NULL COMMENT '房间面积', `h_l_rent` bigint(20) NULL DEFAULT NULL COMMENT '长租租金', `h_s_rent` bigint(20) NULL DEFAULT NULL COMMENT '短租租金', `h_l_p_m` int(11) NULL DEFAULT NULL COMMENT '长租支付方式', `h_l_p_n` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '长租支付方式名', `h_s_p_m` json NULL COMMENT '短租支付方式', `h_facilities` json NULL COMMENT '配套设施', `h_toward` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房屋朝向', `h_fitment` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房间装修', `h_sex` tinyint(4) NOT NULL COMMENT '性别限制', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '房间状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '完善时间', `is_all_pay` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否全付', PRIMARY KEY (`id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, INDEX `h_l_p_m`(`h_l_p_m`) USING BTREE, CONSTRAINT `room_ibfk_1` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `room_ibfk_2` FOREIGN KEY (`h_l_p_m`) REFERENCES `payment_method` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房间信息' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for room_supplies -- ---------------------------- DROP TABLE IF EXISTS `room_supplies`; CREATE TABLE `room_supplies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '设施名', `order` int(11) NOT NULL COMMENT '前端排序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_supplies_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房屋设施' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for sale -- ---------------------------- DROP TABLE IF EXISTS `sale`; CREATE TABLE `sale` ( `id` int(11) NOT NULL AUTO_INCREMENT, `store_id` int(11) NOT NULL COMMENT '门店id', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '销售姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '销售状态', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `idx_sale_phone`(`phone`) USING BTREE, INDEX `idx_sale_name`(`name`) USING BTREE, INDEX `idx_sale_status`(`status`) USING BTREE, INDEX `store_id`(`store_id`) USING BTREE, CONSTRAINT `sale_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `store` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '销售表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for sale_commission -- ---------------------------- DROP TABLE IF EXISTS `sale_commission`; CREATE TABLE `sale_commission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `g_sale_id` int(11) NULL DEFAULT NULL COMMENT '内部销售', `c_sale_id` int(11) NULL DEFAULT NULL COMMENT '外部销售', `sum` bigint(20) NOT NULL COMMENT '销售佣金', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '佣金状态', `audit_time` timestamp(0) NULL DEFAULT NULL COMMENT '处理时间', `mode` tinyint(4) NOT NULL COMMENT '租房方式', `order_id` int(11) NOT NULL COMMENT '订单id', `rent` bigint(20) NOT NULL DEFAULT 0 COMMENT '订单租金', `deposit` bigint(20) NOT NULL DEFAULT 0 COMMENT '订单押金', PRIMARY KEY (`id`) USING BTREE, INDEX `order_id`(`order_id`) USING BTREE, INDEX `g_sale_id`(`g_sale_id`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `sale_commission_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `sale_commission_ibfk_2` FOREIGN KEY (`g_sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `sale_commission_ibfk_3` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '销售佣金来源记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for sale_info -- ---------------------------- DROP TABLE IF EXISTS `sale_info`; CREATE TABLE `sale_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sale_id` int(11) NOT NULL COMMENT '销售id', `openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信openid', `photo` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '销售状态', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录状态', `nickname` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登录时间', `sex` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间', PRIMARY KEY (`id`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, CONSTRAINT `sale_info_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '销售个人资料' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for sale_mail -- ---------------------------- DROP TABLE IF EXISTS `sale_mail`; CREATE TABLE `sale_mail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间', `sale_id` int(11) NOT NULL COMMENT '销售id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否阅读', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_xs_title`(`title`) USING BTREE, INDEX `sale_id`(`sale_id`) USING BTREE, CONSTRAINT `sale_mail_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '销售站内信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for short_time -- ---------------------------- DROP TABLE IF EXISTS `short_time`; CREATE TABLE `short_time` ( `id` int(11) NOT NULL AUTO_INCREMENT, `day` int(11) NOT NULL COMMENT '租住天数', `order` int(11) NOT NULL COMMENT '排列顺序', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_short_order`(`order`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '短租周期设置' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for statistics -- ---------------------------- DROP TABLE IF EXISTS `statistics`; CREATE TABLE `statistics` ( `id` int(11) NOT NULL AUTO_INCREMENT, `total_num` int(11) NOT NULL COMMENT '当天总房间数', `new_num` int(11) NOT NULL COMMENT '当天新增房间数', `rent_num` int(11) NOT NULL COMMENT '当天在租总房间数', `renew_num` int(11) NOT NULL COMMENT '当天续租房间数', `rented_num` int(11) NOT NULL COMMENT '当天未租房间数', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 65 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '房源每日统计' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for store -- ---------------------------- DROP TABLE IF EXISTS `store`; CREATE TABLE `store` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门店名', `county_id` int(11) NOT NULL COMMENT '区id', `address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '详细地址', `longitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在经度', `latitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在纬度', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店长姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店长手机号', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录密码', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '店长状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店长登录session_id', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登录时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_store_phone`(`phone`) USING BTREE, INDEX `county_id`(`county_id`) USING BTREE, CONSTRAINT `store_ibfk_1` FOREIGN KEY (`county_id`) REFERENCES `county` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for store_cash -- ---------------------------- DROP TABLE IF EXISTS `store_cash`; CREATE TABLE `store_cash` ( `id` int(11) NOT NULL AUTO_INCREMENT, `inside_store` int(11) NULL DEFAULT NULL COMMENT '内部门店', `outer_store` int(11) NULL DEFAULT NULL COMMENT '外部门店', `sum` bigint(20) NOT NULL COMMENT '提现金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '申请状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间', `audit_time` timestamp(0) NULL DEFAULT NULL COMMENT '审核时间', `sale` json NOT NULL COMMENT '销售id', PRIMARY KEY (`id`) USING BTREE, INDEX `inside_store`(`inside_store`) USING BTREE, INDEX `outer_store`(`outer_store`) USING BTREE, CONSTRAINT `store_cash_ibfk_1` FOREIGN KEY (`inside_store`) REFERENCES `store` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `store_cash_ibfk_2` FOREIGN KEY (`outer_store`) REFERENCES `cooperation_store` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店提现申请' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_jobs -- ---------------------------- DROP TABLE IF EXISTS `system_jobs`; CREATE TABLE `system_jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `queue` char(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `attempts` int(3) UNSIGNED NOT NULL, `reserved` int(3) UNSIGNED NOT NULL, `reserved_at` int(10) UNSIGNED NULL DEFAULT NULL, `available_at` int(10) UNSIGNED NOT NULL, `created_at` int(10) UNSIGNED NOT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息队列使用的表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for unlock_record -- ---------------------------- DROP TABLE IF EXISTS `unlock_record`; CREATE TABLE `unlock_record` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '门锁的sn', `qr_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '二维码编号', `status` tinyint(1) NOT NULL COMMENT '门锁状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户姓名', `photo` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像', `nickname` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称', `sex` tinyint(4) NOT NULL DEFAULT 1 COMMENT '性别', `status` int(11) NOT NULL DEFAULT 0 COMMENT '用户状态', `introduce` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '个人介绍', `type` tinyint(4) NOT NULL COMMENT '用户类型', `session_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录状态', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间', `last_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次登陆时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_use_phone`(`phone`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '前端用户' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_balance -- ---------------------------- DROP TABLE IF EXISTS `user_balance`; CREATE TABLE `user_balance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '余额金额', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_balance_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '余额' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_cash -- ---------------------------- DROP TABLE IF EXISTS `user_cash`; CREATE TABLE `user_cash` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '提现金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', `type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '提现类型', `a_type` tinyint(4) NULL DEFAULT NULL COMMENT '提现账户类型', `account` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提现账号', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请提现时间', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_cash_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户提现记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_contract -- ---------------------------- DROP TABLE IF EXISTS `user_contract`; CREATE TABLE `user_contract` ( `id` int(11) NOT NULL AUTO_INCREMENT, `l_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房东姓名', `l_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房东手机号', `l_id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房东身份证号码', `t_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '承租方姓名', `t_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '承租方手机号', `t_id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '承租方身份证号码', `h_address` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '房源详细地址', `r_s_time` datetime(0) NOT NULL COMMENT '租房开始时间', `r_e_time` datetime(0) NOT NULL COMMENT '租房结束时间', `p_time` json NOT NULL COMMENT '付款时间段', `rent` bigint(20) NOT NULL DEFAULT 0 COMMENT '租金', `deposit` bigint(20) NOT NULL DEFAULT 0 COMMENT '押金', `is_pay` tinyint(4) NOT NULL COMMENT '是否代缴水电气', `is_settle` tinyint(4) NOT NULL COMMENT '水电气是否结清', `life` json NOT NULL COMMENT '水电气参数', `s_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '监督电话', `facility` json NULL COMMENT '房间设施', `m_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '经办人姓名', `m_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '经办人手机号', `m_s_phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '经办人店长电话', `m_store` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '经办人门店名', `other` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其他说明', `sign_mode` tinyint(4) NOT NULL DEFAULT 0 COMMENT '签订方式', `people_num` tinyint(4) NOT NULL DEFAULT 0 COMMENT '入住人数', `order_id` int(11) NOT NULL COMMENT '用户订单id', `img` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合同图片地址', `firm` json NULL COMMENT '公司账户信息', `costs` json NULL COMMENT '其他费用', `user_id` int(11) NOT NULL COMMENT '用户id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '签订时间', PRIMARY KEY (`id`) USING BTREE, INDEX `order_id`(`order_id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_contract_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_contract_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 99 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户租房合同' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_deposit -- ---------------------------- DROP TABLE IF EXISTS `user_deposit`; CREATE TABLE `user_deposit` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '押金状态', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '押金金额', PRIMARY KEY (`id`) USING BTREE, INDEX `deposit_status`(`status`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_deposit_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '押金' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_long_pay -- ---------------------------- DROP TABLE IF EXISTS `user_long_pay`; CREATE TABLE `user_long_pay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `staging_time` date NOT NULL COMMENT '付款时间段', `sum` bigint(20) NOT NULL COMMENT '缴费金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '支付状态', `pay_time` date NULL DEFAULT NULL COMMENT '缴费时间', `order_id` int(11) NOT NULL COMMENT '订单id', `user_id` int(11) NOT NULL COMMENT '用户id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `month` tinyint(255) NOT NULL, PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `order_id`(`order_id`) USING BTREE, CONSTRAINT `user_long_pay_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_long_pay_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 146 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户租房订单' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_mail -- ---------------------------- DROP TABLE IF EXISTS `user_mail`; CREATE TABLE `user_mail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间', `user_id` int(11) NOT NULL COMMENT '用户id', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否阅读', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_wy_title`(`title`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_mail_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户内信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_order -- ---------------------------- DROP TABLE IF EXISTS `user_order`; CREATE TABLE `user_order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单号', `mode` tinyint(4) NOT NULL COMMENT '租房方式', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `into_time` datetime(0) NOT NULL COMMENT '入住时间', `out_time` datetime(0) NOT NULL COMMENT '离开时间', `g_sale_id` int(11) NULL DEFAULT NULL COMMENT '内部负责销售', `c_sale_id` int(11) NULL DEFAULT NULL COMMENT '第三方负责销售', `rent` bigint(20) NOT NULL COMMENT '租金单价', `deposit` bigint(20) NOT NULL COMMENT '租房的押金', `total` bigint(20) NOT NULL COMMENT '总金额', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '已付金额', `people_num` tinyint(4) NOT NULL DEFAULT 0 COMMENT '入住人数', `document_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '证件类型', `license_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租房人姓名', `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租房人手机号', `is_all_pay` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否全付', `is_book` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否预订', `book_gold` bigint(20) NOT NULL DEFAULT 0 COMMENT '订金', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '下单时间', `pay_time` timestamp(0) NULL DEFAULT NULL COMMENT '付款时间', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '订单状态', `user_id` int(11) NOT NULL COMMENT '用户id', `h_l_p_n` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '长租支付方式名', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_u_mode`(`mode`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, INDEX `r_id`(`r_id`) USING BTREE, INDEX `g_sale_id`(`g_sale_id`) USING BTREE, INDEX `c_sale_id`(`c_sale_id`) USING BTREE, CONSTRAINT `user_order_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_order_ibfk_2` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_order_ibfk_3` FOREIGN KEY (`r_id`) REFERENCES `room` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `user_order_ibfk_4` FOREIGN KEY (`g_sale_id`) REFERENCES `sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT, CONSTRAINT `user_order_ibfk_5` FOREIGN KEY (`c_sale_id`) REFERENCES `cooperation_sale` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 132 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户租房订单' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_pay_log -- ---------------------------- DROP TABLE IF EXISTS `user_pay_log`; CREATE TABLE `user_pay_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '缴费单号', `user_id` int(11) NOT NULL COMMENT '用户id', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `sum` bigint(20) NOT NULL COMMENT '缴费金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '缴费状态', `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '缴费名称', `is_d_deposit` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否抵扣押金', `d_deposit` bigint(20) NOT NULL DEFAULT 0 COMMENT '抵扣押金金额', `total` bigint(20) NOT NULL COMMENT '实际支付金额', `payment_method` tinyint(4) NOT NULL DEFAULT 0 COMMENT '付款方式', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '缴费时间', `pay_time` timestamp(0) NULL DEFAULT NULL COMMENT '支付时间', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `h_i_id`(`h_i_id`) USING BTREE, INDEX `r_id`(`r_id`) USING BTREE, CONSTRAINT `user_pay_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_pay_log_ibfk_2` FOREIGN KEY (`h_i_id`) REFERENCES `house_info` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_pay_log_ibfk_3` FOREIGN KEY (`r_id`) REFERENCES `room` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '生活缴费记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_payment_log -- ---------------------------- DROP TABLE IF EXISTS `user_payment_log`; CREATE TABLE `user_payment_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付单号', `mode` tinyint(4) NOT NULL COMMENT '付款类型', `order_id` int(11) NOT NULL COMMENT '订单id', `user_id` int(11) NOT NULL COMMENT '用户id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间', `is_d_deposit` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否抵扣押金', `d_deposit` bigint(20) NOT NULL DEFAULT 0 COMMENT '抵扣押金金额', `sum` bigint(20) NOT NULL COMMENT '应付金额', `total` bigint(20) NOT NULL COMMENT '实际支付', `payment_method` tinyint(4) NOT NULL DEFAULT 0 COMMENT '付款方式', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '支付状态', `u_p_id` int(11) NULL DEFAULT NULL COMMENT '缴费时间段id', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `order_id`(`order_id`) USING BTREE, INDEX `u_p_id`(`u_p_id`) USING BTREE, CONSTRAINT `user_payment_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_payment_log_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_payment_log_ibfk_3` FOREIGN KEY (`u_p_id`) REFERENCES `user_long_pay` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 131 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '缴费订单生成' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_phone -- ---------------------------- DROP TABLE IF EXISTS `user_phone`; CREATE TABLE `user_phone` ( `id` int(11) NOT NULL AUTO_INCREMENT, `phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '微信openid', `user_id` int(11) NOT NULL COMMENT '用户信息id', `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '123456' COMMENT '用户密码', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_phone_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '手机用户' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_retirement -- ---------------------------- DROP TABLE IF EXISTS `user_retirement`; CREATE TABLE `user_retirement` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` tinyint(4) NOT NULL COMMENT '取消类型', `order_id` int(11) NOT NULL COMMENT '订单id', `user_id` int(11) NOT NULL COMMENT '用户id', `h_i_id` int(11) NOT NULL COMMENT '房源id', `r_id` int(11) NULL DEFAULT NULL COMMENT '房间id', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '申请时间', `recede_time` timestamp(0) NULL DEFAULT NULL COMMENT '退房时间', `refund_amount` bigint(20) NOT NULL DEFAULT 0 COMMENT '退款金额', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '退款说明', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '处理状态', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, INDEX `order_id`(`order_id`) USING BTREE, CONSTRAINT `user_retirement_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `user_retirement_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户申请退租' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_topup_log -- ---------------------------- DROP TABLE IF EXISTS `user_topup_log`; CREATE TABLE `user_topup_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL COMMENT '用户id', `order_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '充值订单号', `sum` bigint(20) NOT NULL DEFAULT 0 COMMENT '充值金额', `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '充值状态', `type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '充值类型', `mode` tinyint(4) NOT NULL DEFAULT 0 COMMENT '支付方式', `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间', `pay_time` timestamp(0) NULL DEFAULT NULL COMMENT '支付时间', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_topup_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 97 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户充值记录' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for user_wechat -- ---------------------------- DROP TABLE IF EXISTS `user_wechat`; CREATE TABLE `user_wechat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `openid` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '微信openid', `user_id` int(11) NOT NULL COMMENT '用户信息id', PRIMARY KEY (`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE, CONSTRAINT `user_wechat_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '微信用户' ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; ~~~