예제 #1
0
        private static string GetMainTableQueryStr(MDModel_QueryModel _qv, MDCompare_Request compareRequest)
        {
            MDQuery_Request _queryRequest       = compareRequest as MDQuery_Request;
            List <string>   _QueryUsedTableList = OraQueryBuilder.GetQueryUsedTable(_qv, _queryRequest);
            string          _conditionRes       = CreateConditionStringByMainID(_qv);
            string          _tableStr           = OraQueryBuilder.CreateTableString(_qv, _QueryUsedTableList);
            string          _tableRelationStr   = OraQueryBuilder.CreateTableRelationString(_qv, _QueryUsedTableList);
            string          _displayStr         = OraQueryBuilder.CreateDisplayString(_qv, compareRequest.MainResultTable);

            return(string.Format("select distinct {0} from {1},COMP_TEMP where ( {2} ({3})) ", _displayStr, _tableStr, _tableRelationStr, _conditionRes));
        }
예제 #2
0
        private static string GetQueryStrByMainID(MDModel_QueryModel _qv, MDQuery_ResultTable _qrc)
        {
            List <string> _usedTables = new List <string>();

            _usedTables.Add(_qv.MainTable.TableName);
            _usedTables.Add(_qrc.TableName);
            string _displayStr       = OraQueryBuilder.CreateDisplayString(_qv, _qrc);
            string _conditionRes     = CreateConditionStringByMainID(_qv);
            string _tableStr         = OraQueryBuilder.CreateTableString(_qv, _usedTables);
            string _tableRelationStr = OraQueryBuilder.CreateTableRelationString(_qv, _usedTables);

            return(string.Format("select {0} from {1} where ( {2} ({3})) ",
                                 _displayStr, _tableStr, _tableRelationStr, _conditionRes));
        }
예제 #3
0
        private static string CreateCompareStr(MDModel_QueryModel _qv, MDCompare_Request compareRequest)
        {
            string          _res                 = "";
            MDQuery_Request _queryRequest        = compareRequest as MDQuery_Request;
            List <string>   CompareUsedTableList = GetAllCompareUsedTables(_qv, compareRequest);

            string _whereStr         = CreateCompareWhereStr(_qv, compareRequest);
            string _displayStr       = CreateCompareMainKeyString(_qv, compareRequest);
            string _tableStr         = CreateCompareTableString(_qv, CompareUsedTableList);
            string _tableRelationStr = OraQueryBuilder.CreateTableRelationString(_qv, CompareUsedTableList);

            _res = string.Format("select DISTINCT {0} from {1} where  {2} ({3}) ", _displayStr, _tableStr, _tableRelationStr, _whereStr);


            return(_res);
        }
예제 #4
0
        private static string CreateFilterStr(MDModel_QueryModel _qv, MDCompare_Request compareRequest)
        {
            string _res = "";

            MDQuery_Request _queryRequest       = compareRequest as MDQuery_Request;
            List <string>   _QueryUsedTableList = OraQueryBuilder.GetQueryUsedTable(_qv, _queryRequest);
            string          _filterStr          = OraQueryBuilder.CreateDataFilterStr(_qv);
            string          _conditionStr       = OraQueryBuilder.CreateConditionString(_qv, _queryRequest);
            string          _tableStr           = OraQueryBuilder.CreateTableString(_qv, _QueryUsedTableList);
            string          _tableRelationStr   = OraQueryBuilder.CreateTableRelationString(_qv, _QueryUsedTableList);
            string          _displayStr         = string.Format("{0}.{1} MAINID", _qv.MainTable.TableName, _qv.MainTable.TableDefine.Table.MainKey);

            _res = string.Format("select DISTINCT {0} from {1} where {4} ( {2} ({3})) ", _displayStr, _tableStr, _tableRelationStr, _conditionStr, _filterStr);

            return(_res);
        }