|
5 | 5 | import java.util.Collection; |
6 | 6 | import java.util.List; |
7 | 7 | import java.util.Optional; |
8 | | -import javax.annotation.Generated; |
9 | 8 | import org.apache.ibatis.annotations.Mapper; |
10 | 9 | import org.apache.ibatis.annotations.Result; |
11 | 10 | import org.apache.ibatis.annotations.ResultMap; |
|
15 | 14 | import org.fp024.domain.generated.AuthVO; |
16 | 15 | import org.fp024.typehandler.CustomEnumTypeHandler; |
17 | 16 | import org.mybatis.dynamic.sql.BasicColumn; |
18 | | -import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter; |
19 | | -import org.mybatis.dynamic.sql.select.CountDSLCompleter; |
20 | | -import org.mybatis.dynamic.sql.select.SelectDSLCompleter; |
| 17 | +import org.mybatis.dynamic.sql.dsl.CountDSLCompleter; |
| 18 | +import org.mybatis.dynamic.sql.dsl.DeleteDSLCompleter; |
| 19 | +import org.mybatis.dynamic.sql.dsl.SelectDSLCompleter; |
| 20 | +import org.mybatis.dynamic.sql.dsl.UpdateDSL; |
| 21 | +import org.mybatis.dynamic.sql.dsl.UpdateDSLCompleter; |
21 | 22 | import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; |
22 | | -import org.mybatis.dynamic.sql.update.UpdateDSL; |
23 | | -import org.mybatis.dynamic.sql.update.UpdateDSLCompleter; |
24 | | -import org.mybatis.dynamic.sql.update.UpdateModel; |
25 | 23 | import org.mybatis.dynamic.sql.util.SqlProviderAdapter; |
26 | 24 | import org.mybatis.dynamic.sql.util.mybatis3.CommonCountMapper; |
27 | 25 | import org.mybatis.dynamic.sql.util.mybatis3.CommonDeleteMapper; |
|
31 | 29 |
|
32 | 30 | @Mapper |
33 | 31 | public interface AuthMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<AuthVO>, CommonUpdateMapper { |
34 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
35 | 32 | BasicColumn[] selectList = BasicColumn.columnList(userId, auth); |
36 | 33 |
|
37 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
38 | 34 | @SelectProvider(type=SqlProviderAdapter.class, method="select") |
39 | 35 | @Results(id="AuthVOResult", value = { |
40 | 36 | @Result(column="USERID", property="userId", jdbcType=JdbcType.VARCHAR), |
41 | 37 | @Result(column="AUTH", property="auth", typeHandler=CustomEnumTypeHandler.class, jdbcType=JdbcType.VARCHAR) |
42 | 38 | }) |
43 | 39 | List<AuthVO> selectMany(SelectStatementProvider selectStatement); |
44 | 40 |
|
45 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
46 | 41 | @SelectProvider(type=SqlProviderAdapter.class, method="select") |
47 | 42 | @ResultMap("AuthVOResult") |
48 | 43 | Optional<AuthVO> selectOne(SelectStatementProvider selectStatement); |
49 | 44 |
|
50 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
51 | 45 | default long count(CountDSLCompleter completer) { |
52 | 46 | return MyBatis3Utils.countFrom(this::count, authVO, completer); |
53 | 47 | } |
54 | 48 |
|
55 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
56 | 49 | default int delete(DeleteDSLCompleter completer) { |
57 | 50 | return MyBatis3Utils.deleteFrom(this::delete, authVO, completer); |
58 | 51 | } |
59 | 52 |
|
60 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
61 | 53 | default int insert(AuthVO row) { |
62 | 54 | return MyBatis3Utils.insert(this::insert, row, authVO, c -> |
63 | | - c.map(userId).toProperty("userId") |
64 | | - .map(auth).toProperty("auth") |
| 55 | + c.withMappedColumn(userId) |
| 56 | + .withMappedColumn(auth) |
65 | 57 | ); |
66 | 58 | } |
67 | 59 |
|
68 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
69 | 60 | default int insertMultiple(Collection<AuthVO> records) { |
70 | 61 | return MyBatis3Utils.insertMultiple(this::insertMultiple, records, authVO, c -> |
71 | | - c.map(userId).toProperty("userId") |
72 | | - .map(auth).toProperty("auth") |
| 62 | + c.withMappedColumn(userId) |
| 63 | + .withMappedColumn(auth) |
73 | 64 | ); |
74 | 65 | } |
75 | 66 |
|
76 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
77 | 67 | default int insertSelective(AuthVO row) { |
78 | 68 | return MyBatis3Utils.insert(this::insert, row, authVO, c -> |
79 | | - c.map(userId).toPropertyWhenPresent("userId", row::getUserId) |
80 | | - .map(auth).toPropertyWhenPresent("auth", row::getAuth) |
| 69 | + c.withMappedColumnWhenPresent(userId, row::getUserId) |
| 70 | + .withMappedColumnWhenPresent(auth, row::getAuth) |
81 | 71 | ); |
82 | 72 | } |
83 | 73 |
|
84 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
85 | 74 | default Optional<AuthVO> selectOne(SelectDSLCompleter completer) { |
86 | 75 | return MyBatis3Utils.selectOne(this::selectOne, selectList, authVO, completer); |
87 | 76 | } |
88 | 77 |
|
89 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
90 | 78 | default List<AuthVO> select(SelectDSLCompleter completer) { |
91 | 79 | return MyBatis3Utils.selectList(this::selectMany, selectList, authVO, completer); |
92 | 80 | } |
93 | 81 |
|
94 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
95 | 82 | default List<AuthVO> selectDistinct(SelectDSLCompleter completer) { |
96 | 83 | return MyBatis3Utils.selectDistinct(this::selectMany, selectList, authVO, completer); |
97 | 84 | } |
98 | 85 |
|
99 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
100 | 86 | default int update(UpdateDSLCompleter completer) { |
101 | 87 | return MyBatis3Utils.update(this::update, authVO, completer); |
102 | 88 | } |
103 | 89 |
|
104 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
105 | | - static UpdateDSL<UpdateModel> updateAllColumns(AuthVO row, UpdateDSL<UpdateModel> dsl) { |
| 90 | + static UpdateDSL updateAllColumns(AuthVO row, UpdateDSL dsl) { |
106 | 91 | return dsl.set(userId).equalTo(row::getUserId) |
107 | 92 | .set(auth).equalTo(row::getAuth); |
108 | 93 | } |
109 | 94 |
|
110 | | - @Generated("org.mybatis.generator.api.MyBatisGenerator") |
111 | | - static UpdateDSL<UpdateModel> updateSelectiveColumns(AuthVO row, UpdateDSL<UpdateModel> dsl) { |
| 95 | + static UpdateDSL updateSelectiveColumns(AuthVO row, UpdateDSL dsl) { |
112 | 96 | return dsl.set(userId).equalToWhenPresent(row::getUserId) |
113 | 97 | .set(auth).equalToWhenPresent(row::getAuth); |
114 | 98 | } |
|
0 commit comments