Browse Source

add 退租日期

Ping 1 năm trước cách đây
mục cha
commit
f2afa31b95
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      etl_utility.py

+ 4 - 2
etl_utility.py

@@ -22,7 +22,8 @@ debug = False
 if debug:
     # debug_condition = " and crc.id='1634463949758156801'"  # debug charge amount
     # debug_condition = " and crc.id='1635124251453575170'"  # debug renew contract
-    debug_condition = " and crc.id='1649702247584620545'"  # debug 期末读数
+    # debug_condition = " and crc.id='1649702247584620545'"  # debug 期末读数
+    debug_condition = " and crc.id='1674347182259716097'"  # debug 退租日期
 else:
     debug_condition = ''
 
@@ -215,7 +216,7 @@ def transform(conn, td_cursor, data) -> pd.DataFrame:
     # target columns
     columns = ['theday', 'house_dept_id', 'house_dept_name', 'address', 'contract_dept_id', 'contract_dept_name',
                'contract_id', 'contract_maintainer', 'renter_name', 'contract_terminate_type',
-               'begin_time', 'end_time', 'kind', 'begin_amount', 'end_amount', 
+               'begin_time', 'end_time', 'quit_time', 'kind', 'begin_amount', 'end_amount',
                'amount', 'balance', 'cost', 'charge_amount', 'clear_amount']
     # target data
     target_data = []
@@ -263,6 +264,7 @@ def transform(conn, td_cursor, data) -> pd.DataFrame:
                     'contract_terminate_type': row['退租类型'],
                     'begin_time': begin_time,
                     'end_time': end_time,
+                    'quit_time': row['quite_date'],
                     'kind': meter_record['device_type'],
                     'begin_amount': meter_record['begin_amount'],
                     'end_amount': meter_record['end_amount'],