17
17
18
18
import java .util .List ;
19
19
20
+ import org .apache .ibatis .annotations .Arg ;
20
21
import org .apache .ibatis .annotations .Param ;
21
- import org .apache .ibatis .annotations .Result ;
22
- import org .apache .ibatis .annotations .ResultMap ;
23
- import org .apache .ibatis .annotations .Results ;
24
22
import org .apache .ibatis .annotations .Select ;
25
23
import org .apache .ibatis .annotations .SelectProvider ;
26
24
import org .apache .ibatis .session .RowBounds ;
34
32
public interface AnimalDataMapper extends CommonDeleteMapper , CommonInsertMapper <AnimalData >, CommonUpdateMapper {
35
33
36
34
@ SelectProvider (type =SqlProviderAdapter .class , method ="select" )
37
- @ Results (id ="AnimalDataResult" , value ={
38
- @ Result (column ="id" , property ="id" , id =true ),
39
- @ Result (column ="animal_name" , property ="animalName" ),
40
- @ Result (column ="brain_weight" , property ="brainWeight" ),
41
- @ Result (column ="body_weight" , property ="bodyWeight" )
42
- })
35
+ @ Arg (column = "id" , javaType = int .class , id = true )
36
+ @ Arg (column = "animal_name" , javaType = String .class )
37
+ @ Arg (column = "brain_weight" , javaType = double .class )
38
+ @ Arg (column = "body_weight" , javaType = double .class )
43
39
List <AnimalData > selectMany (SelectStatementProvider selectStatement );
44
40
45
41
@ SelectProvider (type = SqlProviderAdapter .class , method = "select" )
46
- @ ResultMap ("AnimalDataResult" )
42
+ @ Arg (column = "id" , javaType = int .class , id = true )
43
+ @ Arg (column = "animal_name" , javaType = String .class )
44
+ @ Arg (column = "brain_weight" , javaType = double .class )
45
+ @ Arg (column = "body_weight" , javaType = double .class )
47
46
List <AnimalData > selectManyWithRowBounds (SelectStatementProvider selectStatement , RowBounds rowBounds );
48
47
49
48
@ SelectProvider (type = SqlProviderAdapter .class , method = "select" )
50
- @ ResultMap ("AnimalDataResult" )
49
+ @ Arg (column = "id" , javaType = int .class , id = true )
50
+ @ Arg (column = "animal_name" , javaType = String .class )
51
+ @ Arg (column = "brain_weight" , javaType = double .class )
52
+ @ Arg (column = "body_weight" , javaType = double .class )
51
53
AnimalData selectOne (SelectStatementProvider selectStatement );
52
54
53
55
@ Select ({
54
56
"select id, animal_name, brain_weight, body_weight" ,
55
57
"from AnimalData" ,
56
58
"${whereClause}"
57
59
})
58
- @ ResultMap ("AnimalDataResult" )
60
+ @ Arg (column = "id" , javaType = int .class , id = true )
61
+ @ Arg (column = "animal_name" , javaType = String .class )
62
+ @ Arg (column = "brain_weight" , javaType = double .class )
63
+ @ Arg (column = "body_weight" , javaType = double .class )
59
64
List <AnimalData > selectWithWhereClause (WhereClauseProvider whereClause );
60
65
61
66
@ Select ({
62
67
"select a.id, a.animal_name, a.brain_weight, a.body_weight" ,
63
68
"from AnimalData a" ,
64
69
"${whereClause}"
65
70
})
66
- @ ResultMap ("AnimalDataResult" )
71
+ @ Arg (column = "id" , javaType = int .class , id = true )
72
+ @ Arg (column = "animal_name" , javaType = String .class )
73
+ @ Arg (column = "brain_weight" , javaType = double .class )
74
+ @ Arg (column = "body_weight" , javaType = double .class )
67
75
List <AnimalData > selectWithWhereClauseAndAlias (WhereClauseProvider whereClause );
68
76
69
77
@ Select ({
@@ -73,7 +81,10 @@ public interface AnimalDataMapper extends CommonDeleteMapper, CommonInsertMapper
73
81
"order by id" ,
74
82
"OFFSET #{offset,jdbcType=INTEGER} LIMIT #{limit,jdbcType=INTEGER}"
75
83
})
76
- @ ResultMap ("AnimalDataResult" )
84
+ @ Arg (column = "id" , javaType = int .class , id = true )
85
+ @ Arg (column = "animal_name" , javaType = String .class )
86
+ @ Arg (column = "brain_weight" , javaType = double .class )
87
+ @ Arg (column = "body_weight" , javaType = double .class )
77
88
List <AnimalData > selectWithWhereClauseLimitAndOffset (@ Param ("whereClauseProvider" ) WhereClauseProvider whereClause ,
78
89
@ Param ("limit" ) int limit , @ Param ("offset" ) int offset );
79
90
@@ -84,7 +95,10 @@ List<AnimalData> selectWithWhereClauseLimitAndOffset(@Param("whereClauseProvider
84
95
"order by id" ,
85
96
"OFFSET #{offset,jdbcType=INTEGER} LIMIT #{limit,jdbcType=INTEGER}"
86
97
})
87
- @ ResultMap ("AnimalDataResult" )
98
+ @ Arg (column = "id" , javaType = int .class , id = true )
99
+ @ Arg (column = "animal_name" , javaType = String .class )
100
+ @ Arg (column = "brain_weight" , javaType = double .class )
101
+ @ Arg (column = "body_weight" , javaType = double .class )
88
102
List <AnimalData > selectWithWhereClauseAliasLimitAndOffset (@ Param ("whereClauseProvider" ) WhereClauseProvider whereClause ,
89
103
@ Param ("limit" ) int limit , @ Param ("offset" ) int offset );
90
104
}
0 commit comments