This commit is contained in:
xyy
2026-05-11 19:06:26 +08:00
parent 3dece416fa
commit 7780b4758b
26 changed files with 428 additions and 93 deletions

View File

@@ -42,10 +42,10 @@ namespace ShanghaiEnvironmentalTechnology
using (SQLiteConnection conn = new SQLiteConnection(CSConstant.DbConnectionString))
{
conn.Open();
string query = "SELECT Id, Flow, Pressure, BeginCO2, EndCO2, CO2Added, RecordTime FROM CO2";
string query = "SELECT Id, Flow, Pressure, BeginCO2, EndCO2, CO2Added, RecordTime,IsEnd FROM CO2 where 1=1 and isEnd=1 ";
if (!string.IsNullOrEmpty(startDate) && !string.IsNullOrEmpty(endDate))
{
query += " WHERE RecordTime BETWEEN @startDate AND @endDate";
query += " And RecordTime BETWEEN @startDate AND @endDate";
}
query += " LIMIT @offset, @limit";
@@ -259,7 +259,7 @@ namespace ShanghaiEnvironmentalTechnology
MessageBox.Show("CO2表中无数据无法导出", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
records = records.Where(s => s.isEnd ?? false).ToList();
bool success = ExportCO2RecordsToExcel(records);
if (success)
{
@@ -288,7 +288,7 @@ namespace ShanghaiEnvironmentalTechnology
using (SQLiteConnection conn = new SQLiteConnection(CSConstant.DbConnectionString))
{
conn.Open();
string query = "SELECT BeginCO2, EndCO2, CO2Added, RecordTime FROM CO2 WHERE 1=1";
string query = "SELECT BeginCO2, EndCO2, CO2Added, RecordTime,isEnd FROM CO2 WHERE 1=1 ";
if (startDate != null) query += " AND RecordTime >= @StartDate";
if (endDate != null) query += " AND RecordTime <= @EndDate";
@@ -308,7 +308,8 @@ namespace ShanghaiEnvironmentalTechnology
BeginCO2 = reader.GetDouble(0),
EndCO2 = reader.GetDouble(1),
CO2Added = reader.GetDouble(2),
RecordTime = reader.GetDateTime(3)
RecordTime = reader.GetDateTime(3),
isEnd = reader.GetBoolean(4)
});
}
}