Skip to content

Commit 1f1b585

Browse files
committed
add mybatis.sql
1 parent b08c6d7 commit 1f1b585

File tree

3 files changed

+124
-8
lines changed

3 files changed

+124
-8
lines changed

mybatis.sql

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/*
2+
Navicat Premium Data Transfer
3+
4+
Source Server : mysql
5+
Source Server Type : MySQL
6+
Source Server Version : 50719
7+
Source Host : localhost:3306
8+
Source Schema : mybatis
9+
10+
Target Server Type : MySQL
11+
Target Server Version : 50719
12+
File Encoding : 65001
13+
14+
Date: 08/08/2017 10:51:58
15+
*/
16+
17+
SET NAMES utf8mb4;
18+
SET FOREIGN_KEY_CHECKS = 0;
19+
20+
-- ----------------------------
21+
-- Table structure for class
22+
-- ----------------------------
23+
DROP TABLE IF EXISTS `class`;
24+
CREATE TABLE `class` (
25+
`c_id` int(11) NOT NULL AUTO_INCREMENT,
26+
`c_name` varchar(20) DEFAULT NULL,
27+
`teacher_id` int(11) DEFAULT NULL,
28+
PRIMARY KEY (`c_id`),
29+
KEY `fk_teacher_id` (`teacher_id`),
30+
CONSTRAINT `fk_teacher_id` FOREIGN KEY (`teacher_id`) REFERENCES `teacher` (`t_id`)
31+
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
32+
33+
-- ----------------------------
34+
-- Records of class
35+
-- ----------------------------
36+
BEGIN;
37+
INSERT INTO `class` VALUES (1, 'bj_a', 1);
38+
INSERT INTO `class` VALUES (2, 'bj_b', 2);
39+
COMMIT;
40+
41+
-- ----------------------------
42+
-- Table structure for orders
43+
-- ----------------------------
44+
DROP TABLE IF EXISTS `orders`;
45+
CREATE TABLE `orders` (
46+
`order_id` int(11) NOT NULL AUTO_INCREMENT,
47+
`order_no` varchar(20) DEFAULT NULL,
48+
`order_price` float DEFAULT NULL,
49+
PRIMARY KEY (`order_id`)
50+
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
51+
52+
-- ----------------------------
53+
-- Records of orders
54+
-- ----------------------------
55+
BEGIN;
56+
INSERT INTO `orders` VALUES (1, 'aaaa', 23);
57+
INSERT INTO `orders` VALUES (2, 'bbbb', 33);
58+
INSERT INTO `orders` VALUES (3, 'cccc', 22);
59+
COMMIT;
60+
61+
-- ----------------------------
62+
-- Table structure for student
63+
-- ----------------------------
64+
DROP TABLE IF EXISTS `student`;
65+
CREATE TABLE `student` (
66+
`s_id` int(11) NOT NULL AUTO_INCREMENT,
67+
`s_name` varchar(20) DEFAULT NULL,
68+
`class_id` int(11) DEFAULT NULL,
69+
PRIMARY KEY (`s_id`)
70+
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
71+
72+
-- ----------------------------
73+
-- Records of student
74+
-- ----------------------------
75+
BEGIN;
76+
INSERT INTO `student` VALUES (1, 'xs_A', 1);
77+
INSERT INTO `student` VALUES (2, 'xs_B', 1);
78+
INSERT INTO `student` VALUES (3, 'xs_C', 1);
79+
INSERT INTO `student` VALUES (4, 'xs_D', 2);
80+
INSERT INTO `student` VALUES (5, 'xs_E', 2);
81+
INSERT INTO `student` VALUES (6, 'xs_F', 2);
82+
COMMIT;
83+
84+
-- ----------------------------
85+
-- Table structure for teacher
86+
-- ----------------------------
87+
DROP TABLE IF EXISTS `teacher`;
88+
CREATE TABLE `teacher` (
89+
`t_id` int(11) NOT NULL AUTO_INCREMENT,
90+
`t_name` varchar(20) DEFAULT NULL,
91+
PRIMARY KEY (`t_id`)
92+
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
93+
94+
-- ----------------------------
95+
-- Records of teacher
96+
-- ----------------------------
97+
BEGIN;
98+
INSERT INTO `teacher` VALUES (1, 'LS1');
99+
INSERT INTO `teacher` VALUES (2, 'LS2');
100+
COMMIT;
101+
102+
-- ----------------------------
103+
-- Table structure for users
104+
-- ----------------------------
105+
DROP TABLE IF EXISTS `users`;
106+
CREATE TABLE `users` (
107+
`id` int(11) NOT NULL AUTO_INCREMENT,
108+
`name` varchar(20) DEFAULT NULL,
109+
`age` int(11) DEFAULT NULL,
110+
`password` varchar(30) NOT NULL DEFAULT '',
111+
`detail` varchar(10000) NOT NULL,
112+
`sex` int(1) DEFAULT NULL,
113+
PRIMARY KEY (`id`)
114+
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
115+
116+
-- ----------------------------
117+
-- Records of users
118+
-- ----------------------------
119+
BEGIN;
120+
INSERT INTO `users` VALUES (1, 'manajay', 123, '123456', '男儿有泪不轻弹', 0);
121+
INSERT INTO `users` VALUES (4, '解决', 23, '11111', '11111', 0);
122+
COMMIT;
123+
124+
SET FOREIGN_KEY_CHECKS = 1;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
jdbc_driver=com.mysql.jdbc.Driver
21
jdbc_url=jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf-8&useSSL=false
32
jdbc_username=root
43
jdbc_password=root

src/main/resources/config/spring-mybatis.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@
2929
<property name="filters" value="stat" />
3030
</bean>
3131

32-
<!--<bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">-->
33-
<!--<property name="driverClassName" value="${jdbc_driver}"/>-->
34-
<!--<property name="url" value="${jdbc_url}"/>-->
35-
<!--<property name="username" value="${jdbc_username}"/>-->
36-
<!--<property name="password" value="${jdbc_password}"/>-->
37-
<!--</bean>-->
38-
3932
<bean id="typeHandler" class="com.lj.spring.typeHandler.SexTypeHandler"/>
4033

4134
<!--

0 commit comments

Comments
 (0)