瀏覽代碼

修复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);
 
             // 设置静态缓存