diff --git a/solarApp/Service/getInvSvc.cs b/solarApp/Service/getInvSvc.cs index b4a1d30..dd12442 100644 --- a/solarApp/Service/getInvSvc.cs +++ b/solarApp/Service/getInvSvc.cs @@ -29,7 +29,7 @@ namespace solarApp.Service from " + siteDB + ".s" + siteID + @"_inv where left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') , 10) = '" + reportDate + "' and inverterid = '" + invID + "'"; //List ds = conn.Query(sql, new { kind = kind }).ToList(); - List ds = conn.Query(sql).AsList(); + List ds = conn.Query(sql, commandTimeout: 600).AsList(); conn.Close(); return ds; } @@ -69,7 +69,7 @@ namespace solarApp.Service // from " + siteDB + ".s" + siteID + @"_inv // where FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') = '" + reportDate + @"' and right(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 2) = '55' and inverterid = '" + invID + @"' // )b on a.reportdate = left(b.reportdate, 13) and a.inverterid = b.inverterid "; - List ds = conn.Query(sql).AsList(); + List ds = conn.Query(sql, commandTimeout: 600).AsList(); conn.Close(); return ds; } @@ -106,7 +106,7 @@ namespace solarApp.Service string sql = @"select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d %H:%i') reportdate, inverterid, KWH, TODAYKWH, TOTALKWH, round(PR, 2) PR from inverter_history_hour where crdDate = '" + reportDate + "' and inverterid = '" + invID + "' "; - List ds = conn.Query(sql).AsList(); + List ds = conn.Query(sql, commandTimeout: 600).AsList(); conn.Close(); return ds; } @@ -130,7 +130,7 @@ from inverter_history_day a left join ( group by DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d'), inverterid ) b on a.inverterid = b.inverterid and DATE_FORMAT(a.`TIMESTAMP`,'%Y-%m-%d') = b.reportdate where crdDate between '" + date1 + "' and '" + date2 + "' and a.inverterid = '" + invID + "' order by 1"; - List ds = conn.Query(sql).AsList(); + List ds = conn.Query(sql, commandTimeout: 600).AsList(); conn.Close(); return ds; } @@ -143,7 +143,7 @@ where crdDate between '" + date1 + "' and '" + date2 + "' and a.inverterid = '" conn.Open(); string sql = @"select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, inverterid, KWH, TODAYKWH, TOTALKWH, round(PR, 2) PR from inverter_history_month where left(`TIMESTAMP`, 7) between '" + date1 + "' and '" + date2 + "' and inverterid = '" + invID + "' "; - List ds = conn.Query(sql).AsList(); + List ds = conn.Query(sql, commandTimeout: 600).AsList(); conn.Close(); return ds; }