ylbtech-dbs-m-YinTai(银泰网)

ylbtech-dbs:ylbtech-dbs-m-YinTai(银泰网)

-- =============================================
-- DatabaseName:YinTai
-- desc:银泰网(电子商务)
-- pubdate:09:52 2014-07-18
-- author:ylbtech
-- http://m.yintai.com
-- =============================================

1.A,数据库关系图(Database Diagram) 返回顶部

 

1.B,数据库设计脚本(Database Design Script)返回顶部

1.B.1,

1.B.1.1, sql-basic.sql

use master
go
-- =============================================
-- DatabaseName:银泰网
-- pubdate:09:52 2014-07-18
-- author:ylbtech
-- http://m.yintai.com/
-- =============================================
IF EXISTS (SELECT * 
       FROM   master..sysdatabases 
       WHERE  name = N'YinTai')
    DROP DATABASE YinTai
GO

CREATE DATABASE YinTai
GO
use YinTai
go
-- =============================================
-- table:账户
-- 只做电子邮箱验证注册
-- =============================================
create table Account
(
accountId int identity(100001,1) primary key,    --编号【PK】
nickname varchar(20) not null,    --昵称
email varchar(200),    --E-Mail
phone varchar(200),    --手机号
[password] varchar(20) not null,        --密码
[type] int,        --类型 0:手机号;1:电子邮箱
validEmail bit,    --验证
validPhone bit,    --验证
pubdate datetime default(getdate()),    --注册时间
[enable] bit --状态 0:正常;1:禁用
)
go
insert into Account(nickname,email,phone,[password]
,[type],validEmail,validPhone,pubdate,[enable])
values('750833968','750833968@qq.com','','123456'
,1,0,0,getdate(),0)
go

-- =============================================
-- table:用户中心[积分、银元]
-- =============================================
--create table UserCenter
--(

--)

go
--drop table Address
-- =============================================
-- table:地址
-- =============================================
create table [Address]
(
addressId int primary key identity(1000,1),    --编号【PK,ID】
fullName varchar(200),    --收货人
mobile varchar(40),    --联系电话
province varchar(40),    --
city varchar(40),    --
area varchar(40),    --区县
addressDetail varchar(200),    --详细地址
accountId int references Account(accountId),    --账号ID【FK】
)
go
insert into [Address](fullName,mobile,province,city,area,addressDetail,accountId)
values('rain','123434546456','beijing','beijing','haidian','long range',100001)
insert into [Address](fullName,mobile,province,city,area,addressDetail,accountId)
values('rain','123434546456','beijing','beijing','haidian','long range',100001)
-- ---------公共表------------------------------

go
-- =============================================
-- table:组表(大分类)-男装、女装
-- =============================================
create table [Group]
(
groupName varchar(200) primary key    --组名
)
insert into [Group](groupName) values('男装')
insert into [Group](groupName) values('女装')
go
-- =============================================
-- table:分类 男装、女装
-- =============================================
create table Category
(
categoryId int primary key identity(101,1),    --编号
[name] varchar(200),    --分类名称
searchCondition int,    --查找条件
parentId int,    --0:父;其他:父级别条件,即searchCondition
[type] int    --0:文本;1:超链接(仅限二级使用)
)
insert into Category([name],searchCondition,parentId,[type]) values('女装',100,0,0)
insert into Category([name],searchCondition,parentId,[type]) values('男装',101,0,0)
go
insert into Category([name],searchCondition,parentId,[type]) values('上装',10101,101,0)
go
insert into Category([name],searchCondition,parentId,[type]) values('POLO衫',-1,10101,0)
insert into Category([name],searchCondition,parentId,[type]) values('背心',-1,10101,0)
go
insert into Category([name],searchCondition,parentId,[type]) values('套装',10102,101,0)
insert into Category([name],searchCondition,parentId,[type]) values('下装',10103,101,0)
go
insert into Category([name],searchCondition,parentId,[type]) values('美妆',102,0,0)
insert into Category([name],searchCondition,parentId,[type]) values('家居',103,0,0)
insert into Category([name],searchCondition,parentId,[type]) values('运动',104,0,0)
go
-- =============================================
-- table:品牌  PeaceBird、LEE
-- =============================================
create table Brand
(
brandId int identity(10001,1),    --编号【PK,ID】
[name] varchar(200) primary key,    --名称
searchCondition int,    --查找条件
categoryId int    --类别ID
)
go
insert into Brand([name],searchCondition,categoryId) values('Peace Bird',100,101)
insert into Brand([name],searchCondition,categoryId) values('Lee',100,101)
go
-- =============================================
-- table:反馈
-- =============================================
create table Feedback
(
feedbackId int primary key identity(1000,1),    --编号【PK,ID】
phoneModel varchar(200),    --电话型号
contact varchar(200),        --联系方式
content varchar(200),    --意见
network varchar(200),    --网络信息
browser varchar(200),    --浏览器
questionType varchar(200),    --问题类型

pubdate datetime default(getdate()),    --时间
[type] int,                            --类型
[status] int,                            --状态
replyContent varchar(200),                --回复内容
replyPubdate datetime,            --回复日期
accountType int,        --用户类型
accountId int foreign key references Account(accountId)   --账户ID【FK】 
)
go
--drop table Recommend
-- =============================================
-- table:应用推荐
-- =============================================
create table Recommend
(
recommendId int primary key identity(100,1),    --编号【PK,ID】
[name] varchar(200),    --应用名称
introduce varchar(700),    --说明
downloadUrl varchar(500),    --下载地址
icon varchar(500),    --图标
[type] int    --类型
)
go
insert into Recommend([name],introduce,downloadUrl,icon
,[type])
values('','','https://itunes.apple.com/cn/app/tian-qi-yi-bao/id663183019?mt=8','http://yrs.yintai.com/rs/img/AppCMS/20131209162750_tianqi.jpg'
,1)
insert into Recommend([name],introduce,downloadUrl,icon
,[type])
values('','','https://itunes.apple.com/cn/app/tian-qi-yi-bao/id663183019?mt=8','http://yrs.yintai.com/rs/img/AppCMS/20131209162750_tianqi.jpg'
,1)
go
insert into Recommend([name],introduce,downloadUrl,icon
,[type])
values('哈秀画报(安卓版)','教你扮靓,女生必备!','http://www.haxiu.com/azapp/download_android.php?form=8','http://yrs.yintai.com/rs/img/AppCMS/20131209153301_114haxu.jpg'
,2)
insert into Recommend([name],introduce,downloadUrl,icon
,[type])
values('哈秀画报(安卓版)','教你扮靓,女生必备!','http://www.haxiu.com/azapp/download_android.php?form=8','http://yrs.yintai.com/rs/img/AppCMS/20131209153301_114haxu.jpg'
,2)
insert into Recommend([name],introduce,downloadUrl,icon
,[type])
values('哈秀画报(安卓版)','教你扮靓,女生必备!','http://www.haxiu.com/azapp/download_android.php?form=8','http://yrs.yintai.com/rs/img/AppCMS/20131209153301_114haxu.jpg'
,2)
go
-- drop table Activity
-- =============================================
-- table:限时特卖
-- =============================================
create table Activity
(
[id] int,    --编号【FK】
title varchar(200),    --标题
imageUrl varchar(500),    --图片地址
isLabel int,    --1
[name] varchar(200),    --品牌名称
logoImage varchar(500),    --Logo图片
discount varchar(200),    --折扣
startTime datetime,    --开始时间
endTime datetime,    --结束时间
type int    -- -1=筹备中 0=已加入列表
)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('Anta','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'Anta'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','2.4-4.4','2014-08-23','2014-09-23',0)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('Ling-ning','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'Ling-ning'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','2.4-4.4','2014-08-24','2014-09-24',0)
go
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('PEACE BIRD','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'PEACE BIRD'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','2.4-4.4','2014-08-25','2014-09-25',0)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('LEE','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'LEE'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','2.4-4.4','2014-08-26','2014-09-26',0)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('MICHAEL KORS','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'MICHAEL KORS'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','2.4-4.4','2014-08-27','2014-09-27',0)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('SELEECTED','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'SELEECTED'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','1.4-2.4','2014-08-28','2014-09-28',0)
go
insert into Activity(title,imageUrl,isLabel,[name]
,logoImage,discount,startTime,endTime,type)
values('NIKE','http://r.ytrss.com/rs/img/product/bargainproduct/bargain_AppTheme130504119744399979.jpg',0,'NIKE'
,'http://p10.ytrss.com/brand/brandlist/brand-615.jpg','3.4-4.4','2014-08-29','2014-09-29',0)
go
-- select * from activity where type=0 and startTime='2014-08-27'
go
--本场活动
--本期开始时间: 2014-08-06 17:01:00
--本期结束时间: 2014-08-13 17:00:00
--下期预告
--本期开始时间: 2014-08-13 17:01:00
--本期结束时间: 2014-08-20 17:00:00
go
-- drop table Promotion
-- =============================================
-- table:团购
-- =============================================
--create table Promotion
--(
--promotionId uniqueidentifier,    --编号【PK,ID】
--startTime datetime,    --开始时间
--endTime datetime,    --结束日期
--[type] int     --状态 -1=未开始;0=本场活动;1:已结束终止;-2:已取消
--)
--go
--insert into Promotion(promotionId,startTime,endTime,[type])
--values('4A2F9D92-5E32-45C2-8E32-090B9365D52E','2014-08-13 17:01:00','2014-08-20 17:00:00',-1)
--insert into Promotion(promotionId,startTime,endTime,[type])
--values('4A2F9D92-5E32-45C2-8E32-090B9365D52D','2014-08-06 17:01:00','2014-08-13 17:00:00',0)
go
-- =============================================
-- table:团购
-- refer:Promotion,Product
-- =============================================
--create table PromotionProduct
--(
--promotionId uniqueidentifier,    --团购ID【FK】
--productId int,    --编号【FK】
--inStock int,    --限购数(剩余数=限购数-已销数)
--outStock int    --已销数(在这个活动期间,所销售的数量)
--)
go
--insert into PromotionProduct(promotionId,productId,inStock,outStock)
--values('4A2F9D92-5E32-45C2-8E32-090B9365D52E',10001,10,0)

go
-- drop table Promotion
-- =============================================
-- table:团购
-- =============================================
create table Promotion
(
promotionId int primary key identity(100,1),    --编号【PK,ID】
[type] int,    --类型 1:图片;0:文字
imageUrl varchar(200),    --图片地址
title varchar(200),    --标题
titleContent varchar(200),    --标题内容
searchCondition varchar(200),    --搜索条件
linkType int --1:图片;0:文字
)
go
--图片
insert into Promotion(title,imageUrl,[type],searchCondition,titleContent,linkType)
 values('时尚女装专场','/rs/img/AppCMS/20140606111657_bags.jpg',1,50000488,'时尚女装专场',1)
insert into Promotion(title,imageUrl,[type],searchCondition,titleContent,linkType)
 values('热卖凉鞋专场','/rs/img/AppCMS/20140606111944_shoes.jpg',1,50000488,'热卖凉鞋专场',1)
go
-- 文字
insert into Promotion(title,[type],searchCondition,titleContent,linkType)
 values('秋水伊人 全场五折起',1,50000488,'秋水伊人 全场五折起',0)
insert into Promotion(title,[type],searchCondition,titleContent,linkType)
 values('秋水伊人 全场五折起',1,50000488,'秋水伊人 全场五折起',0)
insert into Promotion(title,[type],searchCondition,titleContent,linkType)
 values('秋水伊人 全场五折起',1,50000488,'秋水伊人 全场五折起',0)
insert into Promotion(title,[type],searchCondition,titleContent,linkType)
 values('秋水伊人 全场五折起',1,50000488,'秋水伊人 全场五折起',0)
insert into Promotion(title,[type],searchCondition,titleContent,linkType)
 values('秋水伊人 全场五折起',1,50000488,'秋水伊人 全场五折起',0)
go
-- drop table Item
-- =============================================
-- table:产品
-- =============================================
create table Item
(
itemId int primary key identity(1000,1),    --编号【PK,ID】
itemCode uniqueidentifier,    --商品编号【UQ】
[name] varchar(200),    --产品名称
imageUrl varchar(200),    --
midImageUrl varchar(200),    --中等图片地址
bigImageUrl varchar(200),    --大图片地址
ytPrice decimal(6,2),    --银泰价
price decimal(6,2),        --市场价
inventory int default(0),     --库存数量
discount decimal(8,2),    --折扣
[status] int,    --商品状态 0=已上架;1=已下架;-1:筹备中
pubdate datetime default(getdate()),    --上架时间
categoryId int,    --组表【FK】
brandId int    --组表【FK】
)
go
insert into Item(itemCode,[name],imageUrl,midImageUrl
,bigImageUrl,ytPrice,price,inventory,discount
,[status],pubdate,categoryId,brandId)
values('4A2F9D92-5E32-45C2-8E32-090B9365D52E','太平鸟男装休闲裤','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg'
,'http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jp',120,600,100,2
,0,GETDATE(),10000,1000)
insert into Item(itemCode,[name],imageUrl,midImageUrl
,bigImageUrl,ytPrice,price,inventory,discount
,[status],pubdate,categoryId,brandId)
values('4A2F9D92-5E32-45C2-8E32-090B9365D52A','太平鸟男装休闲裤','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg'
,'http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jp',120,600,100,2
,0,GETDATE(),10000,1000)
insert into Item(itemCode,[name],imageUrl,midImageUrl
,bigImageUrl,ytPrice,price,inventory,discount
,[status],pubdate,categoryId,brandId)
values('4A2F9D92-5E32-45C2-8E32-090B9365D52B','太平鸟男装休闲裤','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg'
,'http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jp',120,600,100,2
,0,GETDATE(),10000,1000)
insert into Item(itemCode,[name],imageUrl,midImageUrl
,bigImageUrl,ytPrice,price,inventory,discount
,[status],pubdate,categoryId,brandId)
values('4A2F9D92-5E32-45C2-8E32-090B9365D52C','太平鸟男装休闲裤','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg','http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jpg'
,'http://p10.ytrss.com/product/20/472/0706/GridImage/4625.jp',120,600,100,2
,0,GETDATE(),10000,1000)
go 
-- ============================================= 
-- 7,属性信息
-- refer Item 
-- ============================================= 
create table Property
(
[name] varchar(200),    --名称
value varchar(500),    --
itemId int,    --项目编号【FK】
itemCode uniqueidentifier    --项目编号【UQ】
)
go
insert into Property([name],value,itemId,itemCode) values('面料','棉线',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
insert into Property([name],value,itemId,itemCode) values('产地','摩洛哥',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
insert into Property([name],value,itemId,itemCode) values('销售季节','春秋',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
go 
-- ============================================= 
-- 7,属性描述描述
-- refer Item 
-- ============================================= 
create table PropertyDescription
(
[name] varchar(200),    --名称
[desc] varchar(500),    --描述
itemId int,    --项目编号【FK】
itemCode uniqueidentifier    --项目编号【UQ】
)
go
insert into PropertyDescription([name],[desc],itemId,itemCode) values('尺寸说明','<img src=\"http://p10.ytrss.com/ProductDetail//guide/20-462-9614-01.jpg\" alt=\"\" />',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
insert into PropertyDescription([name],[desc],itemId,itemCode) values('品牌故事','"Diesel原意是“柴油”,迪赛 (Diesel) 创始人伦佐?罗索 (Renzo Rosso) 解释品牌含义:“Diesel这个词短小精悍,叫起来朗朗上口,虽然有顾客以为我们是卖柴油机的,但这正是我们牛仔裤的内涵——活力四射,朝气蓬勃。”迪赛 (Diesel) 是著名的意大利牛仔时装品牌,由伦佐.罗索 (Renzo Rosso) 在1978年创立,并成为意大利时装企业“天才集团”(Genius ) 旗下14个品牌之一。',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E') 
go
-- =============================================
-- table:产品图片
-- refer:Item
-- =============================================
create table ItemImgUrl
(
itemImgUrlId int primary key identity(100,1),    --编号【PK,ID】
largeImgUrl varchar(500),    --大图片地址
smallImgUrl varchar(500),    --小图片地址
itemId int,    --项目编号【FK】
itemCode uniqueidentifier    --项目编号【UQ】
)
go
insert into ItemImgUrl(largeImgUrl,smallImgUrl,itemId,itemCode) values('http://p10.ytrss.com/product/20/462/9614/LargeImage/28957.jpg','http://p10.ytrss.com/product/20/462/9614/LargeImage/28957.jpg',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
insert into ItemImgUrl(largeImgUrl,smallImgUrl,itemId,itemCode) values('http://p10.ytrss.com/product/20/462/9614/LargeImage/28957.jpg','http://p10.ytrss.com/product/20/462/9614/LargeImage/28957.jpg',1000,'4A2F9D92-5E32-45C2-8E32-090B9365D52E')
go
-- ---------订单表------------------------------
go 
-- ============================================= 
-- 7,订单 
-- ============================================= 
create table [Order]
( 
order_id int identity primary key,   --订单ID【PK】 
accountId int foreign key references Account(accountId),   --账户ID【FK】 
--shop_id int foreign key references Shop(shop_id),    --商铺ID【FK】 
shop_id int,    --商铺ID【FK】 
order_date datetime,     --订购日期 
required_date datetime,  --到货日期 

total decimal(8,2),        --合计金额
shipped_date datetime,   --发货日期 
ShipVia int,        --运货商【FK】 
fright decimal(8,2),           --运货费 
ship_name varchar(15),      --货主名称 
ship_address varchar(60),   --货主地址 
  
ship_city varchar(15),      --货主城市 
ship_region varchar(15),    --货主地区      
ship_contry varchar(15),     --货主国家 
ship_postal_code varchar(10),--货主邮政编码
[status] int,    --状态
flag bit default(0),    --是否禁用

deliver_time varchar(40),    --送餐时间
remark varchar(400),        --备注
[type] int    --外卖|预订|就餐
) 
go 
-- ============================================= 
-- 4,订单明细 
-- ============================================= 
create table OrderDetails
( 
order_id int,      --订单ID【UPK】 
product_id int,      --产品ID【UPK】    
unit_price decimal(8,2) not null,   --单价 
quantity int not null, --数量 
--discount decimal(8,2) not null,     --折扣 
[name] varchar(400),    --名称
status int,    --状态
accountId int,   --账户ID【FK】 
shop_id int,    --商铺ID【FK】 
primary key(order_id,product_id)  --联合主键 
) 

go 
-- drop table FilterCategory
-- ============================================= 
-- 4,筛选分类 
-- ============================================= 
create table FilterCategory
(
filterCategoryId int primary key identity(1000,1),    --编号【Pk,ID】
[name] varchar(200) unique not null,    --分类名称【UQ】
[desc] varchar(500)    --描述
)
go
insert into FilterCategory([name],[desc]) values('price','价格段划分')
go 
-- drop table Filter
-- ============================================= 
-- 4,筛选  name = "蓝色系", value = "", icon = "", count = 0, parentId = 0
-- refer:FilterCategory
-- ============================================= 
create table Filter
(
filterId int primary key identity(100000,1),    --编号【PK,ID】
[name] varchar(200),    --名称
value varchar(200),    --值==编号
icon varchar(500),    --图标
[count] int default(0),    --数量
parentId int default(0),    --父类ID
filterCategoryId int    --筛选分类ID【FK】
)
go
insert into Filter([name],icon,[count],parentId,filterCategoryId)
values('0-100元','',0,0,1000)
insert into Filter([name],icon,[count],parentId,filterCategoryId)
values('100-200元','',0,0,1000)
insert into Filter([name],icon,[count],parentId,filterCategoryId)
values('200-500元','',0,0,1000)
insert into Filter([name],icon,[count],parentId,filterCategoryId)
values('500-1000元','',0,0,1000)
insert into Filter([name],icon,[count],parentId,filterCategoryId)
values('1000元以上','',0,0,1000)
go
View Code

1.B.1.2, sales.sql

use YinTai
go
-- drop table [Action]
-- =============================================
-- table:热销产品
-- =============================================
create table [Action]
(
actionId int primary key identity(100,1),    --编号【PK,ID】
[type] int,    --类型 1=奢华名品频道;2=品牌街频道
title varchar(200),    --标题
imageUrl varchar(500),    --图片地址
titleContent varchar(200),    --标题内容
searchCondition varchar(200),    --搜索条件
saleType int    --销售类型 1=奢华名品 2=品牌街
)
go
--1=奢华名品
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',1)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',1)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',1)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',1)
--2=品牌街
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',2)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',2)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',2)
insert into [Action]([type],title,imageUrl,titleContent
,searchCondition,saleType)
values(1,'coach','http://yrs.yintai.com/rs/img/AppCMS/20140121164004_coach.jpg','coach'
,'50000488',2)
go
-- drop table Coupon
-- =============================================
-- table:优惠劵
-- =============================================
create table Coupon
(
couponId int primary key identity,    --编号【PK,ID】
[name] varchar(200),    --活动名称
[desc] varchar(500),    --类型
channel varchar(200),    --渠道
code varchar(200),    --编号
--validTime datetime,    --使用时间
startTime datetime,    --开始时间
endTime datetime,    --结束时间
activeTime datetime,    --激活时间
[status] int,    --0:未使用;1:已使用;2:已过期
accountId int,    --账号ID【FK】
[enable] bit --状态 0:正常;1:禁用
)
go
insert into Coupon([name],[desc],channel,code
,startTime,endTime,activeTime,[status],accountId
,[enable])
values('10元券','全场可以','奖励','YT0001'
,'2014-7-1','2015-7-1','2014-8-1',0,100001
,0)
insert into Coupon([name],[desc],channel,code
,startTime,endTime,activeTime,[status],accountId
,[enable])
values('10元券','全场可以','奖励','YT0002'
,'2014-7-1','2015-7-1','2014-8-1',1,100001
,0)
go
-- =============================================
-- table:过滤
-- =============================================
create table Filter
(
[name] varchar(200),
value varchar(200),
icon varchar(500),
[count] int,
parentId int
)
go
-- =============================================
-- table:楼层
-- =============================================
go
-- drop table Invoice
-- =============================================
-- table:发票
-- =============================================
create table Invoice
(
invoiceId int primary key identity(1000,1),    --编号【PK,ID】
invoiceType int,    --发票类型 -1:不开发票;0:个人;1:公司
invoiceTypeText varchar(200),
invoiceTitle varchar(200),    --发票抬头
invoiceSubject int, --发票科目 1=商品明细、2=服装、3=皮具、4=箱包、5=化妆品、6=鞋、7=饰品、8=家居用品、9=珠宝
accountId int    --账号ID【FK】
)
go
-- =============================================
-- table:Promoption2 商品详情-促销信息
-- table:PropertyDescription 属性描述
-- table:Property 属性信息
-- =============================================
create table Promoption2
(
[name] varchar(200),
[desc] varchar(200)
)
go
-- =============================================
-- table:应用推荐
-- =============================================
create table Recmommend
(
downloadUrl varchar(500),
icon varchar(500),
[name] varchar(200),
introduce varchar(500)    --说明
)
go
-- =============================================
-- table:归纳为
-- =============================================
create table Reduce
(
[id] int,
[name] varchar(200)
)
go
-- =============================================
-- table:商品
-- =============================================
go
-- =============================================
-- table:商品类别楼层
-- =============================================
create table [Floor]
(
floorId int primary key identity(100,1),    --编号【PK,ID】
floorTitle varchar(200),    --楼层标题
sort int,    --显示顺序
shopId int,    --商铺ID【FK】
[enable] bit --状态 0:正常;1:禁用
)
go
insert into [Floor](floorTitle,sort,shopId,[enable]) values('女装',1,10001,0)
insert into [Floor](floorTitle,sort,shopId,[enable]) values('男装',2,10001,0)
insert into [Floor](floorTitle,sort,shopId,[enable]) values('美妆',3,10001,0)
insert into [Floor](floorTitle,sort,shopId,[enable]) values('家居',4,10001,0)
insert into [Floor](floorTitle,sort,shopId,[enable]) values('运动',5,10001,0)
go
-- =============================================
-- table:图片事件
-- refer:Floor
-- =============================================
create table ImageAction
(
imageActionId int primary key identity(100,1),
[type] varchar(200),    --行动类型
titleContent varchar(200),    --标题内容
searchCondition varchar(200),    --搜索条件
floorId int,    --类型分类ID【FK】
shopId int,    --商铺ID【FK】
[enable] bit --状态 0:正常;1:禁用
)
go
insert into ImageAction([type],titleContent,searchCondition,floorId
,shopId,[enable]) values('1','女装五折封顶','10000742%2b8010050',100
,10001,0)
-- drop table Line
-- =============================================
-- table:图片事件
-- refer:Floor
-- =============================================
go
create table Line
(
lineId int primary key identity(100,1),
[type] int,    --行动类型
--color varchar(200),        --颜色
title varchar(200),    --标题
searchCondition varchar(200),    --搜索条件
floorId int,    --类型分类ID【FK】
shopId int,    --商铺ID【FK】
[enable] bit --状态 0:正常;1:禁用
)
go
insert into Line([type],title,searchCondition,floorId
,shopId,[enable]) values(1,'牛仔裤','10000742%2b8010050',100
,10001,0)
insert into Line([type],title,searchCondition,floorId
,shopId,[enable]) values(1,'牛仔裤','10000742%2b8010050',100
,10001,0)
-- =============================================
-- table:轮播图列表 ? typeArgu
-- =============================================
create table Slider
(
sliderId int primary key identity(100,1),    --编号【PK,ID】
[type] varchar(200),    --行动类型
imageUrl varchar(500),    --图片地址
titleContent varchar(200),    --标题内容
searchCondition varchar(200),    --搜索条件
--beginDate datetime,    --开始日期
--endDate datetime,    --截至日期
shopId int,    --商铺ID【FK】
[enable] bit --状态 0:正常;1:禁用
)
go
insert into Slider([type],imageUrl,titleContent,searchCondition,shopId,[enable])
values('1','http://yrs.yintai.com/rs/img/AppCMS/20140722100004_shoes.jpg','时尚单鞋','10000844%2b70001652%3A60152864%2b8010050',10001,0)
insert into Slider([type],imageUrl,titleContent,searchCondition,shopId,[enable])
values('1','http://yrs.yintai.com/rs/img/AppCMS/20140722100004_shoes.jpg','时尚单鞋','10000844%2b70001652%3A60152864%2b8010050',10001,0)
insert into Slider([type],imageUrl,titleContent,searchCondition,shopId,[enable])
values('1','http://yrs.yintai.com/rs/img/AppCMS/20140722100004_shoes.jpg','时尚单鞋','10000844%2b70001652%3A60152864%2b8010050',10001,0)
insert into Slider([type],imageUrl,titleContent,searchCondition,shopId,[enable])
values('1','http://yrs.yintai.com/rs/img/AppCMS/20140722100004_shoes.jpg','时尚单鞋','10000844%2b70001652%3A60152864%2b8010050',10001,0)
insert into Slider([type],imageUrl,titleContent,searchCondition,shopId,[enable])
values('19','http://yrs.yintai.com/rs/img/AppCMS/20140716135232_H5.jpg','快店','http://k-d.cc/help/about',10001,0)
go
-- drop table ShoppingCartTotal
-- =============================================
-- table:购物车 清单
-- =============================================
--create table ShoppingCartTotal
--(
--shoppingCartTotalId int primary key identity(100,1),    --编号【PK,ID】
--itemCount int,    --项目数量
--amount decimal(8,2),    --总金额
--discount decimal(8,2),    --总优惠
--freightDiscount varchar(200),    --运费
--accountId int    --账户ID【FK】
--)
go
-- drop table ShoppingCart
-- =============================================
-- table: 购物车
-- =============================================
create table ShoppingCart
(
shoppingCartId int primary key identity(100,1),    --编号【PK,ID】
itemCode int,    --商品编号
[count] int,    --数量
[type] int,    --类型
paramId int,    --参数
accountId int    --账户ID【FK】
)

go
-- drop table settlement
-- =============================================
-- table: 结算
-- =============================================
create table Settlement
(
settlementId int primary key identity(100000,1),    --编号【PK,ID】
itemCount int,    --项目数量
amount decimal(8,2),    --总金额
discount decimal(8,2),    --总优惠
freight decimal(8,2),    --运费
point int,    --获赠积分
payModeCode int,    --支付方式
accountId int    --账户ID【FK】
)
go
-- =============================================
-- table:公告 ? desc
-- =============================================
create table Annuouncement
(
url varchar(500)
)
View Code

1.B.2,

1.C,功能实现代码(Function Implementation Code)返回顶部

 

warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
posted on 2014-12-31 14:49  ylbtech  阅读(714)  评论(0编辑  收藏  举报