View Javadoc
1   /*
2    *    Copyright 2009-2022 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    *       https://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  
21  import org.apache.ibatis.annotations.DeleteProvider;
22  import org.apache.ibatis.annotations.InsertProvider;
23  import org.apache.ibatis.annotations.Param;
24  import org.apache.ibatis.annotations.SelectProvider;
25  import org.apache.ibatis.annotations.UpdateProvider;
26  
27  @BaseMapper.Meta(tableName = "users")
28  public interface Mapper extends BaseMapper<User> {
29    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersQuery")
30    List<User> getUsers(List<Integer> allFilterIds);
31  
32    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUserQuery")
33    User getUser(Integer userId);
34  
35    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetAllUsersQuery")
36    List<User> getAllUsers();
37  
38    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaQuery")
39    List<User> getUsersByCriteria(User criteria);
40  
41    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaMapQuery")
42    List<User> getUsersByCriteriaMap(Map<String, Object> criteria);
43  
44    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByCriteriaMapWithParamQuery")
45    List<User> getUsersByCriteriaMapWithParam(Map<String, Object> criteria);
46  
47    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameQuery")
48    List<User> getUsersByName(String name, String orderByColumn);
49  
50    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameUsingMap")
51    List<User> getUsersByNameUsingMap(String name, String orderByColumn);
52  
53    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameWithParamNameAndOrderByQuery")
54    List<User> getUsersByNameWithParamNameAndOrderBy(@Param("name") String name,
55        @Param("orderByColumn") String orderByColumn);
56  
57    @SelectProvider(type = OurSqlBuilder.class, method = "buildGetUsersByNameWithParamNameQuery")
58    List<User> getUsersByNameWithParamName(@Param("name") String name);
59  
60    @InsertProvider(type = OurSqlBuilder.class, method = "buildInsert")
61    void insert(User user);
62  
63    @UpdateProvider(type = OurSqlBuilder.class, method = "buildUpdate")
64    void update(User user);
65  
66    @DeleteProvider(type = OurSqlBuilder.class, method = "buildDelete")
67    void delete(Integer id);
68  
69  }