DECLARE @Service_Id INT
SET @Service_Id = 2
SELECT TOP 1000 service_id,* FROM dbo.MgtRpt_Inspected_Order
WHERE 1=1
AND CASE WHEN @Service_Id=-1 THEN -1 ELSE Service_Id END = @Service_Id
ORDER BY tran_ser_id DESC