模拟ATM

模拟ATM登录注册界面

模拟ATMmysql数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '超级管理员账号',
	password varchar(100) comment '超级管理员密码'
) comment '超级管理员';
insert into t_admin(username,password) values('admin','123456');

ATM机器表创建语句如下:


create table t_atm(
	id int primary key auto_increment comment '主键',
	atmNum varchar(100) comment 'ATM编号',
	je int comment '金额'
) comment 'ATM机器';

银行卡表创建语句如下:


create table t_card(
	id int primary key auto_increment comment '主键',
	customerId int comment '用户',
	cardid varchar(100) comment '卡号',
	ye int comment '余额'
) comment '银行卡';

用户表创建语句如下:


create table t_customer(
	id int primary key auto_increment comment '主键',
	username varchar(100) comment '账号',
	password varchar(100) comment '密码',
	customerName varchar(100) comment '姓名',
	headPic varchar(100) comment '头像',
	sex varchar(100) comment '性别',
	age varchar(100) comment '年龄',
	phone varchar(100) comment '电话',
	idcard varchar(100) comment '身份证'
) comment '用户';

操作记录表创建语句如下:


create table t_runlog(
	id int primary key auto_increment comment '主键',
	types varchar(100) comment '操作类型',
	atmNum varchar(100) comment 'ATM',
	card1 varchar(100) comment '主卡',
	card2 varchar(100) comment '对方卡',
	je int comment '金额',
	insertDate datetime comment '操作日期'
) comment '操作记录';

模拟ATMoracle数据库版本源码:

超级管理员表创建语句如下:


create table t_admin(
	id integer,
	username varchar(100),
	password varchar(100)
);
insert into t_admin(id,username,password) values(1,'admin','123456');
--超级管理员字段加注释
comment on column t_admin.id is '主键';
comment on column t_admin.username is '超级管理员账号';
comment on column t_admin.password is '超级管理员密码';
--超级管理员表加注释
comment on table t_admin is '超级管理员';

ATM机器表创建语句如下:


create table t_atm(
	id integer,
	atmNum varchar(100),
	je int
);
--ATM机器字段加注释
comment on column t_atm.id is '主键';
comment on column t_atm.atmNum is 'ATM编号';
comment on column t_atm.je is '金额';
--ATM机器表加注释
comment on table t_atm is 'ATM机器';

银行卡表创建语句如下:


create table t_card(
	id integer,
	customerId int,
	cardid varchar(100),
	ye int
);
--银行卡字段加注释
comment on column t_card.id is '主键';
comment on column t_card.customerId is '用户';
comment on column t_card.cardid is '卡号';
comment on column t_card.ye is '余额';
--银行卡表加注释
comment on table t_card is '银行卡';

用户表创建语句如下:


create table t_customer(
	id integer,
	username varchar(100),
	password varchar(100),
	customerName varchar(100),
	headPic varchar(100),
	sex varchar(100),
	age varchar(100),
	phone varchar(100),
	idcard varchar(100)
);
--用户字段加注释
comment on column t_customer.id is '主键';
comment on column t_customer.username is '账号';
comment on column t_customer.password is '密码';
comment on column t_customer.customerName is '姓名';
comment on column t_customer.headPic is '头像';
comment on column t_customer.sex is '性别';
comment on column t_customer.age is '年龄';
comment on column t_customer.phone is '电话';
comment on column t_customer.idcard is '身份证';
--用户表加注释
comment on table t_customer is '用户';

操作记录表创建语句如下:


create table t_runlog(
	id integer,
	types varchar(100),
	atmNum varchar(100),
	card1 varchar(100),
	card2 varchar(100),
	je int,
	insertDate datetime
);
--操作记录字段加注释
comment on column t_runlog.id is '主键';
comment on column t_runlog.types is '操作类型';
comment on column t_runlog.atmNum is 'ATM';
comment on column t_runlog.card1 is '主卡';
comment on column t_runlog.card2 is '对方卡';
comment on column t_runlog.je is '金额';
comment on column t_runlog.insertDate is '操作日期';
--操作记录表加注释
comment on table t_runlog is '操作记录';

oracle特有,对应序列如下:


create sequence s_t_atm;
create sequence s_t_card;
create sequence s_t_customer;
create sequence s_t_runlog;

模拟ATMsqlserver数据库版本源码:

超级管理员表创建语句如下:


--超级管理员
create table t_admin(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--超级管理员账号
	password varchar(100)--超级管理员密码
);
insert into t_admin(username,password) values('admin','123456');

ATM机器表创建语句如下:


--ATM机器表注释
create table t_atm(
	id int identity(1,1) primary key not null,--主键
	atmNum varchar(100),--ATM编号
	je int--金额
);

银行卡表创建语句如下:


--银行卡表注释
create table t_card(
	id int identity(1,1) primary key not null,--主键
	customerId int,--用户
	cardid varchar(100),--卡号
	ye int--余额
);

用户表创建语句如下:


--用户表注释
create table t_customer(
	id int identity(1,1) primary key not null,--主键
	username varchar(100),--账号
	password varchar(100),--密码
	customerName varchar(100),--姓名
	headPic varchar(100),--头像
	sex varchar(100),--性别
	age varchar(100),--年龄
	phone varchar(100),--电话
	idcard varchar(100)--身份证
);

操作记录表创建语句如下:


--操作记录表注释
create table t_runlog(
	id int identity(1,1) primary key not null,--主键
	types varchar(100),--操作类型
	atmNum varchar(100),--ATM
	card1 varchar(100),--主卡
	card2 varchar(100),--对方卡
	je int,--金额
	insertDate datetime--操作日期
);

模拟ATM登录后主页

模拟ATMspring+springMVC+hibernate框架对象(javaBean,pojo)设计:

ATM机器javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//ATM机器
@Table(name = "t_atm")
public class Atm {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//ATM编号
private String atmNum;
//金额
private Integer je;
public String getAtmNum() {return atmNum;}
public void setAtmNum(String atmNum) {this.atmNum = atmNum;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
}

银行卡javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//银行卡
@Table(name = "t_card")
public class Card {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//用户
private Integer customerId;
//卡号
private String cardid;
//余额
private Integer ye;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getCardid() {return cardid;}
public void setCardid(String cardid) {this.cardid = cardid;}
public Integer getYe() {return ye;}
public void setYe(Integer ye) {this.ye = ye;}
}

用户javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//用户
@Table(name = "t_customer")
public class Customer {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码
private String password;
//姓名
private String customerName;
//头像
private String headPic;
//性别
private String sex;
//年龄
private String age;
//电话
private String phone;
//身份证
private String idcard;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getHeadPic() {return headPic;}
public void setHeadPic(String headPic) {this.headPic = headPic;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getIdcard() {return idcard;}
public void setIdcard(String idcard) {this.idcard = idcard;}
}

操作记录javaBean创建语句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity

//操作记录
@Table(name = "t_runlog")
public class Runlog {
//主键
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//操作类型
private String types;
//ATM
private String atmNum;
//主卡
private String card1;
//对方卡
private String card2;
//金额
private Integer je;
//操作日期
private Date insertDate;
public String getTypes() {return types;}
public void setTypes(String types) {this.types = types;}
public String getAtmNum() {return atmNum;}
public void setAtmNum(String atmNum) {this.atmNum = atmNum;}
public String getCard1() {return card1;}
public void setCard1(String card1) {this.card1 = card1;}
public String getCard2() {return card2;}
public void setCard2(String card2) {this.card2 = card2;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
}

模拟ATMspring+springMVC+mybatis框架对象(javaBean,pojo)设计:

ATM机器javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//ATM机器
public class Atm  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//ATM编号
private String atmNum;
//金额
private Integer je;
public String getAtmNum() {return atmNum;}
public void setAtmNum(String atmNum) {this.atmNum = atmNum;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
}

银行卡javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//银行卡
public class Card  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//用户
private Integer customerId;
//卡号
private String cardid;
//余额
private Integer ye;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getCardid() {return cardid;}
public void setCardid(String cardid) {this.cardid = cardid;}
public Integer getYe() {return ye;}
public void setYe(Integer ye) {this.ye = ye;}
}

用户javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//用户
public class Customer  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//账号
private String username;
//密码
private String password;
//姓名
private String customerName;
//头像
private String headPic;
//性别
private String sex;
//年龄
private String age;
//电话
private String phone;
//身份证
private String idcard;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getHeadPic() {return headPic;}
public void setHeadPic(String headPic) {this.headPic = headPic;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getIdcard() {return idcard;}
public void setIdcard(String idcard) {this.idcard = idcard;}
}

操作记录javaBean创建语句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

//操作记录
public class Runlog  extends BaseBean{
//主键
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//操作类型
private String types;
//ATM
private String atmNum;
//主卡
private String card1;
//对方卡
private String card2;
//金额
private Integer je;
//操作日期
private Date insertDate;
public String getTypes() {return types;}
public void setTypes(String types) {this.types = types;}
public String getAtmNum() {return atmNum;}
public void setAtmNum(String atmNum) {this.atmNum = atmNum;}
public String getCard1() {return card1;}
public void setCard1(String card1) {this.card1 = card1;}
public String getCard2() {return card2;}
public void setCard2(String card2) {this.card2 = card2;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public Date getInsertDate() {return insertDate;}
public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
}

源代码下载点这里

评论