增加電站 rowcount 檢查

This commit is contained in:
JiaHao Liu 2021-08-16 12:04:53 +08:00
parent 0dc2b26283
commit 855fa4024d

View File

@ -93,10 +93,10 @@ namespace solarApp.Service
{ {
conn.Open(); conn.Open();
string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d %H') reportdate, siteid, round(KWH, 2) KWH, 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(PR, 3) PR, round(KWHKWP, 3) KWHKWP, round(PR, 3) PR, round(KWHKWP, 3) KWHKWP,
round(money, 3) money, round(todaymoney, 3) todaymoney, round(totalmoney, 3) totalmoney, round(money, 3) money, round(todaymoney, 3) todaymoney, round(totalmoney, 3) totalmoney,
round(carbon, 3) carbon, round(todayCarbon, 3) todayCarbon, round(totalCarbon, 3) totalCarbon round(carbon, 3) carbon, round(todayCarbon, 3) todayCarbon, round(totalCarbon, 3) totalCarbon
from power_station_history_hour from power_station_history_hour
where siteID = @siteID and left(`TIMESTAMP`, 10) = '" + reportDate + "' "; where siteID = @siteID and left(`TIMESTAMP`, 10) = '" + reportDate + "' ";
List<web_station_hour> ds = conn.Query<web_station_hour>(sql, new { siteID = siteID.Substring(0, 9) }).AsList<web_station_hour>(); List<web_station_hour> ds = conn.Query<web_station_hour>(sql, new { siteID = siteID.Substring(0, 9) }).AsList<web_station_hour>();