package com.steering.mes.mcp.Report;


import com.steering.comm.db.DBCommon;
import com.steering.mes.mcp.entity.VrpLoadingResultEntity;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

public class FrmLoadingReport extends DBCommon{

	/**
     * 查询上料台账
     * @param list
     * @return
     */
    public CoreReturnObject doQueryInfoResult(VrpLoadingResultEntity plan,String plinCode,String start,String end) {
       
        String sql = CoreXmlSqlParsersFactory
                .getSql("FrmLoadingReport.GetQuery");
        if (!start.equals("")) {
            sql += " AND T.CREATE_TIME >=TO_DATE('"
                    + start
                    + "', 'YYYY-MM-DD HH24:MI:SS')AND T.CREATE_TIME <=TO_DATE('"
                    + end + "', 'YYYY-MM-DD HH24:MI:SS') ";
        }
        sql += " AND T.PLINE_CODE ='" + plinCode + "'";
        if (!plan.getLoadShift().equals("")) {
        sql += " AND T.LOAD_SHIFT ='" + plan.getLoadShift() + "'";
        }
        if (!plan.getLoadGroup().equals("")) {
        sql += " AND T.LOAD_GROUP ='" + plan.getLoadGroup() + "'";
        }
        return this.getData(sql);
    }
	
}
