hsy
2026-08-28 a8e4132c3e2e9c3b3fcb0360901b35571b6464ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- 房屋租赁主表
DROP TABLE IF EXISTS `house_lease`;
CREATE TABLE `house_lease` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `office` varchar(100) NOT NULL COMMENT '办事处',
  `user_name` varchar(100) NOT NULL COMMENT '使用人',
  `resident_staff` varchar(100) NOT NULL COMMENT '驻省人员',
  `address` varchar(255) NOT NULL COMMENT '地址',
  `rent_start_date` date NOT NULL COMMENT '起租时间',
  `contract_start_date` date NOT NULL COMMENT '合同起租日',
  `contract_end_date` date NOT NULL COMMENT '合同到期日',
  `tenant` varchar(100) NOT NULL COMMENT '承租人',
  `party_a` varchar(100) NOT NULL COMMENT '合同甲方',
  `phone` varchar(20) DEFAULT NULL COMMENT '电话',
  `area` decimal(18,2) DEFAULT NULL COMMENT '面积',
  `payment_method` varchar(50) NOT NULL COMMENT '支付方式',
  `deposit` decimal(18,2) DEFAULT NULL COMMENT '押金',
  `rent` decimal(18,2) NOT NULL COMMENT '租金(元/月)',
  `create_user` int DEFAULT NULL COMMENT '创建者',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '更新者',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  `tenant_id` int DEFAULT NULL COMMENT '租户ID',
  `dept_id` bigint DEFAULT NULL COMMENT '部门ID',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋租赁管理主表';
 
-- 房屋租赁费用子表
DROP TABLE IF EXISTS `house_lease_cost`;
CREATE TABLE `house_lease_cost` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `lease_id` bigint(20) NOT NULL COMMENT '租赁表ID',
  `month` varchar(7) NOT NULL COMMENT '月份 (YYYY-MM)',
  `rent` decimal(18,2) DEFAULT '0.00' COMMENT '房租',
  `water_electricity` decimal(18,2) DEFAULT '0.00' COMMENT '水电',
  `property` decimal(18,2) DEFAULT '0.00' COMMENT '物业',
  `express` decimal(18,2) DEFAULT '0.00' COMMENT '快递',
  `broadband` decimal(18,2) DEFAULT '0.00' COMMENT '宽带',
  `create_user` int DEFAULT NULL COMMENT '创建者',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '更新者',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  `tenant_id` int DEFAULT NULL COMMENT '租户ID',
  `dept_id` bigint DEFAULT NULL COMMENT '部门ID',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_lease_month` (`lease_id`, `month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋租赁管理费用子表';