/// <summary>
        /// 删除一个架次相关记录,这是记录,需要重新定位数据库和Collection
        /// </summary>
        /// <param name="mongoServer"></param>
        /// <param name="flight"></param>
        private void RemoveRelatedRecords(MongoServer mongoServer, Flight flight, AircraftMongoDbDal dal,
            IMongoQuery flightIdQuery)
        {//TODO: 
            try
            {//此方法操作的记录为跟架次密切相关,需要拆分存储的记录,最好在DAL里面去处理表名构建逻辑
                MongoDatabase database = dal.GetMongoDatabaseByAircraftModel(mongoServer, flight.Aircraft.AircraftModel);
                if (database != null)
                {
                    //删除判据记录
                    MongoCollection<FlightDataEntities.Decisions.DecisionRecord> modelCollection
                        = dal.GetDecisionRecordMongoCollectionByFlight(database, flight);
                    modelCollection.Remove(flightIdQuery);

                    //删除Level1记录
                    MongoCollection<FlightDataEntities.Level1FlightRecord> modelCollection1
                        = dal.GetLevel1FlightRecordMongoCollectionByFlight(database, flight);
                    modelCollection1.Remove(flightIdQuery);

                    //删除LevelTop记录
                    MongoCollection<FlightDataEntities.LevelTopFlightRecord> modelCollection2
                        = dal.GetLevelTopFlightRecordMongoCollectionByFlight(database, flight);
                    modelCollection2.Remove(flightIdQuery);

                    //删除FlightRawDataRelationPoint记录
                    MongoCollection<FlightDataEntities.FlightRawDataRelationPoint> modelCollection3
                        = dal.GetFlightRawDataRelationPointMongoCollectionByFlight(database, flight);
                    modelCollection3.Remove(flightIdQuery);

                    //删除FlightConditionDecisionRecord记录
                    MongoCollection<FlightDataEntities.Decisions.DecisionRecord> modelCollection4
                        = dal.GetFlightConditionDecisionRecordMongoCollectionByFlight(database, flight);
                    modelCollection4.Remove(flightIdQuery);

                    //删除FlightRawDataRelationPoint记录
                    MongoCollection<FlightDataEntities.ExtremumPointInfo> modelCollection5
                        = dal.GetFlightExtremeMongoCollectionByFlight(database, flight);
                    modelCollection5.Remove(flightIdQuery);

                    //删除FlightExtreme记录
                    MongoCollection<FlightDataEntities.ExtremumPointInfo> modelCollection6
                        = dal.GetFlightExtremeMongoCollectionByFlight(database, flight);
                    modelCollection6.Remove(flightIdQuery);
                }
            }
            catch (Exception e)
            {
                LogHelper.Error("RemoveRelatedRecords", e);
            }
        }
        internal string AddOrReplaceFlightExtreme(Flight flight, ExtremumPointInfo[] extremumPointInfo)
        {
            using (AircraftMongoDbDal dal = new AircraftMongoDbDal())
            {
                MongoServer mongoServer = dal.GetMongoServer();
                //不用判断是否为空,必须不能为空才能继续,否则内部要抛异常
                try
                {//此方法操作的记录为跟架次密切相关,但肯定LevelTopRecord需要包含趋势分析等信息,
                    //建议不要分表,存放在Common里面
                    MongoDatabase database = dal.GetMongoDatabaseByAircraftModel(mongoServer, flight.Aircraft.AircraftModel);
                    if (database != null)
                    {
                        MongoCollection<FlightDataEntities.ExtremumPointInfo> modelCollection1
                            = dal.GetFlightExtremeMongoCollectionByFlight(database, flight);

                        IMongoQuery q1 = Query.EQ("FlightID", new MongoDB.Bson.BsonString(flight.FlightID));
                        modelCollection1.Remove(q1);

                        modelCollection1.InsertBatch(extremumPointInfo);
                    }
                }
                catch (Exception e)
                {
                    LogHelper.Error("AddOrReplaceFlightExtreme", e);
                    return e.Message;
                }
            }
            return string.Empty;
        }
        internal ExtremumPointInfo[] GetExtremumPointInfos(AircraftInstance aircraftInstance)
        {
            if (aircraftInstance == null || string.IsNullOrEmpty(aircraftInstance.AircraftNumber))
            {
                LogHelper.Warn("aircraftInstance为空或AircraftNumber为空(GetExtremumPointInfos)。", null);
                return null;
            }

            using (AircraftMongoDbDal dal = new AircraftMongoDbDal())
            {
                MongoServer mongoServer = dal.GetMongoServer();
                //不用判断是否为空,必须不能为空才能继续,否则内部要抛异常
                try
                {//此方法操作的记录为跟架次密切相关,需要拆分存储的记录,最好在DAL里面去处理表名构建逻辑
                    MongoDatabase database =
                        dal.GetMongoDatabaseByAircraftModel(mongoServer,
                        aircraftInstance.AircraftModel);
                    if (database != null)
                    {
                        MongoCollection<FlightDataEntities.ExtremumPointInfo> modelCollection
                            = dal.GetFlightExtremeMongoCollectionByFlight(database, null);

                        List<IMongoQuery> qs = new List<IMongoQuery>();
                        IMongoQuery q1 = Query.EQ("AircraftNumber", aircraftInstance.AircraftNumber);
                        var cursor = modelCollection.Find(q1);
                        var result = cursor.AsQueryable();
                        return result.ToArray();
                    }
                }
                catch (Exception e)
                {
                    LogHelper.Error("GetFlightRawDataRelationPoints", e);
                }
            }
            return null;
        }