|
7 | 7 |
|
8 | 8 | /** |
9 | 9 | * IBaseService |
10 | | - * @author dolyw.com |
| 10 | + * |
| 11 | + * @author wliduo[[email protected]] |
11 | 12 | * @date 2018/8/9 15:45 |
12 | 13 | */ |
13 | 14 | public interface IBaseService<T> { |
14 | 15 |
|
15 | 16 | // Select |
| 17 | + |
16 | 18 | /** |
17 | 19 | * 根据实体中的属性值进行查询,查询条件使用等号 |
| 20 | + * |
18 | 21 | * @param record |
19 | 22 | * @return java.util.List<T> |
20 | | - * @author dolyw.com |
| 23 | + * @author wliduo[i@dolyw.com] |
21 | 24 | * @date 2018/8/9 15:43 |
22 | 25 | */ |
23 | 26 | List<T> select(T record); |
24 | 27 |
|
25 | 28 | /** |
26 | 29 | * 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号 |
| 30 | + * |
27 | 31 | * @param key |
28 | 32 | * @return T |
29 | | - * @author dolyw.com |
| 33 | + * @author wliduo[i@dolyw.com] |
30 | 34 | * @date 2018/8/9 15:43 |
31 | 35 | */ |
32 | 36 | T selectByPrimaryKey(Object key); |
33 | 37 |
|
34 | 38 | /** |
35 | 39 | * 查询全部结果,select(null)方法能达到同样的效果 |
36 | | - * @param |
| 40 | + * |
| 41 | + * @param |
37 | 42 | * @return java.util.List<T> |
38 | | - * @author dolyw.com |
| 43 | + * @author wliduo[i@dolyw.com] |
39 | 44 | * @date 2018/8/9 15:43 |
40 | 45 | */ |
41 | 46 | List<T> selectAll(); |
42 | 47 |
|
43 | 48 | /** |
44 | 49 | * 根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号 |
| 50 | + * |
45 | 51 | * @param record |
46 | 52 | * @return T |
47 | | - * @author dolyw.com |
| 53 | + * @author wliduo[i@dolyw.com] |
48 | 54 | * @date 2018/8/9 15:43 |
49 | 55 | */ |
50 | 56 | T selectOne(T record); |
51 | 57 |
|
52 | 58 | /** |
53 | 59 | * 根据实体中的属性查询总数,查询条件使用等号 |
| 60 | + * |
54 | 61 | * @param record |
55 | 62 | * @return int |
56 | | - * @author dolyw.com |
| 63 | + * @author wliduo[i@dolyw.com] |
57 | 64 | * @date 2018/8/9 15:43 |
58 | 65 | */ |
59 | 66 | int selectCount(T record); |
60 | 67 |
|
61 | 68 | // Insert |
| 69 | + |
62 | 70 | /** |
63 | 71 | * 保存一个实体,null的属性也会保存,不会使用数据库默认值 |
| 72 | + * |
64 | 73 | * @param record |
65 | 74 | * @return int |
66 | | - * @author dolyw.com |
| 75 | + * @author wliduo[i@dolyw.com] |
67 | 76 | * @date 2018/8/9 15:43 |
68 | 77 | */ |
69 | 78 | int insert(T record); |
70 | 79 |
|
71 | 80 | /** |
72 | 81 | * 保存一个实体,null的属性不会保存,会使用数据库默认值 |
| 82 | + * |
73 | 83 | * @param record |
74 | 84 | * @return int |
75 | | - * @author dolyw.com |
| 85 | + * @author wliduo[i@dolyw.com] |
76 | 86 | * @date 2018/8/9 15:43 |
77 | 87 | */ |
78 | 88 | int insertSelective(T record); |
79 | 89 |
|
80 | 90 | // Update |
| 91 | + |
81 | 92 | /** |
82 | 93 | * 根据主键更新实体全部字段,null值会被更新 |
| 94 | + * |
83 | 95 | * @param record |
84 | 96 | * @return int |
85 | | - * @author dolyw.com |
| 97 | + * @author wliduo[i@dolyw.com] |
86 | 98 | * @date 2018/8/9 15:43 |
87 | 99 | */ |
88 | 100 | int updateByPrimaryKey(T record); |
89 | 101 |
|
90 | 102 | /** |
91 | 103 | * 根据主键更新属性不为null的值 |
| 104 | + * |
92 | 105 | * @param record |
93 | 106 | * @return int |
94 | | - * @author dolyw.com |
| 107 | + * @author wliduo[i@dolyw.com] |
95 | 108 | * @date 2018/8/9 15:43 |
96 | 109 | */ |
97 | 110 | int updateByPrimaryKeySelective(T record); |
98 | 111 |
|
99 | 112 | // Delete |
| 113 | + |
100 | 114 | /** |
101 | 115 | * 根据实体属性作为条件进行删除,查询条件使用等号 |
| 116 | + * |
102 | 117 | * @param record |
103 | 118 | * @return int |
104 | | - * @author dolyw.com |
| 119 | + * @author wliduo[i@dolyw.com] |
105 | 120 | * @date 2018/8/9 15:43 |
106 | 121 | */ |
107 | 122 | int delete(T record); |
108 | 123 |
|
109 | 124 | /** |
110 | 125 | * 根据主键字段进行删除,方法参数必须包含完整的主键属性 |
| 126 | + * |
111 | 127 | * @param key |
112 | 128 | * @return int |
113 | | - * @author dolyw.com |
| 129 | + * @author wliduo[i@dolyw.com] |
114 | 130 | * @date 2018/8/9 15:44 |
115 | 131 | */ |
116 | 132 | int deleteByPrimaryKey(Object key); |
117 | 133 |
|
118 | 134 | // Example |
| 135 | + |
119 | 136 | /** |
120 | 137 | * 根据Example条件进行查询,这个查询支持通过Example类指定查询列,通过selectProperties方法指定查询列 |
| 138 | + * |
121 | 139 | * @param example |
122 | 140 | * @return java.util.List<T> |
123 | | - * @author dolyw.com |
| 141 | + * @author wliduo[i@dolyw.com] |
124 | 142 | * @date 2018/8/9 15:44 |
125 | 143 | */ |
126 | 144 | List<T> selectByExample(Object example); |
127 | 145 |
|
128 | 146 | /** |
129 | 147 | * 根据Example条件进行查询总数 |
| 148 | + * |
130 | 149 | * @param example |
131 | 150 | * @return int |
132 | | - * @author dolyw.com |
| 151 | + * @author wliduo[i@dolyw.com] |
133 | 152 | * @date 2018/8/9 15:44 |
134 | 153 | */ |
135 | 154 | int selectCountByExample(Object example); |
136 | 155 |
|
137 | 156 | /** |
138 | 157 | * 根据Example条件更新实体record包含的全部属性,null值会被更新 |
| 158 | + * |
139 | 159 | * @param record |
140 | | - * @param example |
| 160 | + * @param example |
141 | 161 | * @return int |
142 | | - * @author dolyw.com |
| 162 | + * @author wliduo[i@dolyw.com] |
143 | 163 | * @date 2018/8/9 15:44 |
144 | 164 | */ |
145 | 165 | int updateByExample(@Param("record") T record, @Param("example") Object example); |
146 | 166 |
|
147 | 167 | /** |
148 | 168 | * 根据Example条件更新实体record包含的不是null的属性值 |
| 169 | + * |
149 | 170 | * @param record |
150 | | - * @param example |
| 171 | + * @param example |
151 | 172 | * @return int |
152 | | - * @author dolyw.com |
| 173 | + * @author wliduo[i@dolyw.com] |
153 | 174 | * @date 2018/8/9 15:44 |
154 | 175 | */ |
155 | 176 | int updateByExampleSelective(@Param("record") T record, @Param("example") Object example); |
156 | 177 |
|
157 | 178 | /** |
158 | 179 | * 根据Example条件删除数据 |
| 180 | + * |
159 | 181 | * @param example |
160 | 182 | * @return int |
161 | | - * @author dolyw.com |
| 183 | + * @author wliduo[i@dolyw.com] |
162 | 184 | * @date 2018/8/9 15:44 |
163 | 185 | */ |
164 | 186 | int deleteByExample(Object example); |
165 | 187 |
|
166 | 188 | // RowBounds |
| 189 | + |
167 | 190 | /** |
168 | 191 | * 根据实体属性和RowBounds进行分页查询 |
| 192 | + * |
169 | 193 | * @param record |
170 | | - * @param rowBounds |
| 194 | + * @param rowBounds |
171 | 195 | * @return java.util.List<T> |
172 | | - * @author dolyw.com |
| 196 | + * @author wliduo[i@dolyw.com] |
173 | 197 | * @date 2018/8/9 15:44 |
174 | 198 | */ |
175 | 199 | List<T> selectByRowBounds(T record, RowBounds rowBounds); |
176 | 200 |
|
177 | 201 | /** |
178 | 202 | * 根据example条件和RowBounds进行分页查询 |
| 203 | + * |
179 | 204 | * @param example |
180 | | - * @param rowBounds |
| 205 | + * @param rowBounds |
181 | 206 | * @return java.util.List<T> |
182 | | - * @author dolyw.com |
| 207 | + * @author wliduo[i@dolyw.com] |
183 | 208 | * @date 2018/8/9 15:44 |
184 | 209 | */ |
185 | 210 | List<T> selectByExampleAndRowBounds(Object example, RowBounds rowBounds); |
|
0 commit comments