Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
0b94bcc739
@ -62,7 +62,7 @@ namespace SolarPower.Repository.Implement
|
||||
) INTO @sql
|
||||
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,
|
||||
', 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
|
||||
FROM inverter_history_hour a left join
|
||||
( # 每小時加總 inv
|
||||
@ -238,9 +238,7 @@ namespace SolarPower.Repository.Implement
|
||||
# select @sql as 'mySelect'; #顯示動態語法
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
";
|
||||
DEALLOCATE PREPARE stmt;";
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ namespace solarApp.Service
|
||||
conn.Open();
|
||||
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>();
|
||||
_powerStationID = (ds.Count > 0) ? ds[0][0].ToString() : "0";
|
||||
_powerStationID = (ds.Count > 0) ? ds[0].ToString() : "0";
|
||||
conn.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
Loading…
Reference in New Issue
Block a user