1.顯示 solarHour
2.解決 inv_hour 小數點取後5位
This commit is contained in:
parent
855fa4024d
commit
e345e59b2e
@ -93,7 +93,7 @@ namespace solarApp.Service
|
||||
{
|
||||
conn.Open();
|
||||
string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d %H') reportdate, siteid, round(KWH, 2) KWH,
|
||||
round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH,
|
||||
round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, round(solarHour, 2) SOLARHOUR,
|
||||
round(PR, 3) PR, round(KWHKWP, 3) KWHKWP,
|
||||
round(money, 3) money, round(todaymoney, 3) todaymoney, round(totalmoney, 3) totalmoney,
|
||||
round(carbon, 3) carbon, round(todayCarbon, 3) todayCarbon, round(totalCarbon, 3) totalCarbon
|
||||
@ -121,7 +121,7 @@ namespace solarApp.Service
|
||||
// round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money
|
||||
// from power_station_history_day where left(`TIMESTAMP`, 10) between @date1 and @date2 and siteid = @siteID";
|
||||
string sql = @"
|
||||
select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, a.siteid, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH,
|
||||
select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, a.siteid, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, round(solarHour, 2) SOLARHOUR,
|
||||
round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money, count
|
||||
from power_station_history_day a join (
|
||||
select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, SITEID, count(*) count
|
||||
@ -143,7 +143,7 @@ namespace solarApp.Service
|
||||
using (MySqlConnection conn = new MySqlConnection(Connection1))
|
||||
{
|
||||
conn.Open();
|
||||
string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, siteid, round(TOTALKWH, 2) TOTALKWH, round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money
|
||||
string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, siteid, round(TOTALKWH, 2) TOTALKWH, round(solarHour, 2) SOLARHOUR, round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money
|
||||
from power_station_history_month where left(`TIMESTAMP`, 7) between @date1 and @date2 and siteid = @siteID";
|
||||
List<web_station_day> ds = conn.Query<web_station_day>(sql, new { date1 = date1, date2 = date2, siteID = siteID }).AsList<web_station_day>();
|
||||
conn.Close();
|
||||
|
||||
@ -130,15 +130,15 @@ namespace solarApp.Service
|
||||
((AC1W + AC2W + AC3W) / 1000) ACKW, a.KWH, a.TODAYKWH, a.TOTALKWH, (a.KWH / i.Capacity) AS KWHKWP
|
||||
from
|
||||
( -- 取得該時間區間的KWH
|
||||
SELECT concat(FROM_UNIXTIME(a.TIMESTAMP/1000,'%Y-%m-%d %H'), ':00:00') reportDate, a.INVERTERID,
|
||||
AVG(a.AC1V) AS AC1V, AVG(a.AC1A) AS AC1A, SUM(a.AC1W) AS AC1W, AVG(a.AC1F) AS AC1F, SUM(a.AC1WH) AS AC1WH, AVG(a.AC2V) AS AC2V,
|
||||
AVG(a.AC2A) AS AC2A, SUM(a.AC2W) AS AC2W, AVG(a.AC2F) AS AC2F, SUM(a.AC2WH) AS AC2WH,AVG(a.AC3V) AS AC3V, AVG(a.AC3A) AS AC3A,
|
||||
SUM(a.AC3W) AS AC3W, AVG(a.AC3F) AS AC3F, SUM(a.AC3WH) AS AC3WH, AVG(a.DC1V) AS DC1V, AVG(a.DC1A) AS DC1A, SUM(a.DC1W) AS DC1W,
|
||||
SUM(a.DC1WH) AS DC1WH, AVG(a.DC2V) AS DC2V, AVG(a.DC2A) AS DC2A, SUM(a.DC2W) AS DC2W, SUM(a.DC2WH) AS DC2WH, AVG(a.DC3V) AS DC3V,
|
||||
AVG(a.DC3A) AS DC3A, AVG(a.DC3W) AS DC3W, AVG(a.DC3WH) AS DC3WH, AVG(a.DC4V) AS DC4V, AVG(a.DC4A) AS DC4A, SUM(a.DC4W) AS DC4W,
|
||||
SUM(a.DC4WH) AS DC4WH,AVG(a.DC5V) AS DC5V, AVG(a.DC5A) AS DC5A, SUM(a.DC5W) AS DC5W, SUM(a.DC5WH) AS DC5WH,
|
||||
AVG(a.RA1) AS RA1, AVG(a.RA2) AS RA2, AVG(a.RA3) AS RA3,
|
||||
AVG(a.RA4) AS RA4, AVG(a.RA5) AS RA5, MAX(a.TODAYKWH) AS TODAYKWH, MAX(a.TOTALKWH) AS TOTALKWH, (SUM(a.WH)/1000) AS KWH
|
||||
SELECT concat(FROM_UNIXTIME(a.TIMESTAMP/1000,'%Y-%m-%d %H'), ':00:00') reportDate, a.INVERTERID,
|
||||
AVG(a.AC1V) AS AC1V, AVG(a.AC1A) AS AC1A, round(SUM(a.AC1W), 5) AS AC1W, AVG(a.AC1F) AS AC1F, SUM(a.AC1WH) AS AC1WH, AVG(a.AC2V) AS AC2V,
|
||||
AVG(a.AC2A) AS AC2A, round(SUM(a.AC2W), 5) AS AC2W, AVG(a.AC2F) AS AC2F, SUM(a.AC2WH) AS AC2WH,AVG(a.AC3V) AS AC3V, AVG(a.AC3A) AS AC3A,
|
||||
round(SUM(a.AC3W),5) AS AC3W, AVG(a.AC3F) AS AC3F, SUM(a.AC3WH) AS AC3WH, AVG(a.DC1V) AS DC1V, AVG(a.DC1A) AS DC1A, SUM(a.DC1W) AS DC1W,
|
||||
SUM(a.DC1WH) AS DC1WH, AVG(a.DC2V) AS DC2V, AVG(a.DC2A) AS DC2A, SUM(a.DC2W) AS DC2W, SUM(a.DC2WH) AS DC2WH, AVG(a.DC3V) AS DC3V,
|
||||
AVG(a.DC3A) AS DC3A, AVG(a.DC3W) AS DC3W, AVG(a.DC3WH) AS DC3WH, AVG(a.DC4V) AS DC4V, AVG(a.DC4A) AS DC4A, SUM(a.DC4W) AS DC4W,
|
||||
SUM(a.DC4WH) AS DC4WH,AVG(a.DC5V) AS DC5V, AVG(a.DC5A) AS DC5A, SUM(a.DC5W) AS DC5W, SUM(a.DC5WH) AS DC5WH,
|
||||
AVG(a.RA1) AS RA1, AVG(a.RA2) AS RA2, AVG(a.RA3) AS RA3,
|
||||
AVG(a.RA4) AS RA4, AVG(a.RA5) AS RA5, MAX(a.TODAYKWH) AS TODAYKWH, MAX(a.TOTALKWH) AS TOTALKWH, (SUM(a.WH)/1000) AS KWH
|
||||
FROM " + _siteDB + ".s" + _siteID01 + @"_inv a
|
||||
WHERE left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = @date1
|
||||
GROUP BY left(FROM_UNIXTIME(a.TIMESTAMP/ 1000, '%Y-%m-%d %H'), 13), a.INVERTERID
|
||||
|
||||
Loading…
Reference in New Issue
Block a user