浏览代码

修改 query 電樁和heartbeatinterval 語法

Jessica Tseng 2 年之前
父节点
当前提交
70ac309ed4
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      EVCB_OCPP.TaskScheduler/Jobs/CheckEVSEOnlineJob.cs

+ 2 - 1
EVCB_OCPP.TaskScheduler/Jobs/CheckEVSEOnlineJob.cs

@@ -245,7 +245,8 @@ namespace EVCB_OCPP.TaskScheduler.Jobs
                 {
                     dbConn.Open();
                     string sqlstring = "SELECT m.CustomerId,m.Id,m.ChargeBoxId,m.Online,m.HeartbeatUpdatedOn,MachineConfigurations.ConfigureSetting HeartbeatInterval"
-                   + "  FROM [dbo].[Machine]  m,[dbo].[MachineConfigurations] where MachineConfigurations.ConfigureName = 'HeartbeatInterval' and m.ChargeBoxId = MachineConfigurations.ChargeBoxId";
+                   + "  FROM [dbo].[Machine]  m  left join [dbo].[MachineConfigurations]  MachineConfigurations  on m.ChargeBoxId = MachineConfigurations.ChargeBoxId"
+                   + " where MachineConfigurations.ConfigureName = 'HeartbeatInterval'  and MachineConfigurations.ConfigureSetting!=''";
                     result = dbConn.Query<EVSECurrentStatus>(sqlstring).ToList();
                 }