|
@@ -39,9 +39,10 @@ def get_data_time(hbase_database, hbase_table, buildingid, meter, funcid,from_ti
|
|
|
#取hbase数据,处理成sql语句
|
|
|
def hbase_energy_data(points,table,building):
|
|
|
sqls = []
|
|
|
+ print("%s开始查询项目%s的%s至%s的数据" % (table, building, args.start_time, args.end_time))
|
|
|
for i in points:
|
|
|
meter,funcid = i[0],i[1]
|
|
|
- print("%s开始查询项目%s的%s至%s的数据 %s-%s"%(table,building,args.start_time,args.end_time,meter,funcid))
|
|
|
+ # print("%s开始查询项目%s的%s至%s的数据 %s-%s"%(table,building,args.start_time,args.end_time,meter,funcid))
|
|
|
datas = get_data_time(hbase_database,table,building,meter,funcid,args.start_time,args.end_time)
|
|
|
for i in datas:
|
|
|
data_time = i["data_time"]
|
|
@@ -120,8 +121,8 @@ for building in building_list:
|
|
|
|
|
|
#电
|
|
|
if args.funcid == 10101:
|
|
|
- sqls = hbase_energy_data(points, "fjd_0_near_15min",building)
|
|
|
- insert_mysql(sqls,building, my_fjd_table)
|
|
|
+ # sqls = hbase_energy_data(points, "fjd_0_near_15min",building)
|
|
|
+ # insert_mysql(sqls,building, my_fjd_table)
|
|
|
sqls = hbase_energy_data(points, "data_servicedata_15min",building)
|
|
|
insert_mysql(sqls,building, my_energy_table)
|
|
|
#CO2
|