| | |
| | | /// <returns></returns> |
| | | public string QueryPageDeviceGeneralInfo(string param) |
| | | { |
| | | msgss<deviceGeneralInfo> msg = new msgss<deviceGeneralInfo>(); |
| | | msgss<deviceGeneralInfoForDetail> msg = new msgss<deviceGeneralInfoForDetail>(); |
| | | DeviceGeneralInfoInput page = JsonConvert.DeserializeObject<DeviceGeneralInfoInput>(param); |
| | | try |
| | | { |
| | | using (dbModel mod = new dbModel()) |
| | | { |
| | | List<deviceGeneralInfo> fiveDayDeviceInfo = null; |
| | | List<deviceGeneralInfoForDetail> fiveDayDeviceInfo = null; |
| | | if (page.datatime == null) |
| | | { |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfo |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfoForDetail |
| | | .OrderByDescending(x => x.createTime) |
| | | .ToList(); |
| | | } |
| | |
| | | { |
| | | DateTime _startTime = Convert.ToDateTime(page.datatime[0]); |
| | | DateTime _endTime = Convert.ToDateTime(page.datatime[1]); |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfo |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfoForDetail |
| | | .Where(x => x.createTime >= _startTime && x.createTime <= _endTime) |
| | | .OrderByDescending(x => x.createTime) |
| | | .ToList(); |
| | |
| | | } |
| | | } |
| | | |
| | | List<deviceGeneralInfo> fenyeRerult = new List<deviceGeneralInfo>(); |
| | | List<deviceGeneralInfoForDetail> fenyeRerult = new List<deviceGeneralInfoForDetail>(); |
| | | if (fiveDayDeviceInfo.Count > 0) |
| | | { |
| | | msg.status = 200; |