Skip to content

Commit 2420cca

Browse files
committed
1 parent 9674040 commit 2420cca

File tree

1 file changed

+23
-14
lines changed
  • spring-mybatis/src/main/java/com/hmkcode/spring/mybatis/mapper

1 file changed

+23
-14
lines changed

spring-mybatis/src/main/java/com/hmkcode/spring/mybatis/mapper/Mapper.java

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,30 @@ public interface Mapper {
1919
public List<Person> selectAllPerson();
2020

2121

22-
/**
23-
* Retrieves a person
24-
* @param person id
25-
* @return person
26-
*/
27-
28-
//SQL query using annotation
29-
@Select("SELECT * FROM person")
30-
public List<Person> selectAllPerson2();
22+
/**
23+
* Retrieves a person
24+
* @param person id
25+
* @return person
26+
*/
27+
//SQL query using annotation
28+
@Select("SELECT * FROM person")
29+
public List<Person> selectAllPerson2();
3130

32-
//SQL query using annotation
33-
@Select("SELECT * FROM person WHERE id = #{id}")
34-
public Person selectPerson(@Param("id") int id);
31+
/******************************************
32+
* Retrieves a person
33+
* @param person id
34+
* @return person
35+
*/
36+
//SQL query using annotation
37+
@Select("SELECT * FROM person WHERE id = #{id}")
38+
public Person selectPerson(@Param("id") int id);
3539

36-
@Insert("INSERT INTO person (id,name) VALUES(#{id},#{name})")
37-
public void insertPerson(Person person);
40+
/******************************************
41+
* Insert a person
42+
* @param person
43+
* @return int
44+
*/
45+
@Insert("INSERT INTO person (name) VALUES (#{name})")
46+
public int insertPerson(Person person);
3847
}
3948

0 commit comments

Comments
 (0)