mysql存储过程转账_mysql中用存储过程实现转账过程

/*

一、

1、编写存储过程实现转账过程

2、提示:

(1)涉及t_user、t_account表,新建t_transfer_log表

(2)转账金额小于100,不收手续费,在100-1000范围收取0.1%的手续费,在1000-5000收取0.3%手续费,在5000-10000收取0.5%,大于10000收取1%手续费,封顶50块。

(3)记录转账日志

*/

# 新建t_transfer_log表

create table t_transfer_log(

transfer_id int(11) primary key auto_increment comment '转账编号',

sender_id int(11) not null comment '转出人编号',

receiver_id int(11) not null comment '收款人编号',

amount double(11,2) not null default 0.00 comment '转账金额',

fee double(11,2) not null default 0.00 comment '手续费',

status char(1) not null default '0' comment '转账状态:0-开始转账;1-转账中;2-转账成功;3-转账失败',

transfer_date datetime not null default current_timestamp comment '转账时间',

update_date dat

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值