1
This commit is contained in:
@@ -16,7 +16,7 @@ namespace CleanMachine.DAL.ZBK
|
||||
|
||||
|
||||
string strSql = $@"
|
||||
select * from (SELECT a.*,b.Scrap from
|
||||
select * from (SELECT a.*,b.Scrap,(EndValue-StartValue)/3600.0 as MachineHours,c.StartTime,c.EndTime from
|
||||
(SELECT date(INPUT_TIME) as date, USER_NAME as Operator ,SUM(CURRENT_NUMBER) as cleaned from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE='SortedCleaned'
|
||||
GROUP BY date(INPUT_TIME),USER_NAME) as a
|
||||
LEFT JOIN
|
||||
@@ -24,6 +24,7 @@ namespace CleanMachine.DAL.ZBK
|
||||
SELECT date(INPUT_TIME) as date,USER_NAME as Operator,SUM(CURRENT_NUMBER) as scrap from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE<>'SortedCleaned'
|
||||
GROUP BY date(INPUT_TIME),USER_NAME
|
||||
) as b on a.date=b.date and a.Operator=b.Operator
|
||||
left join CM_DayWorkTime as c on a.date=date(c.date) and a.Operator=c.UserName
|
||||
|
||||
) as tbl
|
||||
";
|
||||
@@ -42,9 +43,8 @@ namespace CleanMachine.DAL.ZBK
|
||||
public IEnumerable<Model.ZBK.DayReport> GetReport(string strWhere,object Params=null)
|
||||
{
|
||||
|
||||
|
||||
string strSql = $@"
|
||||
select * from (SELECT a.*,b.Scrap,c.StartValue,c.EndValue,c.StartTime,c.EndTime from
|
||||
select * from (SELECT a.*,b.Scrap,c.MachineHours,c.StartTime,c.EndTime from
|
||||
(SELECT date(INPUT_TIME) as date,SUM(CURRENT_NUMBER) as cleaned,GROUP_CONCAT(DISTINCT USER_NAME) as operators from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE='SortedCleaned'
|
||||
GROUP BY date(INPUT_TIME)) as a
|
||||
LEFT JOIN
|
||||
@@ -52,9 +52,11 @@ namespace CleanMachine.DAL.ZBK
|
||||
SELECT date(INPUT_TIME) as date,SUM(CURRENT_NUMBER) as scrap from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE<>'SortedCleaned'
|
||||
GROUP BY date(INPUT_TIME)
|
||||
) as b on a.date=b.date
|
||||
LEFT JOIN CM_DayWorkTime as c on a.date=date(c.date)
|
||||
LEFT JOIN
|
||||
(SELECT date(date) as date,SUM(EndValue-StartValue)/3600.0 as MachineHours, MIN(StartTime) as StartTime,MAX(EndTime) as EndTime from
|
||||
|
||||
CM_DayWorkTime GROUP BY date(date) ) as c on a.date=date(c.date)
|
||||
) as tbl
|
||||
|
||||
";
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user