IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_alldepart_mnlevel]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_alldepart_mnlevel]
GO
CREATE procedure [dbo].[mps_g_alldepart_mnlevel](
@cmpid int   
)
as 
begin
  -- 返回部门岗位
  set nocount on
  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
  select distinct dp_dpstdid dp_id , dp_dpstdid , dp_depart,dp_fullname+'/'+mg_caption dp_fullname ,
  dp_level , dp_order ,mg_grade 
from mps_depart  with(nolock) ,  mps_manage_grade  with(nolock) 
where dp_cmpid=@cmpid and  dp_fullname>'' and dp_depart>''  and dp_isdepart=0 
order by dp_level , dp_order , mg_grade  
 
 
  set nocount off
end