IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[ryxx]') AND type = 'V')
DROP VIEW [dbo].[ryxx]
GO
create  view  ryxx as (
   select   ord_wpdp,ord_spwpry,ord_xm,ord_gh,cu_id,cu_dpid,cu_bcid,cu_depart  from   order_40 a,mps_employee  b 
   
    where a.ord_gh = b.cu_account  and  ord_zzzk !='离职'  and cu_status  != '离职')