login.sql 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. -- ----------------------------
  2. -- Table structure for sys_user
  3. -- ----------------------------
  4. drop table if exists sys_user;
  5. create table sys_user (
  6. user_id BIGINT not null comment '用户编号',
  7. weixin_id VARCHAR(50) not null default '' comment '微信ID',
  8. token VARCHAR(50) not null default '' comment 'token',
  9. version CHAR(19) not null comment 'token版本',
  10. create_at TIMESTAMP NOT NULL COMMENT '建立时间',
  11. update_at TIMESTAMP NOT NULL COMMENT '更新日期',
  12. primary key ( user_id )
  13. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT = '微信用户关联';
  14. -- ----------------------------
  15. -- Table structure for sys_user_role
  16. -- ----------------------------
  17. DROP TABLE IF EXISTS sys_user_role;
  18. CREATE TABLE sys_user_role (
  19. ur_id bigint(20) NOT NULL COMMENT '用户角色关系ID',
  20. user_id bigint(20) NOT NULL COMMENT '用户ID',
  21. role_id int(11) NOT NULL COMMENT '角色ID:1居民,2业委会,3商家',
  22. property_id bigint(20) NOT NULL DEFAULT 0 COMMENT '属性ID,居民门牌ID,业委会ID',
  23. user_create bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
  24. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  25. user_update bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
  26. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  27. PRIMARY KEY (ur_id) USING BTREE
  28. ) ENGINE = InnoDB default charset=utf8 comment = '用户角色关系表';
  29. -- ----------------------------
  30. -- Table structure for sys_owner
  31. -- ----------------------------
  32. DROP TABLE IF EXISTS sys_owner;
  33. CREATE TABLE sys_owner (
  34. owner_id bigint(20) NOT NULL DEFAULT 0 COMMENT '业委会ID',
  35. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID,下拉选ID',
  36. user_create bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
  37. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  38. user_update bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
  39. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  40. PRIMARY KEY (owner_id) USING BTREE
  41. ) ENGINE = InnoDB default charset=utf8 comment = '业委会表';
  42. -- ----------------------------
  43. -- Table structure for sys_uptown_house
  44. -- ----------------------------
  45. DROP TABLE IF EXISTS sys_uptown_house;
  46. CREATE TABLE sys_uptown_house (
  47. house_id bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
  48. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
  49. ridgepole int(11) NOT NULL DEFAULT 0 COMMENT '栋',
  50. unit int(11) NOT NULL DEFAULT 0 COMMENT '单元',
  51. doorplate varchar(20) NOT NULL DEFAULT '' COMMENT '门牌',
  52. linkman varchar(10) NOT NULL DEFAULT '' COMMENT '联系人名称',
  53. phone varchar(20) NOT NULL DEFAULT '' COMMENT '联系人电话',
  54. young int(11) NOT NULL DEFAULT 0 COMMENT '家庭年前人数',
  55. middle int(11) NOT NULL DEFAULT 0 COMMENT '家庭中年人数',
  56. old int(11) NOT NULL DEFAULT 0 COMMENT '家庭老年人数',
  57. remark varchar(100) NOT NULL DEFAULT '' COMMENT '备注',
  58. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  59. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  60. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  61. PRIMARY KEY (house_id) USING BTREE
  62. ) ENGINE = InnoDB default charset=utf8 comment = '小区家庭表';
  63. -- ----------------------------
  64. -- Table structure for sys_area
  65. -- ----------------------------
  66. DROP TABLE IF EXISTS sys_area;
  67. CREATE TABLE sys_area (
  68. area_id bigint(20) NOT NULL DEFAULT 0 COMMENT '地区ID',
  69. province varchar(50) NOT NULL DEFAULT '' COMMENT '省',
  70. city varchar(50) NOT NULL DEFAULT '' COMMENT '市',
  71. area varchar(50) NOT NULL DEFAULT '' COMMENT '区',
  72. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  73. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  74. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  75. PRIMARY KEY (area_id) USING BTREE
  76. ) ENGINE = InnoDB default charset=utf8 comment = '省市区表';
  77. -- ----------------------------
  78. -- Table structure for sys_uptown
  79. -- ----------------------------
  80. DROP TABLE IF EXISTS sys_uptown;
  81. CREATE TABLE sys_uptown (
  82. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
  83. uptown_name varchar(20) NOT NULL DEFAULT '' COMMENT '小区名称',
  84. uptown_addr varchar(100) NOT NULL DEFAULT '' COMMENT '小区地址',
  85. longitude varchar(20) NOT NULL DEFAULT '' COMMENT '经度',
  86. latitude varchar(20) NOT NULL DEFAULT '' COMMENT '纬度',
  87. area varchar(20) NOT NULL DEFAULT '' COMMENT '区',
  88. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  89. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  90. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  91. PRIMARY KEY (uptown_id) USING BTREE
  92. ) ENGINE = InnoDB default charset=utf8 comment = '小区表';