
/****** Object:  View [dbo].[ApiTaskNotyficationInfos]    Script Date: 13.09.2021 15:05:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[ApiTaskNotyficationInfos] as 
SELECT  n.Id,  n.Status, n.OperatorId NotOpeId, h.Description, h.ObjectId, h.ObjectType, h.OperatorId, h.OperatorName, h.TaskId, h.TimeSpend,h.Distance, h.Value, h.geolat, h.geolong,h.TS , 
t.CustId, t.Priority, t. Title, t.Description TaskDescription, t.NumberString TaskNumber, t.Notes, t.PlanDateFrom, t.PlanDateTo,
t.StateId, t.ProductId, t.TypeId, t.CategoryId,t.OwnerId, t.VendorId, t.CustInfo
  FROM [dbo].[ApiTaskNotyfications] n 
  Join dbo.ApiTaskHistories h ON h.Id = n.HistoryId 
  JOIN dbo.ApiCrmTasks t ON h.TaskId = t.Id
GO


