Knocks/BackEnd/Knoks.Operate/Stored Procedures/KST_GetKnoks.sql.orig

55 lines
1.3 KiB
MySQL

CREATE PROCEDURE [dbo].[KST_GetKnoks]
@KnokId bigint = null,
@ActiveOnly bit = 0,
@GreaterThanSignalId bigint = null
AS
SELECT KnokId
,[Currency1]
,[Currency2]
,[Currency]
,[ExchangeId]
,[TickerId]
,[CreatorUserId]
<<<<<<< HEAD
,[EntryPriceFrom]
,[EntryPriceTo]
,ExitPriceFrom
,ExitPriceTo
=======
,[EnterFromRate] AS EntryPriceFrom
,[EnterToRate] AS EntryPriceTo
,[ExitFromRate] AS ExitPriceFrom
,[ExitToRate] AS ExitPriceTo
>>>>>>> master
,[StopLoss]
,[HasTechnical]
,[Technical_Header]
,[Technical_Description]
,[Technical_References]
,[Technical_Image_Url]
,[Technical_Image_FileName]
,[HasFundamental]
,[Fundamental_Header]
,[Fundamental_Description]
,[Fundamental_References]
,[CreateDate]
,[PublishedDate]
,[Duration]
,[PotentialProfitValue]
,[PotentialProfit]
,[KnokStatusId]
,[SellFinishDate]
,[TargetDistance]
,[Price]
,[EntryPriceTouched]
,[ExitPriceTouched]
,[StopLossTouched]
,[Ranks]
,[HighRate]
,[LowRate]
FROM [dbo].[Signals]
WHERE KnokId = ISNULL(@KnokId, KnokId)
AND (@ActiveOnly = 0 OR [KnokStatusId] < 5) --not resolved
AND (@GreaterThanSignalId IS NULL OR KnokId > @GreaterThanSignalId)