IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_42_dolinkdata_1262]') AND type = 'P')
DROP PROCEDURE [dbo].[order_42_dolinkdata_1262]
GO
create procedure order_42_dolinkdata_1262(
@cmpid int ,
@useruid int ,
@bizid int ,
@ordbcid int,
@ordid bigint,
@jbid bigint,
@ftype varchar(10),
@fbizid int,
@fordid bigint,
@ford2tag int ,
@ford2id bigint,
@rtype varchar(10),
@rbizid int,
@rordid bigint,
@rord2tag int ,
@rord2id bigint 
) 
as 
begin



if (@ftype='biz' and @fbizid=40 and @ford2tag=0) 
update old set  old.ord_zzrq=new.ord_zzrq ,  old.ord_ycrq=new.ord_yzrq ,  old.ord_ycqx=new.ord_yzqx ,  old.ord_sylx=new.ord_sylx ,  old.ord_rzzx=new.ord_rzgs ,  old.ord_rztx=new.ord_rztx ,  old.ord_rzbm=new.ord_rzbm ,  old.ord_zzzb=new.ord_rzzb ,  old.ord_zw=new.ord_zw ,  old.ord_zhij=new.ord_zj ,  old.ord_ygzt='正式员工' ,  old.ord_xzdj=new.ord_zzhxzdj ,  old.ord_xcdj=new.ord_xcdj ,  old.ord_ksrq=new.ord_syq
from order_42 new ,order_40 old 
where  new.ord_id=@ordid 
 and old.ord_id=new.ord_fordid

--- 下面这段程序，是完成帐务处理------

--- 帐务处理完毕 ------

end