/// <summary>
        /// 根据委托单号,从今日委托和历史委托中查询相关的委托单数据
        /// 这里如果在历史委托表中的数据因为没有可撤标识,这里为了能转换回今日委托,所以直接转为不可撤0
        /// 通道号附为空字符串""
        /// </summary>
        /// <param name="entrustStr">委托单号</param>
        /// <returns></returns>
        public List <QH_TodayEntrustTableInfo> GetEntrustListByEnturstNo(string entrustStr)
        {
            QH_TodayEntrustTableDal dal = new QH_TodayEntrustTableDal();
            CommonDALOperate <QH_TodayEntrustTableInfo> com = new CommonDALOperate <QH_TodayEntrustTableInfo>();

            return(com.ExecuterReaderDataBind(string.Format(GetEntrustListByEnturstNoSqlScript(), entrustStr.ToString()), dal.ReaderBind));
        }
        /// <summary>
        /// 根据通道号返回要回道的所有委托数据,这里包含历史委托的数据
        /// </summary>
        /// <param name="channleID">通道号</param>
        /// <returns></returns>
        public List <QH_TodayEntrustTableInfo> GetEntrustListByChannleID(string channleID)
        {
            string sql = string.Format(GetDistincEntrustNumberSqlScript(), channleID);
            QH_TodayEntrustTableDal dal = new QH_TodayEntrustTableDal();
            CommonDALOperate <QH_TodayEntrustTableInfo> com = new CommonDALOperate <QH_TodayEntrustTableInfo>();

            return(com.ExecuterReaderDataBind(string.Format(GetEntrustListByEnturstNoSqlScript(), sql), dal.ReaderBind));
        }
        /// <summary>
        /// 根据通道号返回当日成交数据,这里包括清算后移动到历史表中还是当日的数据
        /// </summary>
        /// <param name="channleID">通道Id</param>
        /// <returns></returns>
        public List <QH_TodayTradeTableInfo> GetTodayTradeListByChannleID(string channleID)
        {
            StringBuilder sb = new StringBuilder("");

            sb.Append("	SELECT [TradeNumber],[EntrustNumber],[PortfolioLogo],[TradePrice],[EntrustPrice],[TradeAmount] ");
            sb.Append("	,[TradeProceduresFee],[Margin],[ContractCode],[TradeAccount],[CapitalAccount],[BuySellTypeId] ");
            sb.Append("	,[OpenCloseTypeId],[TradeUnitId],[TradeTypeId],[CurrencyTypeId],[TradeTime],[MarketProfitLoss]  FROM [dbo].[QH_TodayTradeTable] ");
            sb.AppendFormat("	where  TradeNumber in(select TradeNumber from dbo.QH_PushBackOrderTable where channelID='{0}') ", channleID);
            sb.Append("	union  all  ");
            sb.Append("	SELECT [TradeNumber],[EntrustNumber],[PortfolioLogo],[TradePrice],[EntrustPrice],[TradeAmount] ");
            sb.Append("	,[TradeProceduresFee],[Margin],[ContractCode],[TradeAccount],[CapitalAccount],[BuySellTypeId] ");
            sb.Append("	,[OpenCloseTypeId],[TradeUnitId],[TradeTypeId],[CurrencyTypeId],[TradeTime],[MarketProfitLoss]   from QH_HistoryTradeTable   ");
            sb.AppendFormat("	where  TradeNumber in( select TradeNumber from dbo.QH_PushBackOrderTable where channelID='{0}') ", channleID);
            QH_TodayTradeTableDal dal = new QH_TodayTradeTableDal();
            CommonDALOperate <QH_TodayTradeTableInfo> com = new CommonDALOperate <QH_TodayTradeTableInfo>();

            return(com.ExecuterReaderDataBind(sb.ToString(), dal.ReaderBind));
        }
        /// <summary>
        /// 根据通道号返回当日成交数据,这里包括清算后移动到历史表中还是当日的数据
        /// </summary>
        /// <param name="channleID">通道号</param>
        /// <returns></returns>
        public List <HK_TodayTradeInfo> GetTodayTradeListByChannleID(string channleID)
        {
            StringBuilder sb = new StringBuilder("");

            sb.Append("   SELECT [TradeNumber],[PortfolioLogo],[EntrustNumber],[TradePrice],[TradeAmount]");
            sb.Append(" ,[EntrustPrice],[StampTax],[Commission],[TransferAccountFee],[TradeProceduresFee],[MonitoringFee] ");
            sb.Append(" ,[TradingSystemUseFee],[TradeCapitalAmount],[ClearingFee],[HoldAccount],[CapitalAccount]");
            sb.Append(" ,[Code],[TradeTypeId],[TradeUnitId],[BuySellTypeId],[CurrencyTypeId],[TradeTime] ");
            sb.Append("  from HK_TodayTrade ");
            sb.AppendFormat(" where  TradeNumber in(select TradeNumber from dbo.HK_PushBackOrder where channelID='{0}')", channleID);
            sb.Append(" union  all");
            sb.Append("   SELECT [TradeNumber],[PortfolioLogo],[EntrustNumber],[TradePrice],[TradeAmount]");
            sb.Append(" ,[EntrustPrice],[StampTax],[Commission],[TransferAccountFee],[TradeProceduresFee],[MonitoringFee]");
            sb.Append(" ,[TradingSystemUseFee],[TradeCapitalAmount]=0.00,[ClearingFee],[HoldAccount],[CapitalAccount]");
            sb.Append(" ,[Code],[TradeTypeId],[TradeUnitId],[BuySellTypeId],[CurrencyTypeId],[TradeTime]  ");
            sb.Append("  from HK_HistoryTrade ");
            sb.AppendFormat(" where  TradeNumber in(select TradeNumber from dbo.HK_PushBackOrder where channelID='{0}')", channleID);
            HK_TodayTradeDal dal = new HK_TodayTradeDal();
            CommonDALOperate <HK_TodayTradeInfo> com = new CommonDALOperate <HK_TodayTradeInfo>();

            return(com.ExecuterReaderDataBind(sb.ToString(), dal.ReaderBind));
        }