debug 共用設備 無 default table

This commit is contained in:
jiahao 2024-07-03 14:45:14 +08:00
parent a07d080198
commit b4c7bac548
3 changed files with 18 additions and 3 deletions

View File

@ -278,7 +278,22 @@ namespace solarApp.Service
foreach (var item in ds_sensor)
{
tableName = item.TableName;
break;
sql = @"select count(*) ct from " + _siteDB + "." + tableName + @"
where FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') = @date1 ";
cmd.Connection = conn;
cmd.CommandTimeout = 720;
cmd.Parameters.AddWithValue("@date1", _date1);
cmd.CommandText = sql;
string CT = cmd.ExecuteScalar().ToString();
cmd.Parameters.Clear();
if (!string.IsNullOrEmpty(CT))
{
if (int.Parse(CT) >0)
{
tableName = item.TableName;
break;
}
}
}
sql = @"insert into sensor_history_hour( `PowerStationId`, `TIMESTAMP`, Irradiance, Temperature, EnvTemperature, Humidity, Vane, Dust, WingDirection, irrDay, irrDayHour)

View File

@ -772,7 +772,7 @@ namespace solarApp
ClientSize = new System.Drawing.Size(1782, 1026);
Controls.Add(tabControl1);
Name = "fmArchive";
Text = "fmArchive 0918";
Text = "fmArchive 1229";
Load += fmArchive_Load;
tabControl1.ResumeLayout(false);
tabPage1.ResumeLayout(false);

View File

@ -108,7 +108,7 @@ namespace solarApp
f2.Dock = DockStyle.Fill;
f2.Show();
#endregion
logger.Information("start winform process @" + System.DateTime.Now.ToString());
logger.Information("start winform process @" + System.DateTime.Now.ToString());
}
private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)