Browse Source

Revert "增加只查3天内数据"

This reverts commit ed0a9a172a.
master
fyf 2 years ago
parent
commit
7334e965ff
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      DataVAPI.ServerDB/MongoDB/MongodbHelper.cs

+ 3
- 3
DataVAPI.ServerDB/MongoDB/MongodbHelper.cs View File

@@ -211,7 +211,7 @@ namespace DataVAPI.ServerDB.MongoDB


public List<T> QueryClientIdName(string clientId,string name) public List<T> QueryClientIdName(string clientId,string name)
{ {
return collection.Find(a => a.ClientId == clientId && a.devicename==name && a.CreateTime >= DateTime.Now.Date)?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
return collection.Find(a => a.ClientId == clientId && a.devicename==name)?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
} }


public T QueryClientIdMax(string clientId) public T QueryClientIdMax(string clientId)
@@ -222,13 +222,13 @@ namespace DataVAPI.ServerDB.MongoDB


public T QueryClientIdMaxName(string clientId,string name) public T QueryClientIdMaxName(string clientId,string name)
{ {
List<T> clo = collection.Find(a => a.ClientId == clientId && a.devicename==name && a.CreateTime >= DateTime.Now.AddDays(-3).Date && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
List<T> clo = collection.Find(a => a.ClientId == clientId && a.devicename==name && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
return clo.Count > 0 ? clo[0] : null; return clo.Count > 0 ? clo[0] : null;
} }


public List<T> QueryDeviceId(string clientId, string deviceId) public List<T> QueryDeviceId(string clientId, string deviceId)
{ {
return collection.Find(a => a.DeviceId == deviceId && a.ClientId == clientId && a.CreateTime >= DateTime.Now.AddDays(-3).Date && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
return collection.Find(a => a.DeviceId == deviceId && a.ClientId == clientId && a.CreateTime >= DateTime.Now.Date && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime)?.ToList();
} }


public List<T> QueryAll() public List<T> QueryAll()


Loading…
Cancel
Save