if exists(select 1 from sysobjects where name='pr_wxsf_write_paycompoundmode')
  drop procedure pr_wxsf_write_paycompoundmode
go


create procedure pr_wxsf_write_paycompoundmode(
	@orderno varchar(40),		--订单号
	@paymodename varchar(20),	--支付方式名称
	@paymode char(3),			--支付方式
	@amount numeric(16,4),		--金额
	@remark varchar(200)		--备注（券类支付此字段为券号）
)
as
begin
	if not rtrim(@paymode) in ('0','1','2','3','4','5')
	begin
		RAISERROR('支付方式不存在！',16,1)
		return
	end
	insert into t_wxsf_pay_list(orderno,paymodename,paymode,amount,remark)
	values(@orderno,@paymodename,case @paymode when '0' then 'RMB' when '1' then 'SAV' when '2' then 'UWX' when '3' then 'VIP' when '4' then 'SWX' when '5' then 'SHP' end,@amount,@remark)
end
