添加日报
This commit is contained in:
40
CleanMachine.DAL/ZBK/DayReportDAL.cs
Normal file
40
CleanMachine.DAL/ZBK/DayReportDAL.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using LeadDataBaseUtility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace CleanMachine.DAL.ZBK
|
||||
{
|
||||
public class DayReportDAL
|
||||
|
||||
{
|
||||
|
||||
|
||||
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 date(INPUT_TIME) as date,SUM(CURRENT_NUMBER) as cleaned from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE='SortedCleaned'
|
||||
GROUP BY date(INPUT_TIME)) as a
|
||||
LEFT JOIN
|
||||
(
|
||||
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)
|
||||
) as tbl
|
||||
";
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
strSql += $" WHERE {strWhere}";
|
||||
}
|
||||
return LeadDbHelperSQLite.Query<Model.ZBK.DayReport>(strSql, Params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user