|
@@ -626,8 +626,7 @@ if __name__ == "__main__" :
|
|
cursor.execute("DELETE " + targetDBName + ".dbo.BemsMonitoringPointForecastingHourAhead where SiteId = 1 and FacilityTypeId = 99 and FacilityCode = 4863 and PropertyId = 1 and TargetDateTime >= '" + datetime.datetime.now().strftime('%Y-%m-%d 00:00:00') + "' and TargetDateTime < '" + (datetime.datetime.now() + datetime.timedelta(days=1)).strftime('%Y-%m-%d 00:00:00') + "'")
|
|
cursor.execute("DELETE " + targetDBName + ".dbo.BemsMonitoringPointForecastingHourAhead where SiteId = 1 and FacilityTypeId = 99 and FacilityCode = 4863 and PropertyId = 1 and TargetDateTime >= '" + datetime.datetime.now().strftime('%Y-%m-%d 00:00:00') + "' and TargetDateTime < '" + (datetime.datetime.now() + datetime.timedelta(days=1)).strftime('%Y-%m-%d 00:00:00') + "'")
|
|
|
|
|
|
for i in range(len(tmpTime)):
|
|
for i in range(len(tmpTime)):
|
|
- cursor.execute("INSERT INTO " + targetDBName + ".dbo.BemsMonitoringPointForecastingHourAhead (SiteId,FacilityTypeId,FacilityCode,PropertyId,CreatedDateTime,TargetDateTime,ForecastedValue) VALUES(1,99,4863,1,'" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + "','"+ datetime.datetime(tmpTime[i].year,tmpTime[i].month,tmpTime[i].day,tmpTime[i].hour,0,0).strftime('%Y-%m-%d %H:00:00') + "',"+str(y_pred_oneStep[i])+")")
|
|
|
|
-
|
|
|
|
|
|
+ cursor.execute("INSERT INTO " + targetDBName + ".dbo.BemsMonitoringPointForecastingHourAhead (SiteId,FacilityTypeId,FacilityCode,PropertyId,CreatedDateTime,TargetDateTime,ForecastedValue) VALUES(1,99,4863,1,'" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + "','"+ datetime.datetime(tmpTime[i].year,tmpTime[i].month,tmpTime[i].day,tmpTime[i].hour,0,0).strftime('%Y-%m-%d %H:00:00') + "',"+str(y_pred_oneStep[i])+")")
|
|
|
|
|
|
# Day-ahead (지우고 다시 쓰기)
|
|
# Day-ahead (지우고 다시 쓰기)
|
|
FinalTime = datetime.datetime(now.year, now.month, now.day, 23, 0, 0)
|
|
FinalTime = datetime.datetime(now.year, now.month, now.day, 23, 0, 0)
|