init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorsStreamOutputGet]
|
||||
@Id INT = null,
|
||||
@SerialNumber NVARCHAR (50) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF( @Id IS NULL)
|
||||
BEGIN
|
||||
IF NULLIF(@SerialNumber, '') IS NULL
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.StreamProfile, B.UDPAddress, B.TimeChannelId, B.DataChannelId, B.TmNSConfig, B.IRIGTimeDataPacketIntervalMs, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsStreamOutput] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='StreamOutput'
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.StreamProfile, B.UDPAddress, B.TimeChannelId, B.DataChannelId, B.TmNSConfig, B.IRIGTimeDataPacketIntervalMs, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsStreamOutput] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='StreamOutput' AND A.SerialNumber=@SerialNumber
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT A.id, A.SerialNumber, B.StreamProfile, B.UDPAddress, B.TimeChannelId, B.DataChannelId, B.TmNSConfig, B.IRIGTimeDataPacketIntervalMs, B.LastModified, B.LastModifiedBy, B.UserTags, B.Broken, B.DoNotUse FROM [dbo].[Sensors] AS A INNER JOIN [dbo].[SensorsStreamOutput] AS B ON A.id=B.SensorId INNER JOIN [dbo].SensorsType AS C ON A.SensorType=C.TypeId WHERE C.SensorType='StreamOutput' AND A.id=@Id
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,45 @@
|
||||
CREATE PROCEDURE [dbo].[sp_DASGet_100]
|
||||
@SerialNumber nvarchar(50) = null
|
||||
,@position nvarchar(10) = null
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT [DASId]
|
||||
,[SerialNumber]
|
||||
,[Type]
|
||||
,[MaxModules]
|
||||
,[MaxMemory]
|
||||
,[MaxSampleRate]
|
||||
,[MinSampleRate]
|
||||
,[FirmwareVersion]
|
||||
,[CalDate]
|
||||
,[ProtocolVersion]
|
||||
,[LastModified]
|
||||
,[LastModifiedBy]
|
||||
,[Version]
|
||||
,[LocalOnly]
|
||||
,[LastUsed]
|
||||
,[LastUsedBy]
|
||||
,[Connection]
|
||||
,[Channels]
|
||||
,[Position]
|
||||
,[ChannelTypes]
|
||||
,[Reprogramable]
|
||||
,[Reconfigurable]
|
||||
,[IsModule]
|
||||
,isnull([PositionOnDistributor], 0) as [PositionOnDistributor]
|
||||
,isnull([PositionOnChain], 0) as [PositionOnChain]
|
||||
,isnull([Port],0) as [Port]
|
||||
,isnull([ParentDAS], space(0)) as [ParentDAS],
|
||||
[FirstUseDate],
|
||||
[TestId],
|
||||
[GroupId],
|
||||
[StandIn],
|
||||
[MaxAAFRate]
|
||||
|
||||
FROM [dbo].[DAS] where
|
||||
(@SerialNumber is null or DASId = dbo.foo_IdGetDAS(@SerialNumber))
|
||||
and
|
||||
Position = case when @position is null then space(0) else @position end
|
||||
END
|
||||
Binary file not shown.
Reference in New Issue
Block a user