Skip to content

Commit bca7ea5

Browse files
committed
完善注释
1 parent 953e998 commit bca7ea5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/test/java/tk/mybatis/springboot/mapper/MyBatis331Mapper.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public interface MyBatis331Mapper {
5252
@Options(useGeneratedKeys = true, keyProperty = "id")
5353
int insertCities(List<City2> cities);
5454

55+
/**
56+
* 根据主键查询一个
57+
*
58+
* @param id
59+
* @return
60+
*/
5561
@Results(id = "cityResult", value = {
5662
@Result(property = "id", column = "id", id = true),
5763
@Result(property = "cityName", column = "name", id = true),
@@ -60,7 +66,11 @@ public interface MyBatis331Mapper {
6066
@Select("select id, name, state from city where id = #{id}")
6167
City2 selectByCityId(Integer id);
6268

63-
69+
/**
70+
* 查询全部,引用上面的Results
71+
*
72+
* @return
73+
*/
6474
@ResultMap("cityResult")
6575
@Select("select id, name, state from city")
6676
List<City2> selectAll();

0 commit comments

Comments
 (0)