mirror of
https://github.com/bitwarden/server.git
synced 2024-12-24 17:17:40 +01:00
26 lines
685 B
MySQL
26 lines
685 B
MySQL
|
CREATE OR ALTER PROCEDURE [dbo].[Event_ReadPageByOrganizationIdServiceAccountId]
|
||
|
@OrganizationId UNIQUEIDENTIFIER,
|
||
|
@ServiceAccountId 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
|
||
|
AND [ServiceAccountId] = @ServiceAccountId
|
||
|
ORDER BY [Date] DESC
|
||
|
OFFSET 0 ROWS
|
||
|
FETCH NEXT @PageSize ROWS ONLY
|
||
|
END
|