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 FrmMilSamplingQuality extends DBCommon {

    /**
     *查询热轧钢管取样质量原始记录
     */
    public CoreReturnObject queryMinResult(String date, String endDate,
            String bc, String bz,String JudgeStoveNo, String[] plineCodes) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("FrmMilSamplingQuality.queryMinResult");
        if (!date.equals("")) {
            sql += " AND T.CHECK_DATE 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 T.COL_SHIFT = '" + bc + "' ";
        }
        if (!bz.equals("")) {
            sql += " AND T.COL_GROUP = '" + bz + "' ";
        }
        if (!JudgeStoveNo.equals("")) {
            sql += " AND T.JUDGE_STOVE_NO LIKE '%" + JudgeStoveNo + "%' ";
        }
        sql += CoreConverter.toSqlConditionString("T.PLINE_CODE", plineCodes);
        sql += "ORDER BY T.JUDGE_STOVE_NO,T.CHECK_DATE,T1.PIPE_LOCATION";
        return this.getData(sql);
    }
}
