Explorar el Código

小区用户居委会表

peiguo hace 5 años
padre
commit
c43d46185a
Se han modificado 1 ficheros con 21 adiciones y 34 borrados
  1. 21 34
      whepi-doc/login.sql

+ 21 - 34
whepi-doc/login.sql

@@ -2,10 +2,9 @@
 -- Table structure for sys_user
 -- ----------------------------
 drop table if exists sys_user;
-create table sys_user
-(
+create table sys_user (
   user_id             BIGINT          not null             comment '用户编号',
-  weixin_id          VARCHAR(50)     not null default ''  comment '微信ID',
+  weixin_id           VARCHAR(50)     not null default ''  comment '微信ID',
   token               VARCHAR(50)     not null default ''  comment 'token',
   version             CHAR(19)        not null             comment 'token版本',
   create_at TIMESTAMP NOT NULL COMMENT '建立时间',
@@ -21,6 +20,7 @@ CREATE TABLE sys_user_role  (
   ur_id 		bigint(20) NOT NULL COMMENT '用户角色关系ID',
   user_id 		bigint(20) NOT NULL COMMENT '用户ID',
   role_id 		int(11) NOT NULL COMMENT '角色ID:1居民,2业委会,3商家',
+  property_id   bigint(20) NOT NULL DEFAULT 0 COMMENT '属性ID,居民门牌ID,业委会ID',
   user_create 	bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
   time_create 	datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   user_update 	bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
@@ -29,41 +29,40 @@ CREATE TABLE sys_user_role  (
 ) ENGINE = InnoDB default charset=utf8 comment = '用户角色关系表';
 
 -- ----------------------------
+-- Table structure for sys_owner
 -- ----------------------------
-DROP TABLE IF EXISTS user_owner;
-CREATE TABLE user_owner  (
-  owner_id          bigint(20) NOT NULL DEFAULT 0 COMMENT '业主ID(user_id)',
-  linkman           varchar(10) NOT NULL DEFAULT '' COMMENT '联系人名称',
-  phone             varchar(20) NOT NULL DEFAULT '' COMMENT '联系人电话',
+DROP TABLE IF EXISTS sys_owner;
+CREATE TABLE sys_owner  (
+  owner_id          bigint(20) NOT NULL DEFAULT 0 COMMENT '业委会ID',
   uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID,下拉选ID',
-  addr              varchar(100)  NOT NULL DEFAULT '' COMMENT '详细地址',
   user_create       bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   user_update       bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (owner_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '业委会';
+) ENGINE = InnoDB default charset=utf8 comment = '业委会';
 
 -- ----------------------------
+-- Table structure for sys_uptown_house
 -- ----------------------------
-DROP TABLE IF EXISTS user_resident;
-CREATE TABLE user_resident  (
-  resident_id       bigint(20) NOT NULL DEFAULT 0 COMMENT '居民ID(user_id)',
-  house_id          bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
+DROP TABLE IF EXISTS sys_uptown_house;
+CREATE TABLE sys_uptown_house  (
+  house_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
+  uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
+  ridgepole         int(11) NOT NULL DEFAULT 0 COMMENT '栋',
+  unit              int(11) NOT NULL DEFAULT 0 COMMENT '单元',
+  doorplate         varchar(20)  NOT NULL DEFAULT '' COMMENT '门牌',
   linkman           varchar(10)  NOT NULL DEFAULT '' COMMENT '联系人名称',
   phone             varchar(20)  NOT NULL DEFAULT '' COMMENT '联系人电话',
   young             int(11) NOT NULL DEFAULT 0 COMMENT '家庭年前人数',
   middle            int(11) NOT NULL DEFAULT 0 COMMENT '家庭中年人数',
   old               int(11) NOT NULL DEFAULT 0 COMMENT '家庭老年人数',
   remark            varchar(100)  NOT NULL DEFAULT '' COMMENT '备注',
-  user_create       bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
+  status            int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
-  user_update       bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
-  PRIMARY KEY (resident_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '居民表';
+  PRIMARY KEY (house_id) USING BTREE
+) ENGINE = InnoDB default charset=utf8 comment = '小区家庭表';
 
 -- ----------------------------
 -- Table structure for sys_area
@@ -78,7 +77,7 @@ CREATE TABLE sys_area  (
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (area_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '居民表';
+) ENGINE = InnoDB default charset=utf8 comment = '省市区表';
 
 -- ----------------------------
 -- Table structure for sys_uptown
@@ -95,21 +94,4 @@ CREATE TABLE sys_uptown  (
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (uptown_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '小区表';
-
-
-DROP TABLE IF EXISTS sys_uptown_house;
-CREATE TABLE sys_uptown_house  (
-  house_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
-  uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
-  ridgepole         int(11) NOT NULL DEFAULT 0 COMMENT '栋',
-  unit              int(11) NOT NULL DEFAULT 0 COMMENT '单元',
-  doorplate         varchar(20)  NOT NULL DEFAULT '' COMMENT '门牌',
-  status            int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
-  time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
-  time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
-  PRIMARY KEY (house_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '小区门牌表';
+) ENGINE = InnoDB default charset=utf8 comment = '小区表';