java买东西代码 java电商购物平台代码( 二 )


id int(12) NOT NULL,
author varchar(200) NOT NULL,
publishing varchar(200) NOT NULL,
publish_time bigint(20) NOT NULL,
word_number varchar(15) default NULL,
which_edtion varchar(15) default NULL,
total_page varchar(15) default NULL,
print_time int(20) default NULL,
print_number varchar(15) default NULL,
isbn varchar(25) default NULL,
author_summary text NOT NULL,
catalogue text NOT NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO d_book VALUES (24,'阿斗,'地球出版社',1237873000234,'1万','1','100',1,NULL,'12345678','无描述,'好书!');
DROP TABLE IF EXISTS d_category;
CREATE TABLE d_category (//商城图书目录
id int(12) NOT NULL auto_increment,
turn int(10) NOT NULL,
en_name varchar(200) NOT NULL,
name varchar(200) NOT NULL,
description varchar(200),
parent_id int(10),
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO d_category VALUES (1,1,'Book','图书',NULL,0);
DROP TABLE IF EXISTS d_category_product;
CREATE TABLE d_category_product (//这个是连接目录和书籍具体信息的表
id int(12) NOT NULL auto_increment,
product_id int(10) NOT NULL,
cat_id int(10) NOT NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO d_category_product VALUES (72,24,1);
DROP TABLE IF EXISTS d_item;
CREATE TABLE d_item (//这个订单条目表
id int(12) NOT NULL auto_increment,
order_id int(10) NOT NULL,
product_id int(10) NOT NULL,
product_name varchar(100) NOT NULL,
dang_price double NOT NULL,
product_num int(10) NOT NULL,
amount double NOT NULL,
PRIMARY KEY(id)
)
DROP TABLE IF EXISTS d_order;
CREATE TABLE d_order (//订单表
id int(10) NOT NULL auto_increment,
user_id int(10) NOT NULL,
status int(10) NOT NULL,
order_time bigint(20) NOT NULL,
order_desc varchar(100) default NULL,
total_price double NOT NULL,
receive_name varchar(100) default NULL,
full_address varchar(200) default NULL,
postal_code varchar(8) default NULL,
mobile varchar(20) default NULL,
phone varchar(20) default NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB;
DROP TABLE IF EXISTS d_receive_address;
CREATE TABLE d_receive_address (//收件人信息表
id int(12) NOT NULL auto_increment,
user_id int(11) NOT NULL,
receive_name varchar(20) NOT NULL,
full_address varchar(200) NOT NULL,
postal_code varchar(8) NOT NULL,
mobile varchar(15) default NULL,
phone varchar(20) default NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB;
insert into d_receive_address values(1, 6,'Java','sun.cn','10000800','12345','67890');
insert into d_receive_address values(2, 6,'JavaJavaJava','ibm.cn','10000600','12345','67890');
DROP TABLE IF EXISTS d_user;
CREATE TABLE d_user (//用户表,用户信息
id int(12) NOT NULL auto_increment,
email varchar(50) NOT NULL,
nickname varchar(50) default NULL,
password varchar(50) NOT NULL,
user_integral int(12) NOT NULL default '0',
is_email_verify char(3),
email_verify_code varchar(50) default NULL,
last_login_time bigint default NULL,
last_login_ip varchar(15) default NULL,
PRIMARY KEY(id),
UNIQUE KEY email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
java简单的购物车代码package Test;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
init();//初始化
MapString,String map = new LinkedHashMap();
while(true){
Scanner in= new Scanner(System.in);
map = buy(in,map);//选择
System.out.println();

推荐阅读