1
0
mirror of https://github.com/bitwarden/server synced 2026-01-07 02:53:38 +00:00

sql event repo "Get" implementations

This commit is contained in:
Kyle Spearrin
2017-12-18 23:15:16 -05:00
parent 6c30cfc295
commit d75ca51d75
8 changed files with 320 additions and 19 deletions

View File

@@ -0,0 +1,23 @@
CREATE PROCEDURE [dbo].[Event_ReadPageByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER,
@StartDate DATETIME2(7),
@EndDate DATETIME2(7),
@BeforeDate DATETIME2(7),
@PageSize INT
AS
BEGIN
SET NOCOUNT ON
SELECT
*
FROM
[dbo].[EventView]
WHERE
[Date] >= @StartDate
AND (@BeforeDate IS NOT NULL OR [Date] <= @EndDate)
AND (@BeforeDate IS NULL OR [Date] < @BeforeDate)
AND [OrganizationId] = @OrganizationId
ORDER BY [Date] DESC
OFFSET 0 ROWS
FETCH NEXT @PageSize ROWS ONLY
END