修改
This commit is contained in:
@@ -10,13 +10,42 @@ namespace CleanMachine.DAL.ZBK
|
||||
{
|
||||
|
||||
|
||||
|
||||
public IEnumerable<Model.ZBK.OperatorReport> GetOPReport(string strWhere, object Params = null)
|
||||
{
|
||||
|
||||
|
||||
string strSql = $@"
|
||||
select * from (SELECT a.*,b.Scrap 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
|
||||
(
|
||||
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
|
||||
|
||||
) as tbl
|
||||
";
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
strSql += $" WHERE {strWhere}";
|
||||
}
|
||||
return LeadDbHelperSQLite.Query<Model.ZBK.OperatorReport>(strSql, Params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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'
|
||||
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,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
|
||||
(
|
||||
@@ -25,6 +54,7 @@ namespace CleanMachine.DAL.ZBK
|
||||
) as b on a.date=b.date
|
||||
LEFT JOIN CM_DayWorkTime as c on a.date=date(c.date)
|
||||
) as tbl
|
||||
|
||||
";
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user