Skip to content

Commit fb5af5c

Browse files
author
shi.pengyan
committed
mybatis generator
1 parent 764ff8b commit fb5af5c

File tree

8 files changed

+1281
-0
lines changed

8 files changed

+1281
-0
lines changed

init.sql

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
-- MySQL dump 10.13 Distrib 5.5.28, for Win64 (x86)
2+
--
3+
-- Host: localhost Database: mvc-mybatis
4+
-- ------------------------------------------------------
5+
-- Server version 5.5.28
6+
7+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10+
/*!40101 SET NAMES utf8 */;
11+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12+
/*!40103 SET TIME_ZONE='+00:00' */;
13+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17+
18+
--
19+
-- Table structure for table `user`
20+
--
21+
22+
DROP TABLE IF EXISTS `user`;
23+
/*!40101 SET @saved_cs_client = @@character_set_client */;
24+
/*!40101 SET character_set_client = utf8 */;
25+
CREATE TABLE `user` (
26+
`id` int(11) NOT NULL,
27+
`name` varchar(45) NOT NULL,
28+
`user_code` varchar(45) NOT NULL,
29+
`password` varchar(45) NOT NULL,
30+
`age` int(11) DEFAULT '0',
31+
PRIMARY KEY (`id`)
32+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
33+
/*!40101 SET character_set_client = @saved_cs_client */;
34+
35+
--
36+
-- Dumping data for table `user`
37+
--
38+
39+
LOCK TABLES `user` WRITE;
40+
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
41+
INSERT INTO `user` VALUES (1,'spy','spy','asdfasdf',20),(869,'cc','spy','123',22),(870,'cc','spy','123',22);
42+
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
43+
UNLOCK TABLES;
44+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
45+
46+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
47+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
48+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
49+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
50+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
51+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
52+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
53+
54+
-- Dump completed on 2015-10-22 11:00:06
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
package com.spy.mvc.mybatis.dao;
2+
3+
import com.spy.mvc.mybatis.model.User;
4+
import com.spy.mvc.mybatis.model.UserExample;
5+
import java.util.List;
6+
import org.apache.ibatis.annotations.Param;
7+
8+
public interface UserMapper {
9+
/**
10+
* This method was generated by MyBatis Generator.
11+
* This method corresponds to the database table user
12+
*
13+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
14+
*/
15+
int countByExample(UserExample example);
16+
17+
/**
18+
* This method was generated by MyBatis Generator.
19+
* This method corresponds to the database table user
20+
*
21+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
22+
*/
23+
int deleteByExample(UserExample example);
24+
25+
/**
26+
* This method was generated by MyBatis Generator.
27+
* This method corresponds to the database table user
28+
*
29+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
30+
*/
31+
int deleteByPrimaryKey(Integer id);
32+
33+
/**
34+
* This method was generated by MyBatis Generator.
35+
* This method corresponds to the database table user
36+
*
37+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
38+
*/
39+
int insert(User record);
40+
41+
/**
42+
* This method was generated by MyBatis Generator.
43+
* This method corresponds to the database table user
44+
*
45+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
46+
*/
47+
int insertSelective(User record);
48+
49+
/**
50+
* This method was generated by MyBatis Generator.
51+
* This method corresponds to the database table user
52+
*
53+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
54+
*/
55+
List<User> selectByExample(UserExample example);
56+
57+
/**
58+
* This method was generated by MyBatis Generator.
59+
* This method corresponds to the database table user
60+
*
61+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
62+
*/
63+
User selectByPrimaryKey(Integer id);
64+
65+
/**
66+
* This method was generated by MyBatis Generator.
67+
* This method corresponds to the database table user
68+
*
69+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
70+
*/
71+
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
72+
73+
/**
74+
* This method was generated by MyBatis Generator.
75+
* This method corresponds to the database table user
76+
*
77+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
78+
*/
79+
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
80+
81+
/**
82+
* This method was generated by MyBatis Generator.
83+
* This method corresponds to the database table user
84+
*
85+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
86+
*/
87+
int updateByPrimaryKeySelective(User record);
88+
89+
/**
90+
* This method was generated by MyBatis Generator.
91+
* This method corresponds to the database table user
92+
*
93+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
94+
*/
95+
int updateByPrimaryKey(User record);
96+
}
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
package com.spy.mvc.mybatis.model;
2+
3+
public class User {
4+
/**
5+
* This field was generated by MyBatis Generator.
6+
* This field corresponds to the database column user.id
7+
*
8+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
9+
*/
10+
private Integer id;
11+
12+
/**
13+
* This field was generated by MyBatis Generator.
14+
* This field corresponds to the database column user.name
15+
*
16+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
17+
*/
18+
private String name;
19+
20+
/**
21+
* This field was generated by MyBatis Generator.
22+
* This field corresponds to the database column user.user_code
23+
*
24+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
25+
*/
26+
private String userCode;
27+
28+
/**
29+
* This field was generated by MyBatis Generator.
30+
* This field corresponds to the database column user.password
31+
*
32+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
33+
*/
34+
private String password;
35+
36+
/**
37+
* This field was generated by MyBatis Generator.
38+
* This field corresponds to the database column user.age
39+
*
40+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
41+
*/
42+
private Integer age;
43+
44+
/**
45+
* This method was generated by MyBatis Generator.
46+
* This method returns the value of the database column user.id
47+
*
48+
* @return the value of user.id
49+
*
50+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
51+
*/
52+
public Integer getId() {
53+
return id;
54+
}
55+
56+
/**
57+
* This method was generated by MyBatis Generator.
58+
* This method sets the value of the database column user.id
59+
*
60+
* @param id the value for user.id
61+
*
62+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
63+
*/
64+
public void setId(Integer id) {
65+
this.id = id;
66+
}
67+
68+
/**
69+
* This method was generated by MyBatis Generator.
70+
* This method returns the value of the database column user.name
71+
*
72+
* @return the value of user.name
73+
*
74+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
75+
*/
76+
public String getName() {
77+
return name;
78+
}
79+
80+
/**
81+
* This method was generated by MyBatis Generator.
82+
* This method sets the value of the database column user.name
83+
*
84+
* @param name the value for user.name
85+
*
86+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
87+
*/
88+
public void setName(String name) {
89+
this.name = name == null ? null : name.trim();
90+
}
91+
92+
/**
93+
* This method was generated by MyBatis Generator.
94+
* This method returns the value of the database column user.user_code
95+
*
96+
* @return the value of user.user_code
97+
*
98+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
99+
*/
100+
public String getUserCode() {
101+
return userCode;
102+
}
103+
104+
/**
105+
* This method was generated by MyBatis Generator.
106+
* This method sets the value of the database column user.user_code
107+
*
108+
* @param userCode the value for user.user_code
109+
*
110+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
111+
*/
112+
public void setUserCode(String userCode) {
113+
this.userCode = userCode == null ? null : userCode.trim();
114+
}
115+
116+
/**
117+
* This method was generated by MyBatis Generator.
118+
* This method returns the value of the database column user.password
119+
*
120+
* @return the value of user.password
121+
*
122+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
123+
*/
124+
public String getPassword() {
125+
return password;
126+
}
127+
128+
/**
129+
* This method was generated by MyBatis Generator.
130+
* This method sets the value of the database column user.password
131+
*
132+
* @param password the value for user.password
133+
*
134+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
135+
*/
136+
public void setPassword(String password) {
137+
this.password = password == null ? null : password.trim();
138+
}
139+
140+
/**
141+
* This method was generated by MyBatis Generator.
142+
* This method returns the value of the database column user.age
143+
*
144+
* @return the value of user.age
145+
*
146+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
147+
*/
148+
public Integer getAge() {
149+
return age;
150+
}
151+
152+
/**
153+
* This method was generated by MyBatis Generator.
154+
* This method sets the value of the database column user.age
155+
*
156+
* @param age the value for user.age
157+
*
158+
* @mbggenerated Thu Oct 22 13:30:23 CST 2015
159+
*/
160+
public void setAge(Integer age) {
161+
this.age = age;
162+
}
163+
}

0 commit comments

Comments
 (0)