init
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
ALTER 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, CASE WHEN B.StreamProfile='UART_STREAM' THEN 'CH10_ANALOG_2HDR' ELSE B.StreamProfile END as [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, CASE WHEN B.StreamProfile='UART_STREAM' THEN 'CH10_ANALOG_2HDR' ELSE B.StreamProfile END as [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, CASE WHEN B.StreamProfile='UART_STREAM' THEN 'CH10_ANALOG_2HDR' ELSE B.StreamProfile END as [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
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
ALTER PROCEDURE [dbo].[sp_GroupsInsert]
|
||||
@SerialNumber NVARCHAR (255),
|
||||
@Picture NVARCHAR (255) = NULL,
|
||||
@DisplayName NVARCHAR (255),
|
||||
@Embedded BIT,
|
||||
@Description NVARCHAR (255),
|
||||
@LastModified DATETIME,
|
||||
@LastModifiedBy NVARCHAR (255),
|
||||
@StaticGroupId int = NULL,
|
||||
@ExtraProperties NVARCHAR (MAX),
|
||||
@errorNumber int OUTPUT,
|
||||
@errorMessage NVARCHAR (255) OUTPUT,
|
||||
@new_id int OUTPUT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
SET @errorNumber=0
|
||||
SET @errorMessage=''
|
||||
INSERT INTO Groups (SerialNumber, [Picture], DisplayName, [Description], Embedded, LastModified, LastModifiedBy, StaticGroupId, ExtraProperties)
|
||||
VALUES (@SerialNumber, @Picture, @DisplayName, @Description, @Embedded, @LastModified, @LastModifiedBy, @StaticGroupId, @ExtraProperties)
|
||||
|
||||
SET @new_id = scope_identity();
|
||||
IF(@@error != 0)
|
||||
BEGIN
|
||||
SET @errorNumber = error_number()
|
||||
SET @errorMessage = error_message()
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user