package core.stlmes.server.sale.dao.fund;

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

public class FundInOutDao2 extends DBCommon {

    public CoreReturnObject queryinoutorderbyorderno(String begintime, String endtime,String buyercode){
        String sql = CoreXmlSqlParsersFactory.getSql("FrmInOut.FrmInOutQueryorderbyorderno");
        sql +=" AND (TO_CHAR (INOUTTIME, 'yyyymmdd')) BETWEEN '"+begintime+"' AND '"+endtime+"'";
        if(buyercode.length()>0){
            sql +=" AND BUYERCODE = '"+buyercode+"'";
        }
        sql+="AND ORDERNO IS NOT NULL";
        sql +=" GROUP BY ORDERNO,BUYERCODE,BALANCESUBJECT,ISVALID";
        return this.getData(sql);
    }

    public CoreReturnObject queryinoutdetail(String begintime, String endtime,String buyercode){
        String sql = CoreXmlSqlParsersFactory.getSql("FrmInOut.FrmINOutQuerydetail");
        sql +=" AND (TO_CHAR (INOUTTIME, 'yyyymmdd')) BETWEEN '"+begintime+"' AND '"+endtime+"'";
        if(buyercode.length()>0){
            sql +=" AND BUYERCODE = '"+buyercode+"'";
        }
        return this.getData(sql);
    }


}
