package com.steering.mes.zgmil.report;

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

import com.steering.comm.converter.CoreConverter;
import com.steering.comm.db.DBCommon;

public class FrmStraighten extends DBCommon {

    /**
     *查询上料锯切
     */
    public CoreReturnObject queryMinResult(String date, String endDate,
            String bc, String bz,String JudgeStoveNo, String[] plineCodes) {
    	String sql = "";
        String sql1 = CoreXmlSqlParsersFactory
                .getSql("FrmStraighten.queryMinResult");
        if (!date.equals("")) {
            sql += " AND T2.END_STRAIGHTENING_TIME BETWEEN TO_DATE('" + date
                    + "' ,'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('" + endDate
                    + "' ,'YYYY-MM-DD HH24:MI:SS') ";
        }
        if (!bc.equals("")) {
            sql += "  AND T2.COL_SHIFT = '" + bc + "' ";
        }
        if (!bz.equals("")) {
            sql += " AND T2.COL_GROUP = '" + bz + "' ";
        }
        if (!JudgeStoveNo.equals("")) {
            sql += " AND T2.JUDGE_STOVE_NO LIKE '%" + JudgeStoveNo + "%' ";
        }
        sql += CoreConverter.toSqlConditionString("T2.PLINE_CODE", plineCodes);
        
        sql1 = sql1.replace("#SOMETHING#", sql);
        return this.getData(sql1);
    }
}
