1、 catalog:商品类别表 catalogplus:商品类别子表 delivery:邮递方式表 member:用户表 memberlevel:用户级别表 news:新闻表 pay:支付方式表 pevaluate:商品评论表 porder:定单表 porderline:定单详细表 product:商品表 productgroup:商品群组表 productgroupmap:商品群组关系表2.2、使用它的程序 Connection Pool Hibernate 3.2 Spring 2.02.3、约定2.3.1、实体表命名表以名词或名词短语命名,确定表名是采用复数还是单数形式,此外给表的别名定义
2、简单规则(比方说,如果表名是一个单词,别名就取单词的前4个字母;如果表名是两个单词,就各取两个单词的前两个字母组成4个字母长的别名;如果表的名字由3个单词组成,从头两个单词中各取一个,然后从最后一个单词中再取出两个字母,结果还是组成4字母长的别名,其余依次类推)2.3.2、属性(列)的命名采用有意义的列名,表内的列要针对键采用一整套设计规则。每一个表都将有一个自动ID作为主健,逻辑上的主健作为第一组候选主健来定义,如果是数据库自动生成的编码,统一命名为:ID;如果是自定义的逻辑上的编码则用缩写加“ID”的方法命名。如果键是数字类型,你可以用_NO作为后缀;如果是字符类型则可以采用_CODE后缀
3、。对列名应该采用标准的前缀和后缀。2.3.3、视图的命名视图以V作为前缀,其他命名规则和表的命名类似命名应尽量体现各视图的功能2.3.4、其他注意事项以上命名都不得超过30个字符的系统限制。变量名的长度限制为29(不包括标识字符)数据对象、变量的命名都采用英文字符,禁止使用中文命名。绝对不要在对象名的字符之间留空格小心保留词,要保证你的字段名没有和保留词、数据库系统或者常用访问方法冲突保持字段名和类型的一致性,在命名字段并为其指定数据类型的时候一定要保证一致性。假如数据类型在一个表里是整数,那在另一个表里可就别变成字符型了2.4、支持软件MySQL 5.1数据库3、结构设计3.1、概念结构设计
4、3.2、逻辑结构设计3.2.1、管理员表3.2.2、管理员组权限关系3.2.3、地区3.2.4、子地区3.2.5、商品类别3.2.6、商品子类别3.2.7、邮递方式3.2.8、注册会员3.2.9、用户等级3.2.10、商城新闻3.2.11、商品评论3.2.12、支付方式3.2.13、订单3.2.14、订单明细3.2.15、商品组关系3.3、物理结构设计3.3.1、管理员表adid管理员id(自动增长)account管理员名称pwd管理员密码lastlogindate上次登陆时间postdate注册时间adgid所属的组ID管理员登陆时,使用account保存管理员登陆名称,pwd保存管理员登陆
5、密码管理员密码:admin创建脚本:DROP TABLE IF EXISTS admin;create table admin( adid int(13) unsigned AUTO_INCREMENT not null, account varchar(45) default NULL, pwd varchar(45) default NULL, lastlogindate datetime default NULL, postdate datetime default NULL, adgid int(13) unsigned default NULL, primary key (adid)
6、, key adgid (adgid) ;INSERT INTO admin (account,pwd,lastlogindate,postdate,adgid) VALUES (admin,21232F297A57A5A743894A0E4A801FC3,2006-08-10 17:32:50,2006-07-22 14:04:23,1);3.3.2、管理员组表管理员组ID(自动增长)name管理员组名称description描述DROP TABLE IF EXISTS admingroup ;create table admingroup adgid int(13) unsigned AU
7、TO_INCREMENT not null, name varchar(45) default NULL, description varchar(200) default NULL, primary key (adgid)INSERT INTO admingroup (name,description) VALUES (超级管理员,NULL);3.3.3、管理员组权限关系表管理员组IDataid管理员权限IDDROP TABLE IF EXISTS admingroupauth;create table admingroupauth adgid int(13) unsigned not nu
8、ll default 0, ataid int(13) unsigned not null default 0, primary key (adgid, ataid)INSERT INTO admingroupauth (adgid,ataid) VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1,6), (1,7), (1,8), (1,9), (1,10), (1,11), (1,12), (1,13), (1,14), (1,15);3.3.4、管理员组权限表管理员组权限表权限ID(自动增长)type权限类型权限名称DROP TABLE IF EXI
9、STS authenticationaction;create table authenticationaction ataid int(10) unsigned not null AUTO_INCREMENT, type int(3) unsigned not null default 0, description varchar(255) default NULL, primary key (ataid)INSERT INTO authenticationaction (type,description) VALUES (1,发布商品), (1,商品管理), (1,商品群组), (2,评论
10、管理), (2,货架管理), (3,订单管理), (4,支付管理), (5,配送管理), (6,会员管理), (6,级别管理), (6,地区管理), (7,发布新闻), (7,新闻管理), (8,账号管理), (8,权限管理);3.3.5、地区表id地区ID(自动增长)title标题DROP TABLE IF EXISTS area;create table area id int AUTO_INCREMENT PRIMARY KEY NOT NULL, title varchar(100) NOT NULLINSERT INTO area (title) VALUES (其他), (北京),
11、 (重庆), (福建), (甘肃), (广东), (广西), (贵州), (海南), (河北), (黑龙江), (河南), (香港), (湖北), (湖南), (江苏), (江西), (吉林), (辽宁), (澳门), (内蒙古), (宁夏), (青海), (山东), (上海), (山西), (陕西), (四川), (台湾), (天津), (新疆), (西藏), (云南), (浙江), (安徽);3.3.6、地区子表地区子表ID(自动增长)upid地区表id子地区名称DROP TABLE IF EXISTS areaplus;CREATE TABLE areaplus ( id INT AUT
12、O_INCREMENT PRIMARY KEY NOT NULL, upid INT NOT NULL, title varchar(100) default NULL , foreign key (upid) references area (id) on delete cascadeINSERT INTO areaplus (upid,title) VALUES (35,合肥), (35,安庆), (35,蚌埠), (35,亳州), (35,巢湖), (35,滁州), (35,阜阳), (35,贵池), (35,淮北), (35,淮化), (35,淮南), (35,黄山), (35,九华山
13、), (35,六安), (35,马鞍山), (35,宿州), (35,铜陵), (35,屯溪), (35,芜湖), (35,宣城), (2,北京), (3,重庆), (4,福州), (4,福安), (4,龙岩), (4,南平), (4,宁德), (4,莆田), (4,泉州), (4,三明), (4,邵武), (4,石狮), (4,永安), (4,武夷山), (4,厦门), (4,漳州), (5,兰州), (5,白银), (5,定西), (5,敦煌), (5,甘南), (5,金昌); (5,酒泉), (5,临夏), (5,平凉), (5,天水), (5,武都), (5,武威), (5,西峰),
14、(5,张掖), (6,广州), (6,潮阳), (6,潮州), (6,澄海), (6,东莞), (6,佛山), (6,河源), (6,惠州), (6,江门), (6,揭阳), (6,开平), (6,茂名), (6,梅州), (6,清远), (6,汕头), (6,汕尾), (6,韶关), (6,深圳), (6,顺德), (6,阳江), (6,英德), (6,云浮), (6,增城), (6,湛江), (6,肇庆), (6,中山), (6,珠海), (7,南宁); (7,百色), (7,北海), (7,桂林), (7,防城港), (7,河池), (7,贺州), (7,柳州), (7,钦州), (7,
15、梧州), (7,玉林), (8,贵阳), (8,安顺), (8,毕节), (8,都匀), (8,凯里), (8,六盘水), (8,铜仁), (8,兴义), (8,玉屏), (8,遵义), (9,海口), (9,儋县), (9,陵水), (9,琼海), (9,三亚), (9,五指山), (9,万宁), (10,石家庄), (10,保定), (10,北戴河), (10,沧州), (10,承德), (10,丰润), (10,邯郸), (10,衡水), (10,廊坊); (10,南戴河), (10,秦皇岛), (10,唐山), (10,新城), (10,邢台), (10,张家口), (11,哈尔滨),
16、 (11,北安), (11,大庆), (11,大兴安岭), (11,鹤岗), (11,黑河), (11,佳木斯), (11,鸡西), (11,牡丹江), (11,齐齐哈尔), (11,七台河), (11,双鸭山), (11,绥化), (11,伊春), (12,郑州), (12,安阳), (12,鹤壁), (12,潢川), (12,焦作), (12,济源), (12,开封), (12,漯河), (12,洛阳), (12,南阳), (12,平顶山), (12,濮阳), (12,三门峡), (12,商丘), (12,新乡); (12,信阳), (12,许昌), (12,周口), (12,驻马店),
17、(13,香港), (13,九龙), (13,新界), (14,武汉), (14,恩施), (14,鄂州), (14,黄冈), (14,黄石), (14,荆门), (14,荆州), (14,潜江), (14,十堰), (14,随州), (14,武穴), (14,仙桃), (14,咸宁), (14,襄阳), (14,襄樊), (14,孝感), (14,宜昌), (15,长沙), (15,常德), (15,郴州), (15,衡阳), (15,怀化), (15,吉首), (15,娄底), (15,邵阳), (15,湘潭), (15,益阳), (15,岳阳), (15,永州); (15,张家界), (1
18、5,株洲), (16,南京), (16,常熟), (16,常州), (16,海门), (16,淮安), (16,江都), (16,江阴), (16,昆山), (16,连云港), (16,南通), (16,启东), (16,沭阳), (16,宿迁), (16,苏州), (16,太仓), (16,泰州), (16,同里), (16,无锡), (16,徐州), (16,盐城), (16,扬州), (16,宜兴), (16,仪征), (16,张家港), (16,镇江), (16,周庄), (17,南昌), (17,抚州), (17,赣州), (17,吉安), (17,景德镇), (17,井冈山), (
19、17,九江), (17,庐山); (17,萍乡), (17,上饶), (17,新余), (17,宜春), (17,鹰潭), (18,长春), (18,白城), (18,白山), (18,珲春), (18,辽源), (18,梅河), (18,吉林), (18,四平), (18,松原), (18,通化), (18,延吉), (19,沈阳), (19,鞍山), (19,本溪), (19,朝阳), (19,大连), (19,丹东), (19,抚顺), (19,阜新), (19,葫芦岛), (19,锦州), (19,辽阳), (19,盘锦), (19,铁岭), (19,营口), (20,澳门), (21
20、,呼和浩特), (21,阿拉善盟), (21,包头), (21,赤峰), (21,东胜); (21,海拉尔), (21,集宁), (21,临河), (21,通辽), (21,乌海), (21,乌兰浩特), (21,锡林浩特), (22,银川), (22,固原), (22,石嘴山), (22,吴忠), (23,西宁), (23,德令哈), (23,格尔木), (23,共和), (23,海东), (23,海晏), (23,玛沁), (23,同仁), (23,玉树), (24,济南), (24,滨州), (24,兖州), (24,德州), (24,东营), (24,菏泽), (24,济宁), (24
21、,莱芜), (24,聊城), (24,临沂), (24,蓬莱), (24,青岛), (24,曲阜), (24,日照), (24,泰安); (24,潍坊), (24,威海), (24,烟台), (24,枣庄), (24,淄博), (25,上海), (25,崇明), (25,朱家角), (26,太原), (26,长治), (26,大同), (26,候马), (26,晋城), (26,离石), (26,临汾), (26,宁武), (26,朔州), (26,忻州), (26,阳泉), (26,榆次), (26,运城), (27,西安), (27,安康), (27,宝鸡), (27,汉中), (27,渭
22、南), (27,商州), (27,绥德), (27,铜川), (27,咸阳), (27,延安), (27,榆林), (28,成都), (28,巴中), (28,达州), (28,德阳); (28,都江堰), (28,峨眉山), (28,涪陵), (28,广安), (28,广元), (28,九寨沟), (28,康定), (28,乐山), (28,泸州), (28,马尔康), (28,绵阳), (28,眉山), (28,南充), (28,内江), (28,攀枝花), (28,遂宁), (28,汶川), (28,西昌), (28,雅安), (28,宜宾), (28,自贡), (28,资阳), (29
23、,台北), (29,基隆), (29,台南), (29,台中), (30,天津), (31,乌鲁木齐), (31,阿克苏), (31,阿勒泰), (31,阿图什), (31,博乐), (31,昌吉), (31,东山), (31,哈密); (31,和田), (31,喀什), (31,克拉玛依), (31,库车), (31,库尔勒), (31,奎屯), (31,石河子), (31,塔城), (31,吐鲁番), (31,伊宁), (32,拉萨), (32,阿里), (32,昌都), (32,林芝), (32,那曲), (32,日喀则), (32,山南), (33,昆明), (33,大理), (33,
24、保山), (33,楚雄), (33,东川), (33,个旧), (33,景洪), (33,开远), (33,临沧), (33,丽江), (33,六库), (33,潞西), (33,曲靖), (33,思茅), (33,文山), (33,西双版纳), (33,玉溪); (33,中甸), (33,昭通), (34,杭州), (34,安吉), (34,慈溪), (34,定海), (34,奉化), (34,海盐), (34,黄岩), (34,湖州), (34,嘉兴), (34,金华), (34,临安), (34,临海), (34,丽水), (34,宁波), (34,瓯海), (34,平湖), (34,千岛湖), (34,衢州), (34,江山), (34,瑞安), (34,绍兴), (34,嵊州), (34,台州), (34,温岭), (34,温州), (34,舟山), (1,其他);3.3.7、商品类别表类别编号(自动增长)类别名称img类别图片类别描述
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1