IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_20_dolinkdata_1306]') AND type = 'P')
DROP PROCEDURE [dbo].[order_20_dolinkdata_1306]
GO
create procedure order_20_dolinkdata_1306(
@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

--- 下面这段程序，是完成帐务处理------
insert into mps_account_operation(accop_cmpid,accop_type,accop_category,accop_date,accop_objid,accop_fiid,accop_opdate,accop_operation,accop_value,accop_valuesuspend,accop_bizid,accop_no,accop_ordid,accop_jbid,accop_back) select 1,'staf','dpot',ord2_bznd,ord2_bgid,0,getdate(),0,ord2_jhbz*100,0*100,ord_bizid,ord_no,ord_id,@jbid,1 from order_20,order_20_2 where ord_id=@ordid  and ord2_ordid=ord_id 
--- 帐务处理完毕 ------

end