Пример #1
0
        /// <summary>
        /// 得到sql与或门条件
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        internal virtual string GetSqlSign(AndOrQueryFilter filter)
        {
            StringBuilder builder = new StringBuilder();
            int           index   = 0;

            builder.Append(" ( ");
            foreach (var item in filter.Filters)
            {
                if (index != 0)
                {
                    builder.Append(" " + filter.FilterAndOrType.ToString() + " ");
                }
                string str = string.Empty;
                if (item is QueryFilter)
                {
                    str = GetSqlSign(item as QueryFilter);
                }
                if (item is SpatialQueryFilter)
                {
                    str = GetSqlSign(item as SpatialQueryFilter);
                }
                if (item is AndOrQueryFilter)
                {
                    str = GetSqlSign(item as AndOrQueryFilter);
                }
                builder.Append(str);
                index++;
            }
            builder.Append(" ) ");
            return(builder.ToString());
        }
Пример #2
0
        public QueryFilterBase ToFilters()
        {
            var fitler = new AndOrQueryFilter()
            {
                FilterAndOrType = FilterAndOrType, Filters = Filters
            };

            return(fitler);
        }