using LeadDataBaseUtility; using System; using System.Collections.Generic; using System.Text; namespace CleanMachine.DAL.ZBK { public class DayReportDAL { public IEnumerable 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(strSql, Params); } } }