login.sql 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. -- ----------------------------
  2. -- Table structure for sys_user
  3. -- ----------------------------
  4. drop table if exists sys_user;
  5. create table sys_user
  6. (
  7. user_id BIGINT not null comment '用户编号',
  8. weixin_id VARCHAR(50) not null default '' comment '微信ID',
  9. token VARCHAR(50) not null default '' comment 'token',
  10. version CHAR(19) not null comment 'token版本',
  11. create_at TIMESTAMP NOT NULL COMMENT '建立时间',
  12. update_at TIMESTAMP NOT NULL COMMENT '更新日期',
  13. primary key ( user_id )
  14. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT = '微信用户关联';
  15. -- ----------------------------
  16. -- Table structure for sys_user_role
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS sys_user_role;
  19. CREATE TABLE sys_user_role (
  20. ur_id bigint(20) NOT NULL COMMENT '用户角色关系ID',
  21. user_id bigint(20) NOT NULL COMMENT '用户ID',
  22. role_id int(11) NOT NULL COMMENT '角色ID:1居民,2业委会,3商家',
  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 user_owner
  31. -- ----------------------------
  32. DROP TABLE IF EXISTS user_owner;
  33. CREATE TABLE user_owner (
  34. owner_id bigint(20) NOT NULL DEFAULT 0 COMMENT '业主ID(user_id)',
  35. linkman varchar(10) NOT NULL DEFAULT '' COMMENT '联系人名称',
  36. phone varchar(20) NOT NULL DEFAULT '' COMMENT '联系人电话',
  37. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID,下拉选ID',
  38. addr varchar(100) NOT NULL DEFAULT '' COMMENT '详细地址',
  39. user_create bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
  40. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  41. user_update bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
  42. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  43. PRIMARY KEY (owner_id) USING BTREE
  44. ) ENGINE = InnoDB default charset=utf8 comment = '业委会';
  45. -- ----------------------------
  46. -- Table structure for user_resident
  47. -- ----------------------------
  48. DROP TABLE IF EXISTS user_resident;
  49. CREATE TABLE user_resident (
  50. resident_id bigint(20) NOT NULL DEFAULT 0 COMMENT '居民ID(user_id)',
  51. house_id bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
  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. user_create bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
  59. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  60. user_update bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
  61. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  62. PRIMARY KEY (resident_id) USING BTREE
  63. ) ENGINE = InnoDB default charset=utf8 comment = '居民表';
  64. -- ----------------------------
  65. -- Table structure for sys_area
  66. -- ----------------------------
  67. DROP TABLE IF EXISTS sys_area;
  68. CREATE TABLE sys_area (
  69. area_id bigint(20) NOT NULL DEFAULT 0 COMMENT '地区ID',
  70. province varchar(20) NOT NULL DEFAULT '' COMMENT '省',
  71. city varchar(10) NOT NULL DEFAULT '' COMMENT '市',
  72. area varchar(20) NOT NULL DEFAULT '' COMMENT '区',
  73. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  74. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  75. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  76. PRIMARY KEY (area_id) USING BTREE
  77. ) ENGINE = InnoDB default charset=utf8 comment = '居民表';
  78. -- ----------------------------
  79. -- Table structure for sys_uptown
  80. -- ----------------------------
  81. DROP TABLE IF EXISTS sys_uptown;
  82. CREATE TABLE sys_uptown (
  83. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
  84. uptown_name varchar(20) NOT NULL DEFAULT '' COMMENT '小区名称',
  85. uptown_addr varchar(100) NOT NULL DEFAULT '' COMMENT '小区地址',
  86. longitude varchar(20) NOT NULL DEFAULT '' COMMENT '经度',
  87. latitude varchar(20) NOT NULL DEFAULT '' COMMENT '纬度',
  88. area varchar(20) NOT NULL DEFAULT '' COMMENT '区',
  89. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  90. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  91. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  92. PRIMARY KEY (uptown_id) USING BTREE
  93. ) ENGINE = InnoDB default charset=utf8 comment = '小区表';
  94. -- ----------------------------
  95. -- Table structure for sys_uptown_house
  96. -- ----------------------------
  97. DROP TABLE IF EXISTS sys_uptown_house;
  98. CREATE TABLE sys_uptown_house (
  99. house_id bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
  100. uptown_id bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
  101. ridgepole int(11) NOT NULL DEFAULT 0 COMMENT '栋',
  102. unit int(11) NOT NULL DEFAULT 0 COMMENT '单元',
  103. doorplate varchar(20) NOT NULL DEFAULT '' COMMENT '门牌',
  104. status int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
  105. time_create datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  106. time_update datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  107. PRIMARY KEY (house_id) USING BTREE
  108. ) ENGINE = InnoDB default charset=utf8 comment = '小区门牌表';