package com.steering.pss.sale.order;

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

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

public class CoreOrderListInformation extends DBCommon {

    /**
     * 查询合同清单
     * @param orderNo
     * @param arr
     * @return
     */
    public CoreReturnObject queryOrderList(String orderNo, String[] arr,
            String start, String end) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderListInformation.queryOrderList");
        if (!StringTool.isNullOrEmpty(start) && !StringTool.isNullOrEmpty(end)) {
            sql += " AND B.CREATE_TIME BETWEEN TO_DATE('" + start
                    + "','YYYY-MM-DD HH24:MI:SS')" + " AND TO_DATE('" + end
                    + "','YYYY-MM-DD HH24:MI:SS')";
        }
        String str = CoreConverter.toSqlConditionString("A.CREATE_DEPT", arr);
        sql += str;
        Object[] obj = new Object[] { orderNo };
        return this.getData(sql, obj);
    }
}
