This commit is contained in:
@@ -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)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user