JSON Definitionen

Abfragen und Filter

declare namespace IduIT.Core.Mapping.MapServer.Iwan7
{
	namespace Query
	{
		namespace Filter
		{
			type EWKTString = string;

			type TFilterBehavior = "Default" | "Negate" | "CompareCollectionsWithAnd" | "CompareStringsCaseInSensitiv";

			type TOperator = "Equal" | "NotEqual" | "Greater" | "GreaterEqual" | "Less" | "LessEqual" | "Like" | "NotLike" | "In" | "NotIn" | "Between" | "IsNull" | "IsNotNull";

			type TGeomOperator = "BBoxCompare" | "DefaultRelateT8Stars" | "Intersects";

			interface ITimeValue
			{
				reference: Date | "PRESENT";
				period?: string;
			}
			/**
			 * Filter auf Attribute, ausgenommen Geometrie
			*/
			interface ISingleComparison
			{
				column: string;

				behavior?: TFilterBehavior;

				is: "Equal" | "NotEqual" | "Greater" | "GreaterEqual" | "Less" | "LessEqual" | "Like" | "NotLike" | "In" | "NotIn" | "Between" | "IsNull" | "IsNotNull";

				values: string[] | number[] | Date[] | null;
			}

			/**
			 * Spezialisierung einer ISingleComparison auf Zeit(Bereiche) 
			*/
			interface ISingleTimeComparison
			{
				column: string;

				behavior?: Exclude<TFilterBehavior, "CompareCollectionsWithAnd" | "CompareStringsCaseInSensitiv">;

				is: TOperator;

				values: ITimeValue[];
			}

			/**
			 * Filter auf Attribute vom Typ Geometrie
			*/
			interface ISingleGeomComparison
			{
				column: string;

				behavior?: Omit<TFilterBehavior, "CompareStringsCaseInSensitiv">;

				is: TGeomOperator;

				values: EWKTString[];
			}

			/**
			 * Sonderfall - FIlter auf einen SubLayer, bspw. für DXF Layer
			*/
			interface ISubLayerComparison
			{
				in: string[];
			}

			/**
			 * AND
			*/
			interface ICombinedComparisonAndType extends Array<IFilter>
			{

			}

			/**
			 * NOT AND
			*/
			interface ICombinedComparisonNotAndType extends Array<IFilter>
			{

			}

			/**
			 * OR
			*/
			interface ICombinedComparisonOrType extends Array<IFilter>
			{

			}

			/**
			 * NOT OR
			*/
			interface ICombinedComparisonNotOrType extends Array<IFilter>
			{

			}

			interface IFilter
			{
				and?: ICombinedComparisonAndType;
				notAnd?: ICombinedComparisonNotAndType;
				or?: ICombinedComparisonOrType;
				notOr?: ICombinedComparisonNotOrType;
				where?: ISingleComparison;
				whereTime?: ISingleTimeComparison;
				whereGeom?: ISingleGeomComparison;
				whereSubLayer?: ISubLayerComparison;
			}
			
		}

		interface IConstructedQuery
		{
			/**
			 * Spaltennamen
			*/
			columns?: string[] | null;

			/**
			 * Limit, positive Ganzzahl
			*/
			limit?: number;

			/**
			 * Offset, positive Ganzzahl
			*/
			offset?: number;

			/**
			 * Filter
			*/
			filter?: Filter.IFilter | null;

			/**
			 * Optional statt Filter als JSON hier die einfache Form, siehe "Filter"
			*/
			filterExpression?: string;
		}
	}
}

Zuletzt geändert: 10.07.2024 17:05:03 (erstmals erstellt 21.01.2024)