/*
 Navicat MySQL Data Transfer

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

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

 Date: 07/02/2020 16:53:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for people
-- ----------------------------
DROP TABLE IF EXISTS `people`;
CREATE TABLE `people`  (
  `people_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '增长自id',
  `people_phone` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码',
  `people_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账号',
  `people_password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
  `people_datetime` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '注册时间',
  `people_app_id` int(11) NOT NULL COMMENT '应用编号',
  `people_mail` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户邮箱',
  `people_state` int(2) NULL DEFAULT 0 COMMENT '用户状态',
  `people_code` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '随机验证码',
  `people_codesenddate` datetime(0) NULL DEFAULT NULL COMMENT '发送验证码时间',
  `people_phonecheck` int(1) NULL DEFAULT 0 COMMENT '1手机验证通过',
  `people_maillcheck` int(1) NULL DEFAULT 0 COMMENT '1邮箱验证通过',
  `people_ip` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户登录ip',
  PRIMARY KEY (`people_id`) USING BTREE,
  INDEX `fk_people`(`people_app_id`) USING BTREE,
  CONSTRAINT `people_ibfk_1` FOREIGN KEY (`people_app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1148 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '户用基础表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for people_address
-- ----------------------------
DROP TABLE IF EXISTS `people_address`;
CREATE TABLE `people_address`  (
  `PA_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户收货地址自增长Id',
  `PA_PEOPLE_ID` int(11) NOT NULL COMMENT '对应用户基础信息拓展表的id',
  `PA_CONSIGNEE_NAME` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户收货人姓名',
  `PA_PROVINCE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在的省',
  `PA_PROVINCE_ID` bigint(11) NULL DEFAULT 0 COMMENT '省份编号',
  `PA_CITY` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在的市',
  `PA_CITY_ID` bigint(11) NULL DEFAULT 0 COMMENT '城市编号',
  `PA_DISTRICT` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人所在区(县)',
  `PA_DISTRICT_ID` bigint(11) NULL DEFAULT 0 COMMENT '区编号',
  `PA_STREET` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `PA_STREET_ID` bigint(11) NULL DEFAULT 0 COMMENT '街道编号',
  `PA_ADDRESS` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人的详细收货地址',
  `PA_MAIL` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人邮箱',
  `PA_PHONE` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人手机',
  `PA_DEFAULT` int(1) NULL DEFAULT 0 COMMENT '是否是收货人最终收货地址。1代表是，0代表不是，默认为0',
  `PA_APP_ID` int(11) NOT NULL COMMENT '对应的站点id',
  PRIMARY KEY (`PA_ID`) USING BTREE,
  INDEX `PA_APP_ID`(`PA_APP_ID`) USING BTREE,
  INDEX `PA_PEOPLE_ID`(`PA_PEOPLE_ID`) USING BTREE,
  CONSTRAINT `people_address_ibfk_1` FOREIGN KEY (`PA_PEOPLE_ID`) REFERENCES `people` (`people_id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户地址' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for people_user
-- ----------------------------
DROP TABLE IF EXISTS `people_user`;
CREATE TABLE `people_user`  (
  `pu_people_id` int(11) NOT NULL COMMENT '用户id关联people表的（people_id）',
  `pu_real_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户真实名称',
  `pu_address` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户地址',
  `pu_level` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户等级',
  `pu_level_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户等级名称',
  `pu_icon` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户头像图标地址',
  `pu_nickname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户昵称',
  `pu_sex` int(2) NULL DEFAULT NULL COMMENT '用户性别(0.未知、1.男、2.女)',
  `pu_birthday` date NULL DEFAULT NULL COMMENT '用户出生年月日',
  `pu_card` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '身份证',
  `province_id` bigint(20) NULL DEFAULT NULL,
  `province_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `city_id` bigint(20) NULL DEFAULT NULL,
  `city_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `county_id` bigint(20) NULL DEFAULT NULL,
  `county_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`pu_people_id`) USING BTREE,
  INDEX `pu_people_id`(`pu_people_id`) USING BTREE,
  CONSTRAINT `people_user_ibfk_1` FOREIGN KEY (`pu_people_id`) REFERENCES `people` (`people_id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户基础信息表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
