Web应用案例

`/*
Navicat MySQL Data Transfer

Source Server : hwsql
Source Server Version : 50518
Source Host : localhost:3306
Source Database : simonshop

Target Server Type : MYSQL
Target Server Version : 50518
File Encoding : 65001

Date: 2017-02-16 09:21:41
*/

SET FOREIGN_KEY_CHECKS=0;


– Table structure for t_category


DROP TABLE IF EXISTS t_category;
CREATE TABLE t_category (
id int(11) NOT NULL AUTO_INCREMENT COMMENT ‘商品类别标识符’,
name varchar(100) NOT NULL COMMENT ‘商品类别名称’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;


– Records of t_category


INSERT INTO t_category VALUES (‘1’, ‘家用电器’);
INSERT INTO t_category VALUES (‘2’, ‘床上用品’);
INSERT INTO t_category VALUES (‘3’, ‘文具用品’);
INSERT INTO t_category VALUES (‘4’, ‘休闲食品’);


– Table structure for t_order


DROP TABLE IF EXISTS t_order;
CREATE TABLE t_order (
id int(11) NOT NULL AUTO_INCREMENT COMMENT ‘订单标识符’,
username varchar(20) DEFAULT NULL COMMENT ‘用户名’,
telephone varchar(11) DEFAULT NULL COMMENT ‘电话号码’,
total_price double DEFAULT NULL COMMENT ‘总金额’,
delivery_address varchar(50) DEFAULT NULL COMMENT ‘送货地址’,
order_time timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT ‘下单时间’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;


– Records of t_order


INSERT INTO t_order VALUES (‘1’, ‘郑晓红’, ‘13956567889’, ‘2000’, ‘泸职院信息工程系’, ‘2016-12-25 17:12:36’);
INSERT INTO t_order VALUES (‘2’, ‘温志军’, ‘13956678907’, ‘1000’, ‘泸职院机械工程系’, ‘2016-12-02 17:12:17’);


– Table structure for t_product


DROP TABLE IF EXISTS t_product;
CREATE TABLE t_product (
id int(11) NOT NULL AUTO_INCREMENT COMMENT ‘商品标识符’,
name varchar(200) NOT NULL COMMENT ‘商品名称’,
price double DEFAULT NULL COMMENT ‘商品单价’,
add_time timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
category_id int(11) DEFAULT NULL COMMENT ‘商品类别标识符’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;


– Records of t_product


INSERT INTO t_product VALUES (‘1’, ‘容声电冰箱’, ‘2000’, ‘2016-12-20 09:54:41’, ‘1’);
INSERT INTO t_product VALUES (‘2’, ‘松下电视’, ‘5000’, ‘2016-12-20 09:54:35’, ‘1’);
INSERT INTO t_product VALUES (‘3’, ‘红岩墨水’, ‘3’, ‘2016-12-20 09:56:05’, ‘3’);
INSERT INTO t_product VALUES (‘4’, ‘海尔洗衣机’, ‘1000’, ‘2016-11-30 08:58:09’, ‘1’);
INSERT INTO t_product VALUES (‘5’, ‘新宇电饭煲’, ‘1200’, ‘2016-12-20 09:55:11’, ‘1’);
INSERT INTO t_product VALUES (‘6’, ‘英雄微波炉’, ‘600’, ‘2016-12-20 09:55:39’, ‘1’);
INSERT INTO t_product VALUES (‘7’, ‘红双喜席梦思’, ‘700’, ‘2016-11-28 08:59:38’, ‘2’);
INSERT INTO t_product VALUES (‘8’, ‘旺仔牛奶糖’, ‘24.4’, ‘2016-12-20 10:00:11’, ‘4’);
INSERT INTO t_product VALUES (‘9’, ‘西蒙枕头’, ‘100’, ‘2016-12-20 09:56:57’, ‘2’);
INSERT INTO t_product VALUES (‘10’, ‘甜甜毛毯’, ‘400’, ‘2016-12-20 09:57:26’, ‘2’);
INSERT INTO t_product VALUES (‘11’, ‘永久钢笔’, ‘50’, ‘2016-12-20 09:57:30’, ‘3’);
INSERT INTO t_product VALUES (‘12’, ‘硬面抄笔记本’, ‘5’, ‘2016-12-20 09:57:53’, ‘3’);
INSERT INTO t_product VALUES (‘13’, ‘晨光橡皮擦’, ‘0.5’, ‘2016-11-30 09:02:40’, ‘3’);
INSERT INTO t_product VALUES (‘14’, ‘美的空调’, ‘3000’, ‘2016-11-03 09:03:02’, ‘1’);
INSERT INTO t_product VALUES (‘15’, ‘迷你深海鱼肠’, ‘14.4’, ‘2016-12-02 10:01:14’, ‘4’);


– Table structure for t_user


DROP TABLE IF EXISTS t_user;
CREATE TABLE t_user (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(20) NOT NULL,
password varchar(20) DEFAULT NULL,
telephone varchar(11) DEFAULT NULL,
register_time timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
popedom int(11) DEFAULT NULL COMMENT ‘0:管理员;1:普通用户’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;


– Records of t_user


INSERT INTO t_user VALUES (‘1’, ‘admin’, ‘12345’, ‘15734345678’, ‘2016-12-02 08:40:35’, ‘0’);
INSERT INTO t_user VALUES (‘2’, ‘郑晓红’, ‘11111’, ‘13956567889’, ‘2016-12-20 09:51:43’, ‘1’);
INSERT INTO t_user VALUES (‘3’, ‘温志军’, ‘22222’, ‘13956678907’, ‘2016-12-20 09:52:36’, ‘1’);
INSERT INTO t_user VALUES (‘4’, ‘涂文艳’, ‘33333’, ‘15890905678’, ‘2016-12-05 09:52:56’, ‘1’);`
在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述单元测试类:
删除:在这里插入图片描述在这里插入图片描述插入:在这里插入图片描述在这里插入图片描述查找全部:在这里插入图片描述按名字查找:在这里插入图片描述按ID查找:在这里插入图片描述登录:在这里插入图片描述CategoryDaoImpl的按类型查找:在这里插入图片描述在这里插入图片描述cateDaoImpl的查找在这里插入图片描述在这里插入图片描述Category插入数据:在这里插入图片描述在这里插入图片描述Category更新数据:在这里插入图片描述在这里插入图片描述
Category按ID查找:在这里插入图片描述Product按ID删除:在这里插入图片描述在这里插入图片描述Product插入:在这里插入图片描述Product更新:在这里插入图片描述在这里插入图片描述Product按ID查找:在这里插入图片描述Product查找全部:在这里插入图片描述
Order按ID删除:在这里插入图片描述Order插入数据:在这里插入图片描述在这里插入图片描述
Order更新数据:在这里插入图片描述在这里插入图片描述
Order按ID查找:在这里插入图片描述在这里插入图片描述在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值