mirror of
https://github.com/bitwarden/server
synced 2025-12-28 14:13:48 +00:00
23 lines
571 B
Transact-SQL
23 lines
571 B
Transact-SQL
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 |