歸檔 debug , 刪除參數修正
This commit is contained in:
parent
a9a9649e8e
commit
90bc390cd7
@ -62,7 +62,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
) INTO @sql
|
) INTO @sql
|
||||||
FROM inverter_history_hour where powerstationId = {post.PowerStation} and DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') = '{post.Time}';
|
FROM inverter_history_hour where powerstationId = {post.PowerStation} and DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') = '{post.Time}';
|
||||||
SET @sql = CONCAT('SELECT DATE_FORMAT(a.TIMESTAMP,''%m-%d %H'') report_date, ', @sql,
|
SET @sql = CONCAT('SELECT DATE_FORMAT(a.TIMESTAMP,''%m-%d %H'') report_date, ', @sql,
|
||||||
', b.KWH hourKWH, round((b.KWH / (SELECT MAX(TODAYKWH) FROM power_station_history_hour WHERE DATE_FORMAT(TIMESTAMP,''%Y-%m-%d'') = ''{post.Time}'' and powerstationid = {post.PowerStation}))*100,2) ''hourKWHp'', d.irradiance ''irradiance'', d.Temperature ''temperature'',
|
, b.KWH hourKWH, round((b.KWH / (SELECT MAX(TODAYKWH) FROM power_station_history_hour WHERE DATE_FORMAT(TIMESTAMP,''%Y-%m-%d'') = ''{post.Time}'' and powerstationid = {post.PowerStation}))*100,2) ''hourKWHp'', d.irradiance ''irradiance'', d.Temperature ''temperature'',
|
||||||
b.money ''hourmoney'', c.TODAYKWH ''totKWH'', c.KWHKWP ''totKWHKWP'', c.money ''totmoney'', stationName, powerRate daymoney, c.SOLARHOUR tothour,round(b.PR, 2) as pr
|
b.money ''hourmoney'', c.TODAYKWH ''totKWH'', c.KWHKWP ''totKWHKWP'', c.money ''totmoney'', stationName, powerRate daymoney, c.SOLARHOUR tothour,round(b.PR, 2) as pr
|
||||||
FROM inverter_history_hour a left join
|
FROM inverter_history_hour a left join
|
||||||
( # 每小時加總 inv
|
( # 每小時加總 inv
|
||||||
@ -238,9 +238,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
# select @sql as 'mySelect'; #顯示動態語法
|
# select @sql as 'mySelect'; #顯示動態語法
|
||||||
PREPARE stmt FROM @sql;
|
PREPARE stmt FROM @sql;
|
||||||
EXECUTE stmt;
|
EXECUTE stmt;
|
||||||
DEALLOCATE PREPARE stmt;
|
DEALLOCATE PREPARE stmt;";
|
||||||
|
|
||||||
";
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace solarApp.Service
|
|||||||
conn.Open();
|
conn.Open();
|
||||||
string sql = @" select id as PowerStationID from solar_master.power_station where `code` = @siteID";
|
string sql = @" select id as PowerStationID from solar_master.power_station where `code` = @siteID";
|
||||||
var ds = conn.Query<string>(sql, new { siteID = _siteID }).AsList<string>();
|
var ds = conn.Query<string>(sql, new { siteID = _siteID }).AsList<string>();
|
||||||
_powerStationID = (ds.Count > 0) ? ds[0][0].ToString() : "0";
|
_powerStationID = (ds.Count > 0) ? ds[0].ToString() : "0";
|
||||||
conn.Close();
|
conn.Close();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user