ソースを参照

修复API bug

zhangliwen 1 年間 前
コミット
944e332674
1 ファイル変更7 行追加7 行削除
  1. 7 7
      SCADA_DAQ/Customer/Service/CustomerService.cs

+ 7 - 7
SCADA_DAQ/Customer/Service/CustomerService.cs

@@ -415,15 +415,15 @@ namespace SCADA_DAQ.Customer.Service
 
             var sql = $"DECLARE @W VARCHAR(10), @P VARCHAR(10);" +
                 $"SET @W = '{CustomerEnv.ProductionLineConfigValue.WorkShopId}'; " + 
-                $"SET @P = '{CustomerEnv.ProductionLineConfigValue.ProductionLineId}';" +
-                $"SELECT WorkShopId_Str AS 车间号, ProductionLineId_Str AS 产线号, COUNT(*) AS 产量, " +
+                $"SET @P = '{CustomerEnv.ProductionLineConfigValue.ProductionLineId}'; " +
+                $"SELECT WorkShopId_Str AS 车间号, ProductionLineId_Str AS 产线号, COUNT(*) AS 产量, " +
                 $"(SELECT COUNT(*) FROM APP_TaiLing_ProductionRecord " +
-                $"WHERE DATEDIFF(mm, EndTime_Dt, GETDATE()) = 0 AND WorkShopId_Str = @W AND ProductionLineId_Str = @P) AS 月产量," +
+                $"WHERE DATEDIFF(mm, EndTime_Dt, GETDATE())=0 AND WorkShopId_Str=@W AND ProductionLineId_Str=@P) AS 月产量, " +
                 $"(SELECT COUNT(*) FROM APP_TaiLing_ProductionRecord " +
-                $"WHERE WorkShopId_Str = @W AND ProductionLineId_Str = @P) AS 总产量 " +
-                $"FROM APP_TaiLing_ProductionRecord " + 
-                $"WHERE DATEDIFF(dd, EndTime_Dt, GETDATE())= 0 AND WorkShopId_Str = @W AND ProductionLineId_Str = @P " +
-                $"GROUP BY WorkShopId_Str, ProductionLineId_Str; ";
+                $"WHERE DATEDIFF(dd, EndTime_Dt, GETDATE())=0 AND WorkShopId_Str=@W AND ProductionLineId_Str=@P) AS 日产量 " +
+                $"FROM APP_TaiLing_ProductionRecord " +
+                $"WHERE WorkShopId_Str=@W AND ProductionLineId_Str=@P " +
+                $"GROUP BY WorkShopId_Str, ProductionLineId_Str;";
             var dt = DAL.ReadDataTable(sql);
 
             // 设置静态缓存