|
@@ -3,10 +3,15 @@ package com.baomidou.mybatisplus.extension.service.additional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.interfaces.Compare;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.interfaces.Func;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.interfaces.Join;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.interfaces.Nested;
|
|
|
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
import java.util.Map;
|
|
|
import java.util.function.BiPredicate;
|
|
|
+import java.util.function.Function;
|
|
|
|
|
|
/**
|
|
|
* , Func<This, R>, Join<This>, Nested<This>
|
|
@@ -15,8 +20,8 @@ import java.util.function.BiPredicate;
|
|
|
* @since 2018-12-19
|
|
|
*/
|
|
|
@SuppressWarnings({"serial", "unchecked"})
|
|
|
-public abstract class ChainWrapper<T, R, This extends ChainWrapper<T, R, This>> extends Wrapper<T>
|
|
|
- implements Compare<This, R> {
|
|
|
+public abstract class AbstractChainWrapper<T, R, This extends AbstractChainWrapper<T, R, This>> extends Wrapper<T>
|
|
|
+ implements Compare<This, R>, Func<This, R>, Join<This>, Nested<This> {
|
|
|
protected final This typedThis = (This) this;
|
|
|
|
|
|
protected abstract AbstractWrapper getWrapper();
|
|
@@ -120,6 +125,108 @@ public abstract class ChainWrapper<T, R, This extends ChainWrapper<T, R, This>>
|
|
|
return typedThis;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public This isNull(boolean condition, R column) {
|
|
|
+ getWrapper().isNull(condition, column);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This isNotNull(boolean condition, R column) {
|
|
|
+ getWrapper().isNotNull(condition, column);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This in(boolean condition, R column, Collection<?> coll) {
|
|
|
+ getWrapper().in(condition, column, coll);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This notIn(boolean condition, R column, Collection<?> coll) {
|
|
|
+ getWrapper().notIn(condition, column, coll);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This inSql(boolean condition, R column, String inValue) {
|
|
|
+ getWrapper().inSql(condition, column, inValue);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This notInSql(boolean condition, R column, String inValue) {
|
|
|
+ getWrapper().notInSql(condition, column, inValue);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This groupBy(boolean condition, R... columns) {
|
|
|
+ getWrapper().groupBy(condition, columns);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This orderBy(boolean condition, boolean isAsc, R... columns) {
|
|
|
+ getWrapper().orderBy(condition, isAsc, columns);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This having(boolean condition, String sqlHaving, Object... params) {
|
|
|
+ getWrapper().having(condition, sqlHaving, params);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This or(boolean condition) {
|
|
|
+ getWrapper().or(condition);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This apply(boolean condition, String applySql, Object... value) {
|
|
|
+ getWrapper().apply(condition, applySql, value);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This last(boolean condition, String lastSql) {
|
|
|
+ getWrapper().last(condition, lastSql);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This exists(boolean condition, String existsSql) {
|
|
|
+ getWrapper().exists(condition, existsSql);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This notExists(boolean condition, String notExistsSql) {
|
|
|
+ getWrapper().notExists(condition, notExistsSql);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This and(boolean condition, Function<This, This> func) {
|
|
|
+ getWrapper().and(condition, func);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This or(boolean condition, Function<This, This> func) {
|
|
|
+ getWrapper().or(condition, func);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public This nested(boolean condition, Function<This, This> func) {
|
|
|
+ getWrapper().nested(condition, func);
|
|
|
+ return typedThis;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public String getSqlSegment() {
|
|
|
return getWrapper().getSqlSegment();
|