Commit 2d3fbdc9c72528b1964b6e9755072137c65c78ce
1 parent
c99184de
feat(mybatis): 扩展LambdaQueryWrapperX查询功能
Showing
1 changed file
with
37 additions
and
0 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java
| @@ -9,6 +9,7 @@ import org.springframework.util.StringUtils; | @@ -9,6 +9,7 @@ import org.springframework.util.StringUtils; | ||
| 9 | 9 | ||
| 10 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 11 | import java.util.Collection; | 11 | import java.util.Collection; |
| 12 | +import java.util.function.Consumer; | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能: | 15 | * 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能: |
| @@ -158,4 +159,40 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> { | @@ -158,4 +159,40 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> { | ||
| 158 | return this; | 159 | return this; |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 162 | + @Override | ||
| 163 | + public LambdaQueryWrapperX<T> exists(boolean condition, String existsSql, Object... values) { | ||
| 164 | + super.exists(condition, existsSql, values); | ||
| 165 | + return this; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + @Override | ||
| 169 | + public LambdaQueryWrapperX<T> notExists(boolean condition, String existsSql, Object... values) { | ||
| 170 | + super.notExists(condition, existsSql, values); | ||
| 171 | + return this; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + @Override | ||
| 175 | + public LambdaQueryWrapperX<T> and(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | ||
| 176 | + super.and(condition, consumer); | ||
| 177 | + return this; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + @Override | ||
| 181 | + public LambdaQueryWrapperX<T> or(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | ||
| 182 | + super.or(condition, consumer); | ||
| 183 | + return this; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + @Override | ||
| 187 | + public LambdaQueryWrapperX<T> nested(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | ||
| 188 | + super.nested(condition, consumer); | ||
| 189 | + return this; | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + @Override | ||
| 193 | + public LambdaQueryWrapperX<T> not(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | ||
| 194 | + super.not(condition, consumer); | ||
| 195 | + return this; | ||
| 196 | + } | ||
| 197 | + | ||
| 161 | } | 198 | } |