|
@@ -415,15 +415,15 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
|
|
|
var sql = $"DECLARE @W VARCHAR(10), @P VARCHAR(10);" +
|
|
var sql = $"DECLARE @W VARCHAR(10), @P VARCHAR(10);" +
|
|
$"SET @W = '{CustomerEnv.ProductionLineConfigValue.WorkShopId}'; " +
|
|
$"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 " +
|
|
$"(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 " +
|
|
$"(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);
|
|
var dt = DAL.ReadDataTable(sql);
|
|
|
|
|
|
// 设置静态缓存
|
|
// 设置静态缓存
|