java网上图书商城(6)订单模块1
程序员文章站
2024-03-09 12:35:23
先看看效果图:
1.sql
①t_orderitem一个外键
bname:方便后期book删除
create table `t_orderite...
先看看效果图:
1.sql
①t_orderitem一个外键
bname:方便后期book删除
create table `t_orderitem` ( `orderitemid` char(32) not null, `quantity` int(11) default null, `subtotal` decimal(8,2) default null, `bid` char(32) default null, `bname` varchar(200) default null, `currprice` decimal(8,2) default null, `image_b` varchar(100) default null, `oid` char(32) default null, primary key (`orderitemid`), key `fk_t_orderitem_t_order` (`oid`), constraint `fk_t_orderitem_t_order` foreign key (`oid`) references `t_order` (`oid`) ) engine=innodb default charset=utf8; insert into `t_orderitem`(`orderitemid`,`quantity`,`subtotal`,`bid`,`bname`,`currprice`,`image_b`,`oid`) values ('01d2df3e5bb34e9f9d2477180c8d94d3',1,'74.50','ce01f15d435a4c51b0ad8202a318dca7','java编程思想(第4版)','74.50','book_img/9317290-1_b.jpg','c0841f4dfe7a43bfb183e4e82ae7914c');
②t_order一个外键
create table `t_order` ( `oid` char(32) not null, `ordertime` char(19) default null, `total` decimal(10,2) default null, `status` int(11) default null, `address` varchar(1000) default null, `uid` char(32) default null, primary key (`oid`), key `fk_t_order_t_user` (`uid`), constraint `fk_t_order_t_user` foreign key (`uid`) references `t_user` (`uid`) ) engine=innodb default charset=utf8; insert into `t_order`(`oid`,`ordertime`,`total`,`status`,`address`,`uid`) values ('058f48da33694c6d8f5c2c13f3d26cea','2013-12-26 21:47:04','95.30',1,'李女士 广东省 揭阳市 揭东县 xxx xxx xxx','32db3700d2564254982bc58b0e4d95bc');
2.bean
①orderitem
public class orderitem { private string orderitemid;//主键 private int quantity;//数量 private double subtotal;//小计 private book book;//所关联的book private order order;//所属的订单
②order
public class order { private string oid;//主键 private string ordertime;//下单时间 private double total;//总计 private int status; //订单状态:1未付款, 2已付款但未发货, 3已发货未确认收货, 4确认收货了交易成功, 5已取消(只有未付款才能取消) private string address;//收货地址 private user owner;//订单的所有者 private list<orderitem> orderitemlist;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。