USE DAGAZ	
	IF OBJECT_ID('NET_SEL_PARTVOO') IS NOT NULL
		DROP PROC NET_SEL_PARTVOO

	GO
		CREATE PROC NET_SEL_PARTVOO
	(
			   @pCodParticipanteVoo  INT = NULL
			  ,@pEticket	varchar(255) = NULL
			  ,@pCodVoo  INT = NULL
			  ,@pCodParticipante INT = NULL
			  ,@pStatus INT = NULL
			  ,@pOrder VARCHAR(50) =  NULL 
	)
	AS 
		
		BEGIN
			SET NOCOUNT ON
			
					SELECT 
									 CodParticipanteVoo  
									 CodParticipante
									,CodVoo
									,Eticket
									,Loc
									,Status
									,CodUsuario
									,DataCadastro
		FROM 
						NET_PARTICIPANTE_VOO
WHERE     
					((CodParticipanteVoo= @pCodParticipanteVoo) Or (@pCodParticipanteVoo IS NULL OR @pCodParticipanteVoo  = 0))
			And  ((CodVoo= @pCodVoo) Or (@pCodVoo IS NULL OR @pCodVoo  = 0))
			And  ((CodParticipante= @pCodParticipante) Or (@pCodParticipante IS NULL OR @pCodParticipante = 0))
			And  ((@pEticket  Like  @pEticket + '%' ) Or (@pEticket IS NULL OR @pEticket  = ''))
			And ((Status = @pStatus) Or (@pStatus IS NULL OR @pStatus  = 3))
			

	SET NOCOUNT OFF 
	END 

