--USE e-dagaz1
	IF OBJECT_ID('NET_SEL_TIME') IS NOT NULL
		DROP PROC NET_SEL_TIME

	GO
		CREATE PROC NET_SEL_TIME
	(
			  @pCodTime INT = NULL
			,@pTitulo VARCHAR(255) =  NULL 
			,@pStatus INT = NULL
			  ,@pOrder VARCHAR(50) =  NULL 
	)
	AS 
		
		BEGIN
			SET NOCOUNT ON
			
					SELECT 
								 CodTime
								,Titulo
								,Status
								,CodUsuario
								,DataCadastro
		FROM 
						NET_TIME
WHERE     
					((CodTime = @pCodTime) Or (@pCodTime IS NULL OR @pCodTime  = 0))
			And  ((Titulo  Like  @pTitulo + '%' ) Or (@pTitulo IS NULL OR @pTitulo  = ''))
			And ((Status = @pStatus) Or (@pStatus IS NULL OR @pStatus  = 3))
			

	SET NOCOUNT OFF 
	END 

