handler = (m, i) -> sqlParam(args[Integer.parseInt(m.group("idx"))]);
return replace(content, MP_SQL_PLACE_HOLDER, handler).toString();
@@ -280,9 +280,9 @@ public final class MPJStringUtils {
public static String sqlParam(Object obj) {
String repStr;
if (obj instanceof Collection) {
- repStr = MPJStringUtils.quotaMarkList((Collection>) obj);
+ repStr = StrUtils.quotaMarkList((Collection>) obj);
} else {
- repStr = MPJStringUtils.quotaMark(obj);
+ repStr = StrUtils.quotaMark(obj);
}
return repStr;
}
@@ -309,7 +309,7 @@ public final class MPJStringUtils {
* @return 单引号包含的原字符串的集合形式
*/
public static String quotaMarkList(Collection> coll) {
- return coll.stream().map(MPJStringUtils::quotaMark)
+ return coll.stream().map(StrUtils::quotaMark)
.collect(joining(StringPool.COMMA, StringPool.LEFT_BRACKET, StringPool.RIGHT_BRACKET));
}
@@ -440,8 +440,8 @@ public final class MPJStringUtils {
/**
* 删除字符前缀之后,首字母小写,之后字符大小写的不变
- * StringUtils.removePrefixAfterPrefixToLower( "isUser", 2 ) = user
- * StringUtils.removePrefixAfterPrefixToLower( "isUserInfo", 2 ) = userInfo
+ * StrUtils.removePrefixAfterPrefixToLower( "isUser", 2 ) = user
+ * StrUtils.removePrefixAfterPrefixToLower( "isUserInfo", 2 ) = userInfo
*
* @param rawString 需要处理的字符串
* @param index 删除多少个字符(从左至右)
@@ -453,7 +453,7 @@ public final class MPJStringUtils {
/**
* 驼峰转连字符
- * StringUtils.camelToHyphen( "managerAdminUserService" ) = manager-admin-user-service
+ * StrUtils.camelToHyphen( "managerAdminUserService" ) = manager-admin-user-service
*
* @param input ignore
* @return 以'-'分隔
@@ -525,11 +525,11 @@ public final class MPJStringUtils {
* 对字符串大小写敏感
*
*
- * StringUtils.equals(null, null) = true
- * StringUtils.equals(null, "abc") = false
- * StringUtils.equals("abc", null) = false
- * StringUtils.equals("abc", "abc") = true
- * StringUtils.equals("abc", "ABC") = false
+ * StrUtils.equals(null, null) = true
+ * StrUtils.equals(null, "abc") = false
+ * StrUtils.equals("abc", null) = false
+ * StrUtils.equals("abc", "abc") = true
+ * StrUtils.equals("abc", "ABC") = false
*
*
* @param cs1 第一个字符串, 可为 {@code null}
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/WrapperUtils.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/WrapperUtils.java
index 7167b85..d963111 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/WrapperUtils.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/WrapperUtils.java
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.TableFieldInfo;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.yulichang.adapter.AdapterHelper;
import com.github.yulichang.toolkit.sql.SqlScriptUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
@@ -28,18 +27,18 @@ public class WrapperUtils {
String first = Optional.ofNullable(wrapper.getSqlFirst()).orElse(StringPool.EMPTY);
boolean hasWhere = false;
String entityWhere = getEntitySql(tableInfo, wrapper);
- if (StringUtils.isNotBlank(entityWhere)) {
+ if (StrUtils.isNotBlank(entityWhere)) {
hasWhere = true;
}
String mainLogic = mainLogic(hasWhere, clazz, wrapper);
- if (StringUtils.isNotBlank(mainLogic)) {
+ if (StrUtils.isNotBlank(mainLogic)) {
hasWhere = true;
}
String subLogic = subLogic(hasWhere, wrapper);
- if (StringUtils.isNotBlank(subLogic)) {
+ if (StrUtils.isNotBlank(subLogic)) {
hasWhere = true;
}
- String sqlSegment = (wrapper.getSqlSegment() != null && StringUtils.isNotBlank(wrapper.getSqlSegment())) ?
+ String sqlSegment = (wrapper.getSqlSegment() != null && StrUtils.isNotBlank(wrapper.getSqlSegment())) ?
((wrapper.isEmptyOfNormal() ? StringPool.EMPTY : (hasWhere ? " AND " : " WHERE ")) + wrapper.getSqlSegment()) : StringPool.EMPTY;
String sqlComment = Optional.ofNullable(wrapper.getSqlComment()).orElse(StringPool.EMPTY);
@@ -97,7 +96,7 @@ public class WrapperUtils {
return StringPool.EMPTY;
}
String info = LogicInfoUtils.getLogicInfo(null, clazz, true, wrapper.getAlias());
- if (StringUtils.isNotBlank(info)) {
+ if (StrUtils.isNotBlank(info)) {
if (hasWhere) {
return " AND " + info;
}
@@ -108,7 +107,7 @@ public class WrapperUtils {
private static String subLogic(boolean hasWhere, MPJLambdaWrapper> wrapper) {
String sql = wrapper.getSubLogicSql();
- if (StringUtils.isNotBlank(sql)) {
+ if (StrUtils.isNotBlank(sql)) {
if (hasWhere) {
return sql;
}
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/sql/SqlScriptUtils.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/sql/SqlScriptUtils.java
index a69ddf8..ea98d00 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/sql/SqlScriptUtils.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/toolkit/sql/SqlScriptUtils.java
@@ -1,7 +1,7 @@
package com.github.yulichang.toolkit.sql;
import com.baomidou.mybatisplus.core.toolkit.Constants;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.github.yulichang.toolkit.StrUtils;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.TypeHandler;
@@ -42,16 +42,16 @@ public abstract class SqlScriptUtils implements Constants {
public static String convertTrim(final String sqlScript, final String prefix, final String suffix,
final String prefixOverrides, final String suffixOverrides) {
StringBuilder sb = new StringBuilder("").toString();
@@ -89,16 +89,16 @@ public abstract class SqlScriptUtils implements Constants {
public static String convertForeach(final String sqlScript, final String collection, final String index,
final String item, final String separator) {
StringBuilder sb = new StringBuilder("").toString();
@@ -151,7 +151,7 @@ public abstract class SqlScriptUtils implements Constants {
*/
public static String safeParam(final String param, final String mapping) {
String target = HASH_LEFT_BRACE + param;
- if (StringUtils.isBlank(mapping)) {
+ if (StrUtils.isBlank(mapping)) {
return target + RIGHT_BRACE;
}
return target + COMMA + mapping + RIGHT_BRACE;
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/DeleteJoinWrapper.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/DeleteJoinWrapper.java
index f2c3e62..3b05987 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/DeleteJoinWrapper.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/DeleteJoinWrapper.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.*;
import com.github.yulichang.adapter.AdapterHelper;
import com.github.yulichang.toolkit.LogicInfoUtils;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.toolkit.TableHelper;
import com.github.yulichang.toolkit.TableList;
import com.github.yulichang.wrapper.interfaces.DeleteChain;
@@ -71,7 +72,7 @@ public class DeleteJoinWrapper extends JoinAbstractLambdaWrapper extends JoinAbstractLambdaWrapper extends JoinAbstractLambdaWrapper extends JoinAbstractLambdaWrapper val != null && StringUtils.isNotBlank(val))
+ * .IfExists(val -> val != null && StrUtils.isNotBlank(val))
*
* @param IfExists 判断
* @return Children
@@ -237,7 +237,7 @@ public abstract class JoinAbstractWrapper Children allEq(boolean condition, Map, V> params, boolean null2IsNull) {
if (condition && CollectionUtils.isNotEmpty(params)) {
params.forEach((k, v) -> {
- if (StringUtils.checkValNotNull(v)) {
+ if (StrUtils.checkValNotNull(v)) {
eq(k, v);
} else {
if (null2IsNull) {
@@ -254,7 +254,7 @@ public abstract class JoinAbstractWrapper {
if (filter.test(k, v)) {
- if (StringUtils.checkValNotNull(v)) {
+ if (StrUtils.checkValNotNull(v)) {
eq(k, v);
} else {
if (null2IsNull) {
@@ -839,7 +839,7 @@ public abstract class JoinAbstractWrapper Children allEqStr(boolean condition, Map params, boolean null2IsNull) {
if (condition && CollectionUtils.isNotEmpty(params)) {
params.forEach((k, v) -> {
- if (StringUtils.checkValNotNull(v)) {
+ if (StrUtils.checkValNotNull(v)) {
eq(k, v);
} else {
if (null2IsNull) {
@@ -1093,7 +1093,7 @@ public abstract class JoinAbstractWrapper {
if (filter.test(k, v)) {
- if (StringUtils.checkValNotNull(v)) {
+ if (StrUtils.checkValNotNull(v)) {
eq(k, v);
} else {
if (null2IsNull) {
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/MPJLambdaWrapper.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/MPJLambdaWrapper.java
index a71002b..44045eb 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/MPJLambdaWrapper.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/MPJLambdaWrapper.java
@@ -5,10 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import com.baomidou.mybatisplus.core.toolkit.*;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.github.yulichang.config.ConfigProperties;
-import com.github.yulichang.toolkit.Constant;
+import com.github.yulichang.toolkit.*;
import com.github.yulichang.toolkit.LambdaUtils;
-import com.github.yulichang.toolkit.TableList;
-import com.github.yulichang.toolkit.WrapperUtils;
import com.github.yulichang.toolkit.support.ColumnCache;
import com.github.yulichang.wrapper.enums.IfExistsSqlKeyWordEnum;
import com.github.yulichang.wrapper.interfaces.*;
@@ -322,7 +320,7 @@ public class MPJLambdaWrapper extends JoinAbstractLambdaWrapper {
if (i.isStr()) {
return i.getColumn();
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/UpdateJoinWrapper.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/UpdateJoinWrapper.java
index 82782b6..d4eae6b 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/UpdateJoinWrapper.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/UpdateJoinWrapper.java
@@ -129,7 +129,7 @@ public class UpdateJoinWrapper extends JoinAbstractLambdaWrapper setApply(boolean condition, String applySql, MFunction consumerFunction, Object... values) {
- if (condition && StringUtils.isNotBlank(applySql)) {
+ if (condition && StrUtils.isNotBlank(applySql)) {
FuncConsumer funcConsumer = consumerFunction.apply(new FuncConsumer());
UpdateSet set = new UpdateSet();
set.setApply(true);
@@ -143,7 +143,7 @@ public class UpdateJoinWrapper extends JoinAbstractLambdaWrapper setSql(boolean condition, String sql) {
- if (condition && StringUtils.isNotBlank(sql)) {
+ if (condition && StrUtils.isNotBlank(sql)) {
if (Objects.isNull(sqlSet)) {
sqlSet = new ArrayList<>();
}
@@ -155,7 +155,7 @@ public class UpdateJoinWrapper extends JoinAbstractLambdaWrapper {
FieldCache field = fieldMap.get(dtoFieldName);
Assert.isFalse(Collection.class.isAssignableFrom(field.getType()), "association 不支持集合类");
MybatisLabel.Builder builder;
- builder = new MybatisLabel.Builder<>(StringUtils.isBlank(prefix) ? null : prefix,
+ builder = new MybatisLabel.Builder<>(StrUtils.isBlank(prefix) ? null : prefix,
dtoFieldName, child, field.getType(), (Class) field.getType(), true);
addLabel(builder.build(), false);
return getChildren();
@@ -186,7 +186,7 @@ public interface QueryLabel {
Class dtoClass = LambdaUtils.getEntityClass(dtoField);
FieldCache field = MPJReflectionKit.getFieldMap(dtoClass).get(dtoFieldName);
Assert.isFalse(Collection.class.isAssignableFrom(field.getType()), "association 不支持集合类");
- MybatisLabel.Builder builder = new MybatisLabel.Builder<>(StringUtils.isBlank(prefix) ? null : prefix,
+ MybatisLabel.Builder builder = new MybatisLabel.Builder<>(StrUtils.isBlank(prefix) ? null : prefix,
dtoFieldName, child, field.getType(), (Class) field.getType(), false);
MybatisLabel.Builder cfBuilder = collection.apply(builder);
addLabel(cfBuilder.build(), false);
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/resultmap/Result.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/resultmap/Result.java
index 2ac52db..6fe51e5 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/resultmap/Result.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/resultmap/Result.java
@@ -1,8 +1,8 @@
package com.github.yulichang.wrapper.resultmap;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.github.yulichang.toolkit.LambdaUtils;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.toolkit.support.ColumnCache;
import com.github.yulichang.wrapper.segments.SelectCache;
import lombok.AccessLevel;
@@ -71,7 +71,7 @@ public class Result implements IResult {
String name = LambdaUtils.getName(column);
SelectCache normal = normalMap.get(name);
result.selectNormal = normal;
- if (StringUtils.isBlank(result.property)) {
+ if (StrUtils.isBlank(result.property)) {
result.property = normal.getColumProperty();
}
if (Objects.isNull(result.javaType)) {
diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/SelectCache.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/SelectCache.java
index 130744e..1630f05 100644
--- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/SelectCache.java
+++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/segments/SelectCache.java
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.TableFieldInfo;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.yulichang.adapter.AdapterHelper;
-import com.github.yulichang.toolkit.MPJStringUtils;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.toolkit.ReflectionKit;
import com.github.yulichang.toolkit.TableHelper;
import lombok.Getter;
@@ -82,7 +82,7 @@ public class SelectCache implements Serializable {
this.column = column;
this.columnType = columnType;
this.columProperty = columProperty;
- this.tagColumn = MPJStringUtils.getTargetColumn(column);
+ this.tagColumn = StrUtils.getTargetColumn(column);
this.isSelect = isSelect;
if (Objects.isNull(tableFieldInfo)) {
this.hasTypeHandle = false;
diff --git a/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJMappingWrapper.java b/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJMappingWrapper.java
index a9a69e1..d5f0d91 100644
--- a/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJMappingWrapper.java
+++ b/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJMappingWrapper.java
@@ -3,7 +3,7 @@ package com.github.yulichang.extension.mapping.mapper;
import com.baomidou.mybatisplus.core.enums.SqlKeyword;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.toolkit.support.ColumnCache;
import com.github.yulichang.wrapper.segments.SelectCache;
import lombok.AllArgsConstructor;
@@ -44,12 +44,12 @@ public class MPJMappingWrapper {
public MPJMappingWrapper(Class> joinClass, String first, String select, com.github.yulichang.annotation.Apply[] applyArr,
com.github.yulichang.annotation.Condition[] conditions, String last, String[] orderByAsc, String[] orderByDesc) {
- this.hasFirst = StringUtils.isNotBlank(first);
+ this.hasFirst = StrUtils.isNotBlank(first);
if (this.hasFirst) {
this.first = first;
}
- this.hasSelect = StringUtils.isNotBlank(select);
+ this.hasSelect = StrUtils.isNotBlank(select);
if (this.hasSelect) {
this.select = select;
}
@@ -78,7 +78,7 @@ public class MPJMappingWrapper {
}
}
- this.hasLast = StringUtils.isNotBlank(last);
+ this.hasLast = StrUtils.isNotBlank(last);
if (this.hasLast) {
this.last = last;
}
@@ -91,7 +91,7 @@ public class MPJMappingWrapper {
for (String orderBy : orderByAsc) {
allColumns.addAll(Arrays.asList(orderBy.split(StringPool.COMMA)));
}
- this.orderByAsc = allColumns.stream().filter(StringUtils::isNotBlank).map(String::trim).map(f ->
+ this.orderByAsc = allColumns.stream().filter(StrUtils::isNotBlank).map(String::trim).map(f ->
colSet.contains(f) ? f : listField.stream().filter(s -> s.getColumProperty().equals(f))
.findFirst().map(SelectCache::getColumn).orElse(f)).collect(Collectors.toList());
}
@@ -104,7 +104,7 @@ public class MPJMappingWrapper {
for (String orderBy : orderByDesc) {
allColumns.addAll(Arrays.asList(orderBy.split(StringPool.COMMA)));
}
- this.orderByDesc = allColumns.stream().filter(StringUtils::isNotBlank).map(String::trim).map(f ->
+ this.orderByDesc = allColumns.stream().filter(StrUtils::isNotBlank).map(String::trim).map(f ->
colSet.contains(f) ? f : listField.stream().filter(s -> s.getColumProperty().equals(f))
.findFirst().map(SelectCache::getColumn).orElse(f)).collect(Collectors.toList());
}
diff --git a/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJTableFieldInfo.java b/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJTableFieldInfo.java
index d1a4b4e..7316305 100644
--- a/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJTableFieldInfo.java
+++ b/mybatis-plus-join-extension/src/main/java/com/github/yulichang/extension/mapping/mapper/MPJTableFieldInfo.java
@@ -3,12 +3,16 @@ package com.github.yulichang.extension.mapping.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.TableFieldInfo;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
-import com.baomidou.mybatisplus.core.toolkit.*;
+import com.baomidou.mybatisplus.core.toolkit.Assert;
+import com.baomidou.mybatisplus.core.toolkit.ClassUtils;
+import com.baomidou.mybatisplus.core.toolkit.ExceptionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.github.yulichang.adapter.AdapterHelper;
import com.github.yulichang.annotation.EntityMapping;
import com.github.yulichang.annotation.FieldMapping;
import com.github.yulichang.toolkit.ReflectionKit;
import com.github.yulichang.toolkit.SpringContentUtils;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.toolkit.TableHelper;
import com.github.yulichang.toolkit.support.ColumnCache;
import com.github.yulichang.wrapper.segments.SelectCache;
@@ -178,7 +182,7 @@ public class MPJTableFieldInfo {
}
private void initJoinField(String joinField) {
- if (StringUtils.isNotBlank(joinField)) {
+ if (StrUtils.isNotBlank(joinField)) {
this.joinProperty = joinField;
} else {
TableInfo info = getTableInfo(this.joinClass);
@@ -200,14 +204,14 @@ public class MPJTableFieldInfo {
this.joinField = getField(this.joinClass, joinFieldInfo);
}
Assert.notNull(this.joinField, "注解属性joinField不存在 %s , %s", this.joinClass.getName(),
- StringUtils.isBlank(this.joinProperty) ? "主键" : this.joinProperty);
+ StrUtils.isBlank(this.joinProperty) ? "主键" : this.joinProperty);
Assert.notNull(this.joinColumn, "注解属性joinField不存在 %s , %s", this.joinClass.getName(),
- StringUtils.isBlank(this.joinProperty) ? "主键" : this.joinProperty);
+ StrUtils.isBlank(this.joinProperty) ? "主键" : this.joinProperty);
this.joinField.setAccessible(true);
}
private void initThisField(String thisField) {
- if (StringUtils.isNotBlank(thisField)) {
+ if (StrUtils.isNotBlank(thisField)) {
this.thisProperty = thisField;
} else {
TableInfo info = getTableInfo(this.entityType);
@@ -220,13 +224,13 @@ public class MPJTableFieldInfo {
this.thisField = ReflectionKit.getFieldList(ClassUtils.getUserClass(entityType)).stream().filter(f ->
f.getName().equals(tableInfo.getKeyProperty())).findFirst().orElse(null);
Assert.notNull(this.thisField, "注解属性thisField不存在 %s , %s", entityType.getName(),
- StringUtils.isBlank(this.thisProperty) ? "主键" : this.thisProperty);
+ StrUtils.isBlank(this.thisProperty) ? "主键" : this.thisProperty);
this.thisColumn = tableInfo.getKeyColumn();
} else {
TableFieldInfo fieldInfo = tableInfo.getFieldList().stream().filter(f ->
f.getProperty().equals(this.thisProperty)).findFirst().orElse(null);
Assert.notNull(fieldInfo, "注解属性thisField不存在 %s , %s", entityType.getName(),
- StringUtils.isBlank(this.thisProperty) ? "主键" : this.thisProperty);
+ StrUtils.isBlank(this.thisProperty) ? "主键" : this.thisProperty);
this.thisField = getField(this.entityType, fieldInfo);
this.thisColumn = fieldInfo.getColumn();
}
@@ -269,20 +273,20 @@ public class MPJTableFieldInfo {
if (Objects.isNull(arr) || arr.length == 0) {
return false;
}
- return Arrays.stream(arr).anyMatch(StringUtils::isNotBlank);
+ return Arrays.stream(arr).anyMatch(StrUtils::isNotBlank);
}
private String propToColumn(Class> tag, String[] arr, String joinC) {
Map mapField = ColumnCache.getMapField(tag);
List args = null;
if (checkArr(arr)) {
- args = Arrays.stream(arr).filter(StringUtils::isNotBlank).map(c -> {
+ args = Arrays.stream(arr).filter(StrUtils::isNotBlank).map(c -> {
if (mapField.containsKey(c)) {
return mapField.get(c).getColumn();
}
return c;
}).collect(Collectors.toList());
- if (StringUtils.isNotBlank(joinC)) {
+ if (StrUtils.isNotBlank(joinC)) {
if (mapField.containsKey(joinC)) {
args.add(mapField.get(joinC).getColumn());
}
diff --git a/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/config/MybatisPlusConfig.java b/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/config/MybatisPlusConfig.java
index 241bf85..d91b11a 100644
--- a/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/config/MybatisPlusConfig.java
+++ b/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/config/MybatisPlusConfig.java
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
@@ -16,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerIntercept
import com.baomidou.mybatisplus.extension.toolkit.JdbcUtils;
import com.github.yulichang.injector.MPJSqlInjector;
import com.github.yulichang.test.util.ThreadLocalUtils;
+import com.github.yulichang.toolkit.StrUtils;
import lombok.SneakyThrows;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
@@ -149,7 +149,7 @@ public class MybatisPlusConfig {
@SneakyThrows
public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) {
BoundSql boundSql = sh.getBoundSql();
- if (boundSql != null && StringUtils.isNotBlank(boundSql.getSql())) {
+ if (boundSql != null && StrUtils.isNotBlank(boundSql.getSql())) {
String sql = boundSql.getSql();
this.dbType = Optional.ofNullable(this.dbType).orElse(JdbcUtils.getDbType(connection.getMetaData().getURL()));
if (P.test(this.dbType)) {
@@ -166,7 +166,7 @@ public class MybatisPlusConfig {
}
private String formatSql(String sql) {
- if (StringUtils.isBlank(sql)) {
+ if (StrUtils.isBlank(sql)) {
return sql;
}
sql = sql.replaceAll("\n", "");
diff --git a/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/util/ThreadLocalUtils.java b/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/util/ThreadLocalUtils.java
index 13ee788..8f5ea73 100644
--- a/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/util/ThreadLocalUtils.java
+++ b/mybatis-plus-join-test/test-base/src/main/java/com/github/yulichang/test/util/ThreadLocalUtils.java
@@ -1,9 +1,9 @@
package com.github.yulichang.test.util;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.yulichang.toolkit.StrUtils;
import lombok.SneakyThrows;
import java.util.Arrays;
@@ -31,13 +31,13 @@ public class ThreadLocalUtils {
@SneakyThrows
public static List get() {
String s = userThreadLocal.get();
- if (StringUtils.isBlank(s)) {
+ if (StrUtils.isBlank(s)) {
return null;
}
ObjectMapper mapper = new ObjectMapper();
- List sqlList = mapper.readValue(s, new TypeReference>() {
+ List sqlList = mapper.readValue(s, new TypeReference<>() {
});
- sqlList.removeIf(StringUtils::isBlank);
+ sqlList.removeIf(StrUtils::isBlank);
set("");
return sqlList;
}
diff --git a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/LambdaWrapperTest.java b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/LambdaWrapperTest.java
index d2a8e58..084a3c6 100644
--- a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/LambdaWrapperTest.java
+++ b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/LambdaWrapperTest.java
@@ -2,7 +2,6 @@ package com.github.yulichang.test.join;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.adapter.base.tookit.VersionUtils;
import com.github.yulichang.test.join.dto.AddressDTO;
@@ -14,6 +13,7 @@ import com.github.yulichang.test.join.mapper.*;
import com.github.yulichang.test.util.Reset;
import com.github.yulichang.test.util.ThreadLocalUtils;
import com.github.yulichang.toolkit.JoinWrappers;
+import com.github.yulichang.toolkit.StrUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.SneakyThrows;
import org.junit.jupiter.api.BeforeEach;
@@ -329,9 +329,9 @@ class LambdaWrapperTest {
.leftJoin(UserDO.class, "uc", UserDO::getId, UserDto::getUpdateBy, ext -> ext
.selectAs(UserDO::getName, UserDto::getUpdateName));
List userDtos = userDTOMapper.selectJoinList(UserDto.class, wrapper.clone());
- assert StringUtils.isNotBlank(userDtos.get(0).getUserName());
- assert StringUtils.isNotBlank(userDtos.get(0).getCreateName());
- assert StringUtils.isNotBlank(userDtos.get(0).getUpdateName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getUserName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getCreateName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getUpdateName());
ThreadLocalUtils.set("""
diff --git a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/apt/AptWrapperTest.java b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/apt/AptWrapperTest.java
index 81c8c1c..243ca1a 100644
--- a/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/apt/AptWrapperTest.java
+++ b/mybatis-plus-join-test/test-join/src/test/java/com/github/yulichang/test/join/apt/AptWrapperTest.java
@@ -2,7 +2,6 @@ package com.github.yulichang.test.join.apt;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.adapter.base.tookit.VersionUtils;
import com.github.yulichang.extension.apt.AptQueryWrapper;
@@ -16,6 +15,7 @@ import com.github.yulichang.test.join.entity.apt.*;
import com.github.yulichang.test.join.mapper.*;
import com.github.yulichang.test.util.Reset;
import com.github.yulichang.test.util.ThreadLocalUtils;
+import com.github.yulichang.toolkit.StrUtils;
import lombok.SneakyThrows;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -364,9 +364,9 @@ class AptWrapperTest {
.ge(ub.id, 0);
List userDtos = userDTOMapper.selectJoinList(UserDto.class, wrapper);
- assert StringUtils.isNotBlank(userDtos.get(0).getUserName());
- assert StringUtils.isNotBlank(userDtos.get(0).getCreateName());
- assert StringUtils.isNotBlank(userDtos.get(0).getUpdateName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getUserName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getCreateName());
+ assert StrUtils.isNotBlank(userDtos.get(0).getUpdateName());
ThreadLocalUtils.set("""
diff --git a/mybatis-plus-join-test/test-kotlin/src/test/java/com/github/yulichang/test/kt/LambdaWrapperTest.kt b/mybatis-plus-join-test/test-kotlin/src/test/java/com/github/yulichang/test/kt/LambdaWrapperTest.kt
index 9608248..8e72a69 100644
--- a/mybatis-plus-join-test/test-kotlin/src/test/java/com/github/yulichang/test/kt/LambdaWrapperTest.kt
+++ b/mybatis-plus-join-test/test-kotlin/src/test/java/com/github/yulichang/test/kt/LambdaWrapperTest.kt
@@ -1,7 +1,6 @@
package com.github.yulichang.test.kt
import com.baomidou.mybatisplus.core.metadata.IPage
-import com.baomidou.mybatisplus.core.toolkit.StringUtils
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.github.yulichang.extension.kt.KtDeleteJoinWrapper
import com.github.yulichang.extension.kt.KtLambdaWrapper
@@ -16,6 +15,7 @@ import com.github.yulichang.test.kt.mapper.UserDTOMapper
import com.github.yulichang.test.kt.mapper.UserMapper
import com.github.yulichang.test.util.Reset
import com.github.yulichang.test.util.ThreadLocalUtils
+import com.github.yulichang.toolkit.StrUtils
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
@@ -295,9 +295,9 @@ class LambdaWrapperTest {
ext.selectAs(UserDO::name, UserDto::updateName)
}
val userDtos: List = userDTOMapper!!.selectJoinList(UserDto::class.java, wrapper)
- assert(StringUtils.isNotBlank(userDtos[0].userName))
- assert(StringUtils.isNotBlank(userDtos[0].createName))
- assert(StringUtils.isNotBlank(userDtos[0].updateName))
+ assert(StrUtils.isNotBlank(userDtos[0].userName))
+ assert(StrUtils.isNotBlank(userDtos[0].createName))
+ assert(StrUtils.isNotBlank(userDtos[0].updateName))
ThreadLocalUtils.set(