View Javadoc
1   /**
2    *    Copyright 2009-2020 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.apache.ibatis.submitted.sqlprovider;
17  
18  import java.util.List;
19  import java.util.Map;
20  import org.apache.ibatis.annotations.DeleteProvider;
21  import org.apache.ibatis.annotations.InsertProvider;
22  import org.apache.ibatis.annotations.Param;
23  import org.apache.ibatis.annotations.SelectProvider;
24  import org.apache.ibatis.annotations.UpdateProvider;
25  
26  @BaseMapper.Meta(tableName = "users")
27  public interface Mapper extends BaseMapper<User> {
28    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersQuery")
29    List<User> getUsers(List<Integer> allFilterIds);
30  
31    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUserQuery")
32    User getUser(Integer userId);
33  
34    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetAllUsersQuery")
35    List<User> getAllUsers();
36  
37    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaQuery")
38    List<User> getUsersByCriteria(User criteria);
39  
40    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaMapQuery")
41    List<User> getUsersByCriteriaMap(Map<String, Object> criteria);
42  
43    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaMapWithParamQuery")
44    List<User> getUsersByCriteriaMapWithParam(Map<String, Object> criteria);
45  
46    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameQuery")
47    List<User> getUsersByName(String name, String orderByColumn);
48  
49    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameUsingMap")
50    List<User> getUsersByNameUsingMap(String name, String orderByColumn);
51  
52    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameWithParamNameAndOrderByQuery")
53    List<User> getUsersByNameWithParamNameAndOrderBy(@Param("name") String name, @Param("orderByColumn") String orderByColumn);
54  
55    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameWithParamNameQuery")
56    List<User> getUsersByNameWithParamName(@Param("name") String name);
57  
58    @InsertProvider(type = OurSqlBuilder.class, method = "buildInsert")
59    void insert(User user);
60  
61    @UpdateProvider(type= OurSqlBuilder.class, method= "buildUpdate")
62    void update(User user);
63  
64    @DeleteProvider(type= OurSqlBuilder.class, method= "buildDelete")
65    void delete(Integer id);
66  
67  }