view data/model.xml @ 2:035de8b7b18e

Temporary commit, refactoring, added readme
author cin
date Sun, 25 Feb 2018 17:12:33 +0300
parents 7f803979305f
children 437127ab6a12
line wrap: on
line source

<?xml version="1.0"?>
<package xmlns="http://implab.org/schemas/data-model.v1.xsd"
	xmlns:f="http://implab.org/schemas/data-model/geo.v1.xsd" xmlns:clr="http://implab.org/schemas/data-model/dotnet.v1.xsd"
	xmlns:sql="http://implab.org/schemas/data-model/sql.v1.xsd" xmlns:esri="http://geopallada.ru/schemas/data-model/esri.v1.xsd"
	name="poisk-more" version="1.0" clr:namespace="Pallada.PoiskMore.Model">

	<!-- Импортируем стандартные типы для строк, дат, чисел и т.п. -->
	<import href="types.xml" />
	<import href="rccs.xml" />

	<!-- определяем внешние типы, которые объявлены вне модели, но на них есть 
		ссылки в самой модели -->
	<type name="IncidentData">
		<clr:type name="IncidentData" namespace="Pallada.Exchange.Sar" />
	</type>

	<entity name="BaseEntity">
		<!-- <extends type="MaritimeRcc"/> -->
	</entity>

	<f:simpleFeature name="SarUnit">
		<description>Поисково-спасательная единица, характеризует
			судно,
			принимающее участие в ПСО
		</description>
		<f:geometry name="Location" type="Point">
			<description>Местоположение СРУ на момент начала ПСО</description>
			<esri:geometry name="Shape" type="esriGeometryPoint"
				mode="shape" />
		</f:geometry>
		<primaryKey name="Id" type="uuid" />
		<hasA name="Region" type="Region">
			<description>Район проведения операции, в котором будет работать
				данная единица.
			</description>
			<thisKey name="RegionId"/>
		</hasA>
		<hasA name="Operation" type="Operation" optional="true">
			<description>Идентификатор операции, используется для фильтрации
				объектов на карте.
			</description>
			<thisKey name="OperationId">
				<esri:field name="OperId" mode="shape" />
			</thisKey>
		</hasA>
		<property name="Departure" type="datetime">
			<description>Дата отправления из исходной точки</description>
		</property>
		<property name="EstimatedArrival" type="datetime">
			<description>Ожидаемое время прибытия в конечную точку</description>
			<esri:field name="Eta" mode="shape" />
		</property>
		<property name="CrewFactor" type="datetime">
			<description>Коэффициент усталости экипажа</description>
			<esri:field name="Fcrew" mode="shape" />
		</property>
	</f:simpleFeature>

	<entity name="Operation">
		<sql:table name="Operation" />
		<primaryKey name="Id" type="uuid" />
		<property name="Name" type="string">
			<clr:type ref="string" />
			<description>Название операции</description>
		</property>
		<hasA name="Case" type="SarCase" optional="true">
			<description>Дело, с которым связана операция</description>
			<thisKey name="CaseId" />
			<clr:lazy />
			<clr:association />
		</hasA>
		<property name="Closed" type="bool">
			<description>Признак того, что операция завершена, т.е. ее нельзя
				редактировать и она не отображается в списке операций
			</description>
		</property>
		<property name="Date" type="datetime">
			<description>Дата начала операции</description>
		</property>
		<hasMany name="Regions" type="Region">
			<description>Список районов поиска</description>
			<otherKey name="Operation" />
			<clr:association otherKey="OperationId"> <!-- explicit otherKey for code generation -->
				<clr:type ref="listOf">
					<clr:type ref="Region" />
				</clr:type>
			</clr:association>
		</hasMany>
		<property name="IncidentData" type="IncidentData">
			<description>Информация о происшествии на основании которой
				строилась
				данная операция
			</description>
			<sql:type name="text" />
			<xmlMember />
		</property>
		<hasA name="Coordinator" type="MaritimeRcc" nullable="true">
			<thisKey name="CoordinatorId" />
		</hasA>
		<hasMany name="PartnerLinks" type="OperationRccLink">
			<otherKey name="Operation"/>
		</hasMany>
	</entity>

	<entity name="SarCase">
		<description>Поисково-спасательное дело, собирает в себе информацию об
			операциях, аварийном случае, поступающих данных.</description>
		<sql:table name="SarCase" />
		<primaryKey name="Id" type="uuid" />
		<property name="CaseNo" type="string" sql:nullable="false">
			<description>Номер дела, которое объединяет несколько операций,
				номера дел должны быть уникальными и не пустыми.
			</description>
		</property>
		<hasMany name="Operations" type="Operation">
			<description>Операции выполненные в рамках текущего дела
			</description>
			<otherKey name="Case" />
			<clr:association>
				<clr:type>
					<arrayOf type="Operation"/>
				</clr:type>
			</clr:association>
		</hasMany>
	</entity>
	
	<entity name="Region">
		<description>Район проведение поисково-спасательной операции</description>
	</entity>
	
	<entity name="OperationRccLink">
		<!-- composite primary key -->
		<primaryKey name="Id">
			<!-- use existing members -->
			<member name="Operation"/>
			<member name="Rcc"/>
		</primaryKey>
		<hasA name="Operation" type="Operation">
			<thisKey name="OperationId"/>
		</hasA>
		<hasA name="Rcc">
			<thisKey name="RccId"/>
		</hasA>
		<hasMany name="Info" type="LinkInfo">
			<otherKey name="Link"/>
			<clr:association />
		</hasMany>
	</entity>
	
	<entity name="LinkInfo">
		<primaryKey name="Id">
			<member name="Link"/>
		</primaryKey>
		<hasA name="Link" type="OperationRccLink">
			<thisKey>
				<property name="OperationId"/>
				<property name="RccId"/>
			</thisKey>
			<clr:association />
		</hasA>
		<property name="description" type="string"/>
	</entity>

</package>