package com.steering.pss.crm.server;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.Util.StringUtils;
import com.steering.comm.db.DBCommon;

public class CrmOrderProduceServer extends DBCommon {
    /**
     * 查询
     * @param starttime   开始时间
     * @param endtime   结束时间
     * @return
     */
    public CoreReturnObject Query(String starttime , String endtime , String orderno){
        String sql = CoreXmlSqlParsersFactory.getSql("CrmOrderProduceServer.Query");

        if(!StringUtils.isEmpty(starttime) && !StringUtils.isEmpty(endtime)){
            sql += " AND  T.CREATE_TIME BETWEEN to_date('" + starttime + "','yyyy-MM-dd HH24:MI:SS') AND to_date('" + endtime + "','yyyy-MM-dd HH24:MI:SS')";
        }

        if(!StringUtils.isEmpty(orderno)){
            sql += " AND P.ORDER_NO like '%"+orderno+"%'";
        }

        return this.getData(sql);
    }



}
