mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
21 lines
499 B
MySQL
21 lines
499 B
MySQL
|
|
CREATE OR ALTER PROCEDURE [dbo].[SecurityTask_ReadByOrganizationIdStatus]
|
||
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
||
|
|
@Status TINYINT = NULL
|
||
|
|
AS
|
||
|
|
BEGIN
|
||
|
|
SET NOCOUNT ON
|
||
|
|
|
||
|
|
SELECT
|
||
|
|
ST.*
|
||
|
|
FROM
|
||
|
|
[dbo].[SecurityTaskView] ST
|
||
|
|
INNER JOIN
|
||
|
|
[dbo].[Organization] O ON O.[Id] = ST.[OrganizationId]
|
||
|
|
WHERE
|
||
|
|
ST.[OrganizationId] = @OrganizationId
|
||
|
|
AND O.[Enabled] = 1
|
||
|
|
AND ST.[Status] = COALESCE(@Status, ST.[Status])
|
||
|
|
ORDER BY ST.[CreationDate] DESC
|
||
|
|
END
|
||
|
|
GO
|