Ejemplo n.º 1
0
 /// <summary>
 /// 根据时间和设备ID获取设备预案
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List <DevicePlanAndTimeConfig> QueryDevicePlanByDeviceIdAndTime(DevicePlanQuery query)
 {
     try
     {
         string sql = IBatisHelper.GetRuntimeSql(mapContext, "QueryDevicePlanByDeviceIdAndTime", query);
         return(mapContext.QueryForList <DevicePlanAndTimeConfig>("QueryDevicePlanByDeviceIdAndTime", query).ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 根据设备ID,报警时间,预案状态查找设备预案
 /// </summary>
 /// <param name="deviceId"></param>
 /// <param name="planTime"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 private List <DevicePlanAndTimeConfig> CheckDevicePlanIsExist(int deviceId, int status, string alarmTime)
 {
     try
     {
         ServDevicePlanDAL devicePlanDal = new ServDevicePlanDAL();
         DevicePlanQuery   query         = new DevicePlanQuery();
         query.alarmTime  = alarmTime;
         query.deviceId   = deviceId;
         query.planStatus = status;
         return(devicePlanDal.QueryDevicePlanByDeviceIdAndTime(query));
     }
     catch (Exception ex)
     {
         Log4NetHelp.Error("根据设备ID,报警时间,预案状态查找设备预案失败!设备ID:" + deviceId + "报警时间:" + alarmTime + "预案状态:" + status + "错误信息:" + ex.Message);
         return(null);
     }
 }