Add: Clear 6 months data out of the archive table on generate report.
This commit is contained in:
parent
7783443480
commit
ffcf4fc413
@ -33,6 +33,7 @@ namespace QueueSys
|
||||
public int id { get; set; }
|
||||
public string customer_name { get; set; }
|
||||
}
|
||||
|
||||
public class StatusModel
|
||||
{
|
||||
public string status { get; set; }
|
||||
@ -121,7 +122,11 @@ namespace QueueSys
|
||||
{
|
||||
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
|
||||
{
|
||||
string strQuery = "SELECT *,Cast ((JulianDay(end_time) - JulianDay(start_time)) * 24 * 60 As Integer) as time_elapsed from archive";
|
||||
//Clear old customers from the archive table.
|
||||
string strQuery = "DELETE FROM archive WHERE julianday(end_time) < julianday('now','-6 months')";
|
||||
cnn.Execute(strQuery);
|
||||
|
||||
strQuery = "SELECT *,Cast ((JulianDay(end_time) - JulianDay(start_time)) * 24 * 60 As Integer) as time_elapsed from archive";
|
||||
|
||||
var output = cnn.Query<ReportView>(strQuery, new DynamicParameters());
|
||||
return output.ToList();
|
||||
|
Loading…
Reference in New Issue
Block a user