加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
booksdb.sql 22.82 KB
一键复制 编辑 原始数据 按行查看 历史
Soar628 提交于 2022-05-28 17:02 . 上传数据库文件
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50724
Source Host : localhost:3306
Source Database : booksdb
Target Server Type : MYSQL
Target Server Version : 50724
File Encoding : 65001
Date: 2022-04-19 13:51:58
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for book
-- ----------------------------
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '书籍编号',
`typeId` int(11) NOT NULL COMMENT '书籍类型编号',
`bname` varchar(255) NOT NULL COMMENT '书籍名称',
`price` float(10,2) NOT NULL COMMENT '单价',
`desc` varchar(500) NOT NULL COMMENT '简介',
`pic` varchar(100) NOT NULL COMMENT '图片',
`publish` varchar(50) NOT NULL COMMENT '出版社',
`author` varchar(50) NOT NULL COMMENT '作者',
`stock` int(11) NOT NULL COMMENT '库存',
`address` varchar(500) DEFAULT NULL COMMENT '地址',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1014 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of book
-- ----------------------------
INSERT INTO `book` VALUES ('1001', '10', '罗小黑战记', '39.90', '雨夜,一只流落街头的小黑猫被少女罗小白带回家,起名罗小黑。\r\n\r\n  罗小黑不是一只普通的猫咪,它极通人性,会蹲马桶,不吃猫粮,长长的尾巴甚至能分裂成多个名为“黑咻”的生物体。与此同时,名为“谛听”的神秘人物,发动手下三匹长着翅膀的狼,搜寻着罗小黑的下落。\r\n\r\n  不久,罗小白带着小黑到乡下探望堂哥阿根和爷爷,由此发生了种种离奇玄幻事件……', 'lib/Images/cover/101-1.png', '北京联合出版社', 'MTJJ', '99', '东区-01-02');
INSERT INTO `book` VALUES ('1002', '8', '百年孤独', '49.60', '多年以后,奥雷连诺上校站在行刑队面前,准会想起父亲带他去参观\r\n冰块的那个遥远的下午。当时,马孔多是个二十户人家的村庄,一座座土\r\n房都盖在河岸上,河水清澈,沿着遍布石头的河床流去,河里的石头光滑\r\n、洁白,活象史前的巨蛋。这块天地还是新开辟的,许多东西都叫不出名\r\n字,不得不用手指指点点。每年三月,衣衫褴楼的吉卜赛人都要在村边搭\r\n起帐篷,在笛鼓的喧嚣声中,向马孔多的居民介绍科学家的新发明。他\r\n们首先带来的是磁铁。一个身躯高大的吉卜赛人,自称梅尔加德斯,满脸\r\n络腮胡子,手指瘦得象鸟的爪子,向观众出色地表演了他所谓的马其顿炼\r\n金术士创造的世界第八奇迹。', 'lib/Images/cover/101-3.png', '东海出版社', '加西亚·马尔克斯儿', '45', '西区-03-56');
INSERT INTO `book` VALUES ('1003', '7', '平凡的世界', '25.00', '他一个人在山里劳动歇息的时候,头枕手掌仰面躺在黄土地上,长久地望着高远的蓝天和悠悠飘飞的白云,眼里便会莫名地盈满了泪水。\r\n\r\n山野寂静无声,甚至能听见自己鬓角的血管在哏哏地跳动。这样的时候,他记忆的风帆会反复驶进往日的岁月。石圪节中学、原西县高中……尽管那时饥肠辘辘,有无数的愁苦,但现在想起来,那倒是他一生中度过的美妙的时光。他也不时地想起高中时班上的同学们:金波、顾养民、郝红梅、田晓霞、侯玉英……眼下,这些人都各走了各的路。金波正在黄原跟他父亲学开汽车。红梅和他一样,回村后当了小学教师,听说现在仍然当着。侯玉英的情况他现在不很清楚—他和跛女子早已断绝了“关系”。顾养民和田晓霞如同学们预料的那样,去年秋天都考上了大学。养民如愿地考进了省医学院,晓霞进了黄原师专中文系。', 'lib/Images/cover/20220401223512782.png', '北京十月文艺出版社', '路遥', '97', '东区-01-04');
INSERT INTO `book` VALUES ('1004', '7', '活着', '35.00', '我比现在年轻十岁的时候,获得了一个游手好闲的职业,去乡间收集民间歌谣。那一年的整个夏天,我如同一只乱飞', 'lib/Images/cover/101-5.png', '北京十月文艺出版社', '余华', '35', '东区-01-11');
INSERT INTO `book` VALUES ('1005', '7', '文城', '29.50', '关于一个人和他一生的寻找\r\n以及一群人和一个汹涌的年代\r\n“文城在哪里?”\r\n“总会有一个地方叫文城。”\r\n◆在溪镇人ZUI初的印象里,林祥福是一个身上披戴雪花,头发和胡子遮住脸庞的男人,有着垂柳似的谦卑和田地般的沉默寡言。哪怕后来成了万亩荡和木器社的主人,他身上的谦卑和沉默依旧没有变。他的过去和一座谜一样的城联系在了一起,没人知道他为什么要找一个不存在的地方。\r\n他原本不属于这里,他的家乡在遥远的北方。为了一个承诺他将自己连根拔起,漂泊至此。往后的日子,他见识过温暖赤诚的心,也见识过冰冷无情的血。ZUI终他徒劳无获,但许多人的牵挂和眼泪都留在了他身上。\r\n北京十月文艺出版社', 'lib/Images/cover/101-4.png', '北京十月文艺出版社', '余华', '51', '东区-01-36');
INSERT INTO `book` VALUES ('1006', '10', '白鹿原', '34.90', '主人公六娶六丧,神秘的序曲预示着不祥。', 'lib/Images/cover/20220401160032777.png', '人民文学出版社', '陈忠实', '100', '东区-01-04');
INSERT INTO `book` VALUES ('1009', '7', '蛤蟆先生去看心理医生', '39.00', '蛤蟆先生一向爱笑爱闹,如今却一反常态地郁郁寡欢。他一个人躲在屋里,连起床梳洗的力气都没有。朋友们非常担心他,建议他去做心理咨询。在10次心理咨询中,蛤蟆在咨询师苍鹭的带领下,勇敢地探索了自己的内心世界,也逐渐找回了信心与希望……', 'lib/Images/cover/20220403010131972.png', '天津人民出版社', '罗伯特·戴博德', '49', '东区-01-04');
INSERT INTO `book` VALUES ('1010', '17', '中国漫画史', '58.90', '《中国漫画史》研究与介绍中国古代、近现代及当代漫画发展历史,图文并茂,精心梳理了历史上的中国漫画,读者可以通过《中国漫画史》对中国的漫画的产生、发展、演进有一个清晰的了解。', 'lib/Images/cover/20220406125936133.png', '山东画报出版社', '甘险峰', '50', '东区-10-14');
INSERT INTO `book` VALUES ('1013', '19', '法律的细节', '49.80', '《法治的细节》是中国政法大学法学教授罗翔全新的法学随笔,面向大众读者,从热点案件解读、法学理念科普、经典名著讲解等6大板块', 'lib/Images/cover/20220408153543714.png', '云南人民出版社 ', '罗翔', '49', '东区-01-16');
-- ----------------------------
-- Table structure for booktype
-- ----------------------------
DROP TABLE IF EXISTS `booktype`;
CREATE TABLE `booktype` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '图书类型编号',
`tname` varchar(50) NOT NULL COMMENT '图书类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of booktype
-- ----------------------------
INSERT INTO `booktype` VALUES ('2', '哲学、宗教');
INSERT INTO `booktype` VALUES ('3', '社会学');
INSERT INTO `booktype` VALUES ('4', '数理科学和化学');
INSERT INTO `booktype` VALUES ('5', '计算机语言');
INSERT INTO `booktype` VALUES ('6', '医药、卫生');
INSERT INTO `booktype` VALUES ('7', '文学');
INSERT INTO `booktype` VALUES ('8', '艺术');
INSERT INTO `booktype` VALUES ('9', '历史地理');
INSERT INTO `booktype` VALUES ('10', '小说');
INSERT INTO `booktype` VALUES ('11', '编程语言');
INSERT INTO `booktype` VALUES ('13', '史学');
INSERT INTO `booktype` VALUES ('15', '心理学');
INSERT INTO `booktype` VALUES ('17', '漫画');
INSERT INTO `booktype` VALUES ('19', '法学');
INSERT INTO `booktype` VALUES ('20', '哇哇哇');
-- ----------------------------
-- Table structure for member
-- ----------------------------
DROP TABLE IF EXISTS `member`;
CREATE TABLE `member` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '会员卡号',
`mname` varchar(50) NOT NULL COMMENT '会员名称',
`pwd` varchar(50) NOT NULL COMMENT '密码',
`sex` varchar(50) NOT NULL COMMENT '性别',
`typeId` int(11) NOT NULL COMMENT '会员类型id',
`userId` int(11) NOT NULL COMMENT '用户权限id',
`balance` double(11,0) NOT NULL COMMENT '余额',
`regdate` date NOT NULL COMMENT '注册日期',
`tel` char(15) NOT NULL COMMENT '电话',
`idNumber` char(18) NOT NULL COMMENT '身份证',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2022024 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of member
-- ----------------------------
INSERT INTO `member` VALUES ('2022000', 'super', '123456', '男', '3', '1', '100', '2022-03-28', '15871587872', '420600199906280000');
INSERT INTO `member` VALUES ('2022001', '苏星', '159', '女', '1', '2', '200', '2022-03-28', '15975312114', '304060019990202199');
INSERT INTO `member` VALUES ('2022002', '袁华', '111', '男', '1', '2', '168', '2022-03-30', '15871513833', '420600199906283355');
INSERT INTO `member` VALUES ('2022003', '李四', '123', '男', '2', '2', '230', '2022-03-30', '14725836911', '123456789104563214');
INSERT INTO `member` VALUES ('2022004', '王五', '147', '女', '2', '2', '211', '2022-03-30', '15975312311', '420621199912031425');
INSERT INTO `member` VALUES ('2022005', '陈晓', '323121', '女', '1', '2', '100', '2022-03-30', '15224487872', '420600199906280000');
INSERT INTO `member` VALUES ('2022006', '许巍', '1231312', '男', '2', '2', '200', '2022-03-30', '153211345', '632323190605266902');
INSERT INTO `member` VALUES ('2022007', '王栋', '12312', '女', '3', '2', '405', '2022-03-30', '11353872456', '632323190605263082');
INSERT INTO `member` VALUES ('2022008', '郝人', '5436', '男', '1', '2', '100', '2022-03-30', '18843473189', '632323190605260308');
INSERT INTO `member` VALUES ('2022009', '郭大师', '25325', '男', '2', '2', '200', '2022-03-30', '18548394154', '420600199906282321');
INSERT INTO `member` VALUES ('2022010', '德鲁伊', '5432', '男', '2', '2', '200', '2022-03-30', '17262657962', '632323190605264843');
INSERT INTO `member` VALUES ('2022011', '李丽', '111', '女', '1', '2', '400', '2022-03-30', '15872214822', '140105199303070934');
INSERT INTO `member` VALUES ('2022012', '王闪火', '111', '男', '1', '2', '44', '2022-04-03', '15914725833', '420621199402052514');
INSERT INTO `member` VALUES ('2022013', '比伯', '111', '男', '2', '2', '200', '2022-04-05', '13201238695', '420621199502050301');
INSERT INTO `member` VALUES ('2022014', '刘焉', '123456', '男', '1', '2', '112', '2022-04-06', '13224561455', '426621199806251524');
INSERT INTO `member` VALUES ('2022015', '王莽', '111', '男', '1', '2', '100', '2022-04-07', '15971127845', '420621199406213211');
INSERT INTO `member` VALUES ('2022016', '李白', '123456', '男', '2', '2', '199', '2022-04-07', '13524561454', '426621199806251522');
INSERT INTO `member` VALUES ('2022017', '黄盖', '123', '男', '2', '2', '200', '2022-04-07', '15974512324', '426621199806251412');
INSERT INTO `member` VALUES ('2022018', '朱恒', '111', '男', '1', '2', '89', '2022-04-08', '15875214462', '412632199902145623');
INSERT INTO `member` VALUES ('2022019', '赵数', '111', '男', '1', '2', '100', '2022-04-08', '15872218588', '420621199906280634');
INSERT INTO `member` VALUES ('2022021', '李名', '123456', '男', '1', '2', '100', '2022-04-08', '15872218522', '420621199906280645');
INSERT INTO `member` VALUES ('2022022', '张飞', '123456', '男', '1', '2', '66', '2022-04-18', '15872218545', '42062119980200000');
INSERT INTO `member` VALUES ('2022023', '罗永浩', '123456', '男', '1', '2', '100', '2022-04-19', '13207238585', '421612199402050110');
-- ----------------------------
-- Table structure for membertype
-- ----------------------------
DROP TABLE IF EXISTS `membertype`;
CREATE TABLE `membertype` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '会员类型编号',
`mtname` varchar(255) NOT NULL COMMENT '会员类型',
`amount` int(11) NOT NULL COMMENT '可借书数量',
`discount` double(11,0) NOT NULL COMMENT '折扣',
`rechange` int(11) NOT NULL COMMENT '充值最低额',
`keepDay` int(11) NOT NULL COMMENT '借书天数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of membertype
-- ----------------------------
INSERT INTO `membertype` VALUES ('1', '普通会员', '5', '100', '100', '30');
INSERT INTO `membertype` VALUES ('2', '白银会员', '8', '80', '200', '60');
INSERT INTO `membertype` VALUES ('3', '黄金会员', '15', '50', '400', '90');
-- ----------------------------
-- Table structure for record
-- ----------------------------
DROP TABLE IF EXISTS `record`;
CREATE TABLE `record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '记录编号',
`memberId` int(11) NOT NULL COMMENT '会员编号 外键',
`bookId` int(11) NOT NULL COMMENT '书籍编号 外键',
`rentDate` date NOT NULL COMMENT '借阅时间',
`backDate` date DEFAULT NULL COMMENT '归还时间',
`deposit` float(11,0) DEFAULT NULL COMMENT '金额',
`userId` int(11) NOT NULL COMMENT '处理权限编号',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of record
-- ----------------------------
INSERT INTO `record` VALUES ('1', '2022001', '1001', '2022-02-02', '2022-03-28', '0', '1');
INSERT INTO `record` VALUES ('2', '2022001', '1003', '2022-04-04', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('3', '2022001', '1005', '2022-04-04', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('4', '2022001', '1002', '2022-04-03', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('5', '2022001', '1004', '2022-04-04', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('6', '2022012', '1002', '2022-04-03', null, '15', '1');
INSERT INTO `record` VALUES ('7', '2022012', '1003', '2022-04-03', null, '41', '1');
INSERT INTO `record` VALUES ('8', '2022012', '1009', '2022-04-03', null, '12', '1');
INSERT INTO `record` VALUES ('9', '2022002', '1002', '2022-04-05', '2022-04-05', '0', '1');
INSERT INTO `record` VALUES ('10', '2022002', '1003', '2022-04-04', '2022-04-05', '0', '1');
INSERT INTO `record` VALUES ('11', '2022003', '1003', '2022-04-04', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('12', '2022003', '1004', '2022-04-04', '2022-04-04', '0', '1');
INSERT INTO `record` VALUES ('13', '2022001', '1002', '2022-04-05', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('14', '2022001', '1003', '2022-04-05', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('15', '2022002', '1002', '2022-04-05', '2022-04-05', '0', '1');
INSERT INTO `record` VALUES ('16', '2022002', '1001', '2022-04-05', '2022-04-05', '0', '1');
INSERT INTO `record` VALUES ('17', '2022002', '1003', '2022-04-05', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('18', '2022002', '1004', '2022-04-05', '2022-04-05', '0', '1');
INSERT INTO `record` VALUES ('19', '2022001', '1001', '2022-04-05', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('20', '2022001', '1004', '2022-04-05', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('21', '2022003', '1002', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('22', '2022003', '1003', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('23', '2022003', '1003', '2022-04-06', '2022-04-06', '0', '2');
INSERT INTO `record` VALUES ('24', '2022003', '1004', '2022-04-07', null, '10', '2');
INSERT INTO `record` VALUES ('25', '2022003', '1002', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('26', '2022004', '1001', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('27', '2022004', '1002', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('28', '2022004', '1009', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('29', '2022004', '1004', '2022-04-06', '2022-04-06', '0', '1');
INSERT INTO `record` VALUES ('30', '2022001', '1010', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('31', '2022001', '1001', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('32', '2022001', '1002', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('33', '2022001', '1002', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('34', '2022001', '1003', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('35', '2022001', '1004', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('36', '2022001', '1005', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('37', '2022002', '1004', '2022-04-07', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('38', '2022002', '1003', '2022-04-07', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('39', '2022002', '1002', '2022-04-07', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('40', '2022002', '1001', '2022-04-07', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('41', '2022003', '1002', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('42', '2022001', '1002', '2022-04-07', '2022-04-07', '0', '1');
INSERT INTO `record` VALUES ('43', '2022018', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('44', '2022018', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('45', '2022018', '1004', '2022-04-08', null, '10', '2');
INSERT INTO `record` VALUES ('46', '2022019', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('47', '2022019', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('48', '2022001', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('49', '2022001', '1004', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('50', '2022001', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('51', '2022001', '1003', '2022-04-08', null, '41', '2');
INSERT INTO `record` VALUES ('52', '2022020', '1004', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('53', '2022020', '1004', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('54', '2022020', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('55', '2022020', '1001', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('56', '2022020', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('57', '2022020', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('58', '2022020', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('59', '2022020', '1004', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('60', '2022020', '1001', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('61', '2022020', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('62', '2022011', '1004', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('63', '2022011', '1003', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('64', '2022001', '1004', '2022-04-08', null, '10', '2');
INSERT INTO `record` VALUES ('65', '2022002', '1002', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('66', '2022021', '1013', '2022-04-08', '2022-04-08', '0', '1');
INSERT INTO `record` VALUES ('67', '2022021', '1002', '2022-04-10', '2022-04-10', '0', '1');
INSERT INTO `record` VALUES ('68', '2022021', '1003', '2022-04-10', '2022-04-10', '0', '1');
INSERT INTO `record` VALUES ('69', '2022003', '1002', '2022-04-18', null, '15', '1');
INSERT INTO `record` VALUES ('70', '2022003', '1001', '2022-04-18', null, '12', '1');
INSERT INTO `record` VALUES ('71', '2022022', '1001', '2022-04-18', '2022-04-18', '0', '1');
INSERT INTO `record` VALUES ('72', '2022022', '1002', '2022-04-18', '2022-04-18', '0', '1');
INSERT INTO `record` VALUES ('73', '2022022', '1001', '2022-04-18', '2022-04-18', '0', '1');
INSERT INTO `record` VALUES ('74', '2022022', '1002', '2022-04-18', '2022-04-18', '0', '1');
INSERT INTO `record` VALUES ('75', '2022022', '1004', '2022-04-18', null, '10', '2');
INSERT INTO `record` VALUES ('76', '2022022', '1005', '2022-04-18', null, '9', '2');
INSERT INTO `record` VALUES ('77', '2022022', '1013', '2022-04-18', null, '15', '1');
INSERT INTO `record` VALUES ('78', '2022002', '1003', '2022-04-18', null, '41', '2');
INSERT INTO `record` VALUES ('79', '2022002', '1004', '2022-04-18', null, '10', '2');
INSERT INTO `record` VALUES ('93', '2022022', '1003', '2022-04-19', '2022-04-19', '0', '1');
INSERT INTO `record` VALUES ('94', '2022007', '1002', '2022-04-19', '2022-04-19', '0', '1');
INSERT INTO `record` VALUES ('95', '2022007', '1001', '2022-04-19', '2022-04-19', '0', '1');
INSERT INTO `record` VALUES ('96', '2022007', '1002', '2022-04-19', '2022-04-19', '0', '1');
INSERT INTO `record` VALUES ('97', '2022023', '1013', '2022-04-19', '2022-04-19', '0', '1');
-- ----------------------------
-- Table structure for usertype
-- ----------------------------
DROP TABLE IF EXISTS `usertype`;
CREATE TABLE `usertype` (
`id` int(5) NOT NULL AUTO_INCREMENT COMMENT '用户id',
`power` varchar(50) NOT NULL DEFAULT '' COMMENT '用户权限',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of usertype
-- ----------------------------
INSERT INTO `usertype` VALUES ('1', '管理员');
INSERT INTO `usertype` VALUES ('2', '会员');
-- ----------------------------
-- View structure for recordview
-- ----------------------------
DROP VIEW IF EXISTS `recordview`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `recordview` AS select `r`.`id` AS `id`,`r`.`memberId` AS `memberId`,`m`.`mname` AS `memberName`,`mt`.`mtname` AS `mtname`,`b`.`bname` AS `bookName`,`bt`.`tname` AS `tname`,`b`.`author` AS `author`,`b`.`stock` AS `stock`,date_format(`r`.`rentDate`,'%Y-%m-%d') AS `rentDate`,date_format(`r`.`backDate`,'%Y-%m-%d') AS `backDate`,(`r`.`rentDate` + interval `mt`.`keepDay` day) AS `returnDate`,`r`.`deposit` AS `deposit`,`r`.`userId` AS `userId` from ((((`record` `r` join `member` `m`) join `book` `b`) join `membertype` `mt`) join `booktype` `bt`) where ((`r`.`memberId` = `m`.`id`) and (`r`.`bookId` = `b`.`id`) and (`m`.`typeId` = `mt`.`id`) and (`b`.`typeId` = `bt`.`id`)) ;
-- ----------------------------
-- View structure for selecttypeview
-- ----------------------------
DROP VIEW IF EXISTS `selecttypeview`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `selecttypeview` AS select `a`.`id` AS `id`,`a`.`bname` AS `bname`,`a`.`typeId` AS `typeId`,`b`.`tname` AS `tname`,`a`.`price` AS `price`,`a`.`desc` AS `desc`,`a`.`pic` AS `pic`,`a`.`publish` AS `publish`,`a`.`author` AS `author`,`a`.`stock` AS `stock`,`a`.`address` AS `address` from (`book` `a` join `booktype` `b`) where (`a`.`typeId` = `b`.`id`) ;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化