package com.steering.pss.sale.order;

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

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

public class CoreOrdDesignResultDiff extends DBCommon {

    /**
     * 技术要求差异项-合同行查询
     * @param orderNo
     * @param dtS
     * @param dtE
     * @param arr
     * @return
     */
    public CoreReturnObject query(String orderNo, String dtS, String dtE,
            String[] arr) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrdDesignResultDiff.Query");
        if (!dtS.equals("") && !dtE.equals("")) {
            sql += " AND T.CREATE_TIME BETWEEN TO_DATE('" + dtS
                    + "','YYYY-MM-DD HH24:MI:SS') " + " AND TO_DATE('" + dtE
                    + "','YYYY-MM-DD HH24:MI:SS')";
        }
        String str = CoreConverter.toSqlConditionString("T1.CREATE_DEPT", arr);
        sql += str;
        return this.getData(sql, new Object[] { orderNo });
    }

    /**
     * 查询合同行的成分差异数据
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryCic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryCic", obj);
    }

    /**
     * 查询合同行的理化差异数据
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryPic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryPic", obj);
    }

    /**
     * 查询合同行的水压差异数据
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryWic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryWic", obj);
    }

    /**
     * 查询探伤差异数据
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryDic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryDic", obj);
    }

    /**
     * 查询公差差异项
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject querySic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QuerySic", obj);
    }

    /**
     * 查询加工要求差异项
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryGic(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryGic", obj);
    }

    /**
     * 查询附加要求差异项
     * @param ordLnPK
     * @return
     */
    public CoreReturnObject queryAsk(String ordLnPK) {
        Object[] obj = new Object[] { ordLnPK };
        return this.getDataBySqlID("CoreOrdDesignResultDiff.QueryAsk", obj);
    }

}
