自动取款机基本功能:可以存取转账,刷卡信息查询,银行卡号历史信息查询,消费记录查询,修改密码。
思维导图如下:
数据库设计:
mysql> desc balan_list; #保存账号交易记录option_type
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| card_name | varchar(50) | YES | | NULL | |
| balance | int(11) | YES | | NULL | |
| option_type | varchar(30) | YES | | NULL | |
| pay_cash | int(11) | YES | | NULL | |
| option_time | varchar(50) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.02 sec)
mysql> desc hist_list;#刷卡消费记录
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| order_num | int(11) | YES | | NULL | |
| order_name | varchar(50) | YES | | NULL | |
| order_price | int(11) | YES | | NULL | |
| order_user | varchar(50) | YES | | NULL | |
| order_time | datetime | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
5 rows in set (0.00 sec)
mysql> desc order_list;#商品列表
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| order_id | int(11) | YES | | NULL | |
| order_name | varchar(20) | YES | | NULL | |
| order_price | int(11) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
mysql> select * from user_account; #账号信息表
+-----------+--------+---------+--------------+----------+-------------+
| card_name | passwd | balance | option_type | pay_cash | option_time |
+-----------+--------+---------+--------------+----------+-------------+
| 9995501 | 000000 | 100772 | 1 | 100000 | NULL |
| 9995502 | 111111 | 9812 | 2 | 1000 | NULL |
| 9995503 | 222222 | 15000 | 2 | 0 | NULL |
| 9995504 | 333333 | 16000 | 1 | 1000 | NULL |
+-----------+--------+---------+--------------+----------+-------------+
4 rows in set (0.00 sec)
mysql> desc lock_account;锁账号的表+-------+------------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+-------+------------------+------+-----+---------+----------------+| id | int(10) unsigned | NO | PRI | NULL | auto_increment || name | varchar(45) | NO | | | |+-------+------------------+------+-----+---------+----------------+2 rows in set (0.00 sec)