コード例 #1
0
ファイル: DALRecordInfo.cs プロジェクト: chenmj201601/UMP
        /// <summary>
        ///  以本地时间查询录音表的数据
        /// </summary>
        /// <param name="ADataBaseConfig"></param>
        /// <param name="AObjectInfo"></param>
        /// <param name="AGlobalSetting"></param>
        /// <param name="ADateTimeStart"></param>
        /// <param name="ADateTimeStop"></param>
        /// <param name="AFuncType"></param>
        /// <param name="AExtensionAgentType"></param>
        /// <returns></returns>
        public static long GetAllRecordStatisticsInfo(DataBaseConfig ADataBaseConfig, ObjectInfo AObjectInfo, GlobalSetting AGlobalSetting, DateTime ADateTimeStart, DateTime ADateTimeStop, int AFuncType)
        {
            long      Value01          = 0;
            DataTable LDataTableReturn = new DataTable();
            string    LStrDynamicSQL   = string.Empty;
            string    LStrRentToken    = string.Empty;
            string    LStrSingleObject = string.Empty;



            //根据座席和分机和真实分机查询相应  功能的值
            string   TableName = string.Empty;
            DateTime utcTime   = ADateTimeStart.ToUniversalTime();

            if (AGlobalSetting.IlogicPartMark == 1)//为1按月分表
            {
                TableName = string.Format("T_21_001_{0}_{1}{2}", AGlobalSetting.StrRent, utcTime.ToString("yy"), utcTime.ToString("MM"));
                if (!AGlobalSetting.LStrRecordName.Contains(TableName))
                {
                    return(0);
                }
            }
            else
            {
                TableName = string.Format("T_21_001_{0}", AGlobalSetting.StrRent);
            }


            try
            {
                DatabaseOperation01Return LDatabaseOperationReturn = new DatabaseOperation01Return();
                DataOperations01          LDataOperations          = new DataOperations01();
                switch (AFuncType)
                {
                case 1:     //RecordLength
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C042='{1}' AND C020='{4}'  ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C058='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C042='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C012) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C058='{1}'  AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                }
                break;

                case 2:    //RecordNumber
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C042='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C059='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C042='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT COUNT(C001) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C058='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                }
                break;

                case 3:     //RingTime
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C042='{1}' AND C020='{4}'  ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C058='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C042='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C061) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C058='{1}'  AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                }
                break;

                case 4:    //holdTime
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C042='{1}' AND C020='{4}'  ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>='{2}' AND C004<'{3}' AND C058='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C042='{1}' AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C039='{1}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop);
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                            LStrDynamicSQL = string.Format("SELECT SUM(C060) AS VALUE01 FROM {0} WHERE C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND C058='{1}'  AND C020='{4}' ", TableName, AObjectInfo.ObjName, ADateTimeStart, ADateTimeStop, AObjectInfo.ExtensionIP);
                        }
                    }
                }
                break;

                case 5:
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                        }
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        if (AObjectInfo.ObjType == 2)         //分机
                        {
                        }
                        else if (AObjectInfo.ObjType == 1)         //座席
                        {
                        }
                        else if (AObjectInfo.ObjType == 4)         //真实分机
                        {
                        }
                    }
                }
                break;

                default:
                    break;
                }
                LDatabaseOperationReturn = LDataOperations.SelectDataByDynamicSQL(ADataBaseConfig.IntDatabaseType, ADataBaseConfig.StrDatabaseProfile, LStrDynamicSQL);
                if (!LDatabaseOperationReturn.BoolReturn)
                {
                    LDataTableReturn = null;
                }
                else
                {
                    LDataTableReturn = LDatabaseOperationReturn.DataSetReturn.Tables[0];
                    foreach (DataRow LDataRowSingleRow in LDataTableReturn.Rows)
                    {
                        //Value01 += LongParse(LDataRowSingleRow["VALUE01"].ToString(), 0);
                        //扩大1000倍
                        Value01 += Convert.ToInt64(DoubleParse(LDataRowSingleRow["VALUE01"].ToString(), 0) * 1000);
                    }
                }
            }
            catch (Exception ex)
            {
                LDataTableReturn = null;
                FileLog.WriteInfo("GetAllRecordStatisticsInfo()", ex.Message);
            }
            return(Value01);
        }
コード例 #2
0
ファイル: DALQMInfo.cs プロジェクト: chenmj201601/UMP
        public static long GetQMDayStatisticsInfo(DataBaseConfig ADataBaseConfig, ObjectInfo AObjectInfo, GlobalSetting AGlobalSetting,
                                                  DateTime ADateTimeStart, DateTime ADateTimeStop, int AFuncType, int AExtensionAgentType)
        {
            long      Value01          = 0;
            DataTable LDataTableReturn = new DataTable();
            string    LStrDynamicSQL   = string.Empty;
            string    LStrRentToken    = string.Empty;
            string    LStrSingleObject = string.Empty;

            //根据座席和分机和真实分机查询相应  功能的值
            string   TableName21  = string.Empty;
            string   TableName38  = string.Format("T_31_008_{0}", AGlobalSetting.StrRent);
            string   TableName319 = string.Format("T_31_019_{0}", AGlobalSetting.StrRent);
            string   TableName320 = string.Format("T_31_020_{0}", AGlobalSetting.StrRent);
            string   TableName321 = string.Format("T_31_021_{0}", AGlobalSetting.StrRent);
            DateTime utcTimeStart = ADateTimeStart.ToUniversalTime();
            DateTime utcTimeEnd   = ADateTimeStop.ToUniversalTime();

            if (AGlobalSetting.IlogicPartMark == 1)//为1按月分表
            {
                TableName21 = string.Format("T_21_001_{0}_{1}{2}", AGlobalSetting.StrRent, utcTimeStart.ToString("yy"), utcTimeStart.ToString("MM"));
                if (!AGlobalSetting.LStrRecordName.Contains(TableName21))
                {
                    return(0);
                }
            }
            else
            {
                TableName21 = string.Format("T_21_001_{0}", AGlobalSetting.StrRent);
            }

            try {
                DatabaseOperation01Return LDatabaseOperationReturn = new DatabaseOperation01Return();
                DataOperations01          LDataOperations          = new DataOperations01();
                switch (AFuncType)
                {
                case 1:     //ScoreNumber 获取评分数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T38,{1} T21 WHERE T38.C002=T21.C002 AND T21.C004>='{2}' AND T21.C004<'{3}' AND T38.C013={4}", TableName38, TableName21, ADateTimeStart, ADateTimeStop, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T38,{1} T21 WHERE T38.C002=T21.C002 AND T21.C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND T21.C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND T38.C013={4}", TableName38, TableName21, ADateTimeStart, ADateTimeStop, AObjectInfo.ObjID);
                    }
                }
                break;

                case 2:    //坐席\分机申述数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C012>='{1}' AND C012<'{2}' AND C004={3} AND C008=1", TableName319, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C012>=TO_DATE ('{1}','YYYY-MM-DD HH24:MI:SS') AND C012<TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004={3} AND C008=1", TableName319, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                case 3:    //坐席\分机重新打分的数量(申诉成功并重新打分)
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C012>='{1}' AND C012<'{2}' AND C004={3} AND C008=6", TableName319, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C012>=TO_DATE ('{1}','YYYY-MM-DD HH24:MI:SS') AND C012<TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C004={3} AND C008=6", TableName319, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                case 4:    //坐席\分机坐席被质检的总分数
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT SUM(T38.C004) AS VALUE01 FROM {0} T38,{1} T21 WHERE T38.C002=T21.C002 AND T21.C004>='{2}' AND T21.C004<'{3}' AND T38.C013={4}", TableName38, TableName21, ADateTimeStart, ADateTimeStop, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT SUM(T38.C004) AS VALUE01 FROM {0} T38,{1} T21 WHERE T38.C002=T21.C002 AND T21.C004>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND T21.C004<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND T38.C013={4}", TableName38, TableName21, ADateTimeStart, ADateTimeStop, AObjectInfo.ObjID);
                    }
                }
                break;

                case 5:    //质检员被申述的数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T319,{1} T308 WHERE T319.C002 = T308.C001 AND T319.C012>='{2}' AND T319.C012<'{3}' AND T319.C0008=1 AND T308.C005={4}", TableName319, TableName38, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T319,{1} T308 WHERE T319.C002 = T308.C001 AND T319.C012>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND T319.C012<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND T319.C0008=1 AND T308.C005={4}", TableName319, TableName38, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                case 6:    //质检员质检的数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C006>='{1}' AND C006<'{2}' AND C005={3}", TableName38, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} WHERE C006>=TO_DATE ('{1}','YYYY-MM-DD HH24:MI:SS') AND C006<TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND C005={3}", TableName38, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                case 7:    //质检员完成的任务数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T20,{1} T21 WHERE T20.C001=T21.C001 AND T20.C018>='{2}' AND T20.C018<'{3}' AND T21.C002={4} AND T20.C017='Y'", TableName320, TableName321, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T20,{1} T21 WHERE T20.C001=T21.C001 AND T20.C018>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND T20.C018<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND T21.C002={4} T20.C017='Y'", TableName320, TableName321, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                case 8:    //质检员接到的任务数量
                {
                    if (ADataBaseConfig.IntDatabaseType == 2)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T20,{1} T21 WHERE T20.C001=T21.C001 AND T20.C006>='{2}' AND T20.C006<'{3}' AND T21.C002={4}", TableName320, TableName321, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                    else if (ADataBaseConfig.IntDatabaseType == 3)
                    {
                        LStrDynamicSQL = string.Format("SELECT COUNT(1) AS VALUE01 FROM {0} T20,{1} T21 WHERE T20.C001=T21.C001 AND T20.C006>=TO_DATE ('{2}','YYYY-MM-DD HH24:MI:SS') AND T20.C006<TO_DATE ('{3}','YYYY-MM-DD HH24:MI:SS') AND T21.C002={4}", TableName320, TableName321, utcTimeStart, utcTimeEnd, AObjectInfo.ObjID);
                    }
                }
                break;

                default:
                    break;
                }
                LDatabaseOperationReturn = LDataOperations.SelectDataByDynamicSQL(ADataBaseConfig.IntDatabaseType, ADataBaseConfig.StrDatabaseProfile, LStrDynamicSQL);
                if (!LDatabaseOperationReturn.BoolReturn)
                {
                    LDataTableReturn = null;
                }
                else
                {
                    LDataTableReturn = LDatabaseOperationReturn.DataSetReturn.Tables[0];
                    foreach (DataRow LDataRowSingleRow in LDataTableReturn.Rows)
                    {
                        Value01 += Convert.ToInt64(DoubleParse(LDataRowSingleRow["VALUE01"].ToString(), 0) * 1000);
                    }
                }
            }
            catch (Exception ex)
            {
                LDataTableReturn = null;
                FileLog.WriteInfo("GetQMDayStatisticsInfo()", ex.Message);
            }
            return(Value01);
        }
コード例 #3
0
ファイル: DALExtensionInfo.cs プロジェクト: chenmj201601/UMP
        /// <summary>
        /// 得到所有座席信息
        /// </summary>
        /// <param name="AListAgentInfo"></param>
        /// <param name="AStrRent"></param>
        public static void GetAllExtensionInfo(DataBaseConfig ADataBaseConfig, ref List <ObjectInfo> AListExtensionInfo, GlobalSetting AGlobalSetting)
        {
            AListExtensionInfo.Clear();
            DataTable LDataTableReturn = new DataTable();
            string    LStrDynamicSQL   = string.Empty;
            string    LStrRentToken    = string.Empty;
            string    LStrSingleObject = string.Empty;

            try
            {
                DatabaseOperation01Return LDatabaseOperationReturn = new DatabaseOperation01Return();
                DataOperations01          LDataOperations          = new DataOperations01();
                if (AGlobalSetting.StrConfigAER.Equals("R"))//真实分机
                {
                    LStrDynamicSQL = string.Format("SELECT * FROM T_11_101_{0} WHERE C001 >= 1050000000000000000 AND C001 < 1060000000000000000 AND C002=1  AND C012='1' "
                                                   , AGlobalSetting.StrRent);
                }
                else
                {
                    LStrDynamicSQL = string.Format("SELECT * FROM T_11_101_{0} WHERE C001 >= 1040000000000000000 AND C001 < 1050000000000000000 AND C002=1  AND C012='1' "
                                                   , AGlobalSetting.StrRent);
                }

                LDatabaseOperationReturn = LDataOperations.SelectDataByDynamicSQL(ADataBaseConfig.IntDatabaseType, ADataBaseConfig.StrDatabaseProfile, LStrDynamicSQL);
                if (!LDatabaseOperationReturn.BoolReturn)
                {
                    LDataTableReturn = null;
                }
                else
                {
                    LDataTableReturn = LDatabaseOperationReturn.DataSetReturn.Tables[0];
                    foreach (DataRow LDataRowSingleRow in LDataTableReturn.Rows)
                    {
                        ObjectInfo agentInfoTemp = new ObjectInfo();
                        agentInfoTemp.ObjID       = LongParse(LDataRowSingleRow["C001"].ToString(), 0);
                        agentInfoTemp.BeyondOrgID = LongParse(LDataRowSingleRow["C011"].ToString(), 0);
                        if (agentInfoTemp.ObjID >= CombinSourceCode(StatisticsConstDefine.Const_Source_Extension_Begin) && agentInfoTemp.ObjID < CombinSourceCode(StatisticsConstDefine.Const_Source_TrueExtension_Begin))
                        {
                            agentInfoTemp.ObjType = 2;
                        }
                        else if (agentInfoTemp.ObjID >= CombinSourceCode(StatisticsConstDefine.Const_Source_TrueExtension_Begin) && agentInfoTemp.ObjID < CombinSourceCode(StatisticsConstDefine.Const_Source_Role_Begin))
                        {
                            agentInfoTemp.ObjType = 4;
                        }

                        string ExtAndIP = string.Empty;
                        ExtAndIP = EncryptionAndDecryption.EncryptDecryptString(LDataRowSingleRow["C017"].ToString(), IStrVerificationCode102, EncryptionAndDecryption.UMPKeyAndIVType.M102);
                        if (ExtAndIP != null && ExtAndIP.Length > 0)
                        {
                            string[] Values = ExtAndIP.Split(IStrSpliterChar.ToArray());
                            if (Values.Length > 1)
                            {
                                agentInfoTemp.ObjName     = Values[0].ToString();
                                agentInfoTemp.ExtensionIP = Values[1].ToString();
                            }
                        }
                        AListExtensionInfo.Add(agentInfoTemp);
                    }
                }
            }
            catch (Exception ex)
            {
                LDataTableReturn = null;
                FileLog.WriteInfo("GetAllExtensionInfo()", ex.Message);
            }
        }