From ff7f6e368c03061e417b9a22ed1c31ba3fd271c2 Mon Sep 17 00:00:00 2001 From: cesar liu Date: Mon, 18 Jul 2022 09:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=AC=E7=A7=BB=E9=83=A8=E5=88=86=E6=AF=8F?= =?UTF-8?q?=E5=B0=8F=E6=99=82=E6=9B=B4=E6=96=B0=E9=9B=BB=E7=AB=99=E8=B3=87?= =?UTF-8?q?=E8=A8=8A=E8=87=B3=20winform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repository/Implement/PowerStationRepository.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index d42fbb6..a9609f1 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -2126,7 +2126,7 @@ namespace SolarPower.Repository.Implement { var sql = $"SELECT * FROM {db_name}.{table_name} WHERE {where}"; - result = await conn.QueryFirstOrDefaultAsync(sql); + result = await conn.QueryFirstOrDefaultAsync(sql, commandTimeout: 600); } catch (Exception exception) { @@ -6147,10 +6147,10 @@ namespace SolarPower.Repository.Implement { var sql = $@"SELECT * FROM - (SELECT a.SITEID AS Avg FROM {dbname}.s{code}01_sensoravg a ORDER BY a.ID DESC LIMIT 1) a, - (SELECT a.SITEID AS Inv_site,a.INVERTERID as Inv_inveter FROM {dbname}.s{code}01_inv a ORDER BY a.ID DESC LIMIT 1) b, - (SELECT a.SITEID AS Station FROM {dbname}.s{code}01_station a ORDER BY a.ID DESC LIMIT 1) c, - (SELECT a.SITEID AS Sensor FROM {dbname}.s{code}01_sensor a ORDER BY a.ID DESC LIMIT 1) d + (SELECT count(*) ctAvg, a.SITEID AS Avg FROM {dbname}.s{code}01_sensoravg a ORDER BY a.ID DESC LIMIT 1) a, + (SELECT count(*) ctInv_site, a.SITEID AS Inv_site,a.INVERTERID as Inv_inveter FROM {dbname}.s{code}01_inv a ORDER BY a.ID DESC LIMIT 1) b, + (SELECT count(*) ctStation, a.SITEID AS Station FROM {dbname}.s{code}01_station a ORDER BY a.ID DESC LIMIT 1) c, + (SELECT count(*) ctSensor, a.SITEID AS Sensor FROM {dbname}.s{code}01_sensor a ORDER BY a.ID DESC LIMIT 1) d "; resule = await conn.QueryFirstOrDefaultAsync(sql);