|
|
@@ -211,7 +211,7 @@ namespace DataVAPI.ServerDB.MongoDB |
|
|
|
|
|
|
|
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) |
|
|
@@ -222,13 +222,13 @@ namespace DataVAPI.ServerDB.MongoDB |
|
|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
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() |
|
|
|