Skip to content

Commit e152cc6

Browse files
committed
update
1 parent 839562e commit e152cc6

File tree

24 files changed

+2343
-24
lines changed

24 files changed

+2343
-24
lines changed

javaframework/mybatis/05mybatis-plus/04mybatis-plus的使用.md

Lines changed: 1056 additions & 0 deletions
Large diffs are not rendered by default.

javaframework/mybatis/05mybatis-plus/mybatis_plus_helloworld/.idea/compiler.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javaframework/mybatis/05mybatis-plus/mybatis_plus_helloworld/.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javaframework/mybatis/05mybatis-plus/mybatis_plus_helloworld/.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javaframework/mybatis/05mybatis-plus/mybatis_plus_helloworld/.idea/workspace.xml

Lines changed: 813 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4" />
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.mashibing</groupId>
8+
<artifactId>mybatis_plus_helloworld</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<dependencies>
12+
<dependency>
13+
<groupId>com.baomidou</groupId>
14+
<artifactId>mybatis-plus</artifactId>
15+
<version>3.3.1</version>
16+
</dependency>
17+
<dependency>
18+
<groupId>junit</groupId>
19+
<artifactId>junit</artifactId>
20+
<version>4.13</version>
21+
<scope>test</scope>
22+
</dependency>
23+
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
24+
<dependency>
25+
<groupId>log4j</groupId>
26+
<artifactId>log4j</artifactId>
27+
<version>1.2.17</version>
28+
</dependency>
29+
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
30+
<dependency>
31+
<groupId>com.alibaba</groupId>
32+
<artifactId>druid</artifactId>
33+
<version>1.1.21</version>
34+
</dependency>
35+
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
36+
<dependency>
37+
<groupId>mysql</groupId>
38+
<artifactId>mysql-connector-java</artifactId>
39+
<version>8.0.19</version>
40+
</dependency>
41+
42+
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
43+
<dependency>
44+
<groupId>org.springframework</groupId>
45+
<artifactId>spring-context</artifactId>
46+
<version>5.2.3.RELEASE</version>
47+
</dependency>
48+
<!-- https://mvnrepository.com/artifact/org.springframework/spring-orm -->
49+
<dependency>
50+
<groupId>org.springframework</groupId>
51+
<artifactId>spring-orm</artifactId>
52+
<version>5.2.3.RELEASE</version>
53+
</dependency>
54+
</dependencies>
55+
</project>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package com.mashibing.bean;
2+
3+
import com.baomidou.mybatisplus.annotation.IdType;
4+
import com.baomidou.mybatisplus.annotation.TableId;
5+
import com.baomidou.mybatisplus.annotation.TableName;
6+
import org.omg.CORBA.IDLType;
7+
8+
import java.util.Date;
9+
10+
@TableName("tbl_emp")
11+
public class Emp {
12+
13+
/**
14+
* 在 mybatis-plus2.x版本的时候,如果设置了表自增,那么id必须制定为auto类型,否则插入不成功,3.x不存在此问题
15+
*/
16+
@TableId(value = "empno",type = IdType.AUTO)
17+
private Integer empno;
18+
private String eName;
19+
private String job;
20+
private Integer mgr;
21+
private Date hiredate;
22+
private Double sal;
23+
private Double comm;
24+
private Integer deptno;
25+
26+
public Integer getEmpno() {
27+
return empno;
28+
}
29+
30+
public void setEmpno(Integer empno) {
31+
this.empno = empno;
32+
}
33+
34+
public String geteName() {
35+
return eName;
36+
}
37+
38+
public void seteName(String eName) {
39+
this.eName = eName;
40+
}
41+
42+
public String getJob() {
43+
return job;
44+
}
45+
46+
public void setJob(String job) {
47+
this.job = job;
48+
}
49+
50+
public Integer getMgr() {
51+
return mgr;
52+
}
53+
54+
public void setMgr(Integer mgr) {
55+
this.mgr = mgr;
56+
}
57+
58+
public Date getHiredate() {
59+
return hiredate;
60+
}
61+
62+
public void setHiredate(Date hiredate) {
63+
this.hiredate = hiredate;
64+
}
65+
66+
public Double getSal() {
67+
return sal;
68+
}
69+
70+
public void setSal(Double sal) {
71+
this.sal = sal;
72+
}
73+
74+
public Double getComm() {
75+
return comm;
76+
}
77+
78+
public void setComm(Double comm) {
79+
this.comm = comm;
80+
}
81+
82+
public Integer getDeptno() {
83+
return deptno;
84+
}
85+
86+
public void setDeptno(Integer deptno) {
87+
this.deptno = deptno;
88+
}
89+
90+
@Override
91+
public String toString() {
92+
return "Emp{" +
93+
"empno=" + empno +
94+
", eName='" + eName + '\'' +
95+
", job='" + job + '\'' +
96+
", mgr=" + mgr +
97+
", hiredate=" + hiredate +
98+
", sal=" + sal +
99+
", comm=" + comm +
100+
", deptno=" + deptno +
101+
'}';
102+
}
103+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.mashibing.dao;
2+
3+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4+
import com.mashibing.bean.Emp;
5+
import org.apache.ibatis.annotations.Mapper;
6+
7+
import java.util.List;
8+
9+
@Mapper
10+
public interface EmpDao extends BaseMapper<Emp> {
11+
12+
public List<Emp> selectEmpByCondition();
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE mapper
3+
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4+
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5+
<mapper namespace="com.mashibing.dao.EmpDao">
6+
<select id="selectEmpByCondition" resultType="com.mashibing.bean.Emp">
7+
select * from tbl_emp
8+
</select>
9+
</mapper>

0 commit comments

Comments
 (0)