소스 검색

解决Service层调用兼容问题.

nieqiurong 1 년 전
부모
커밋
415f5aea3d
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      gradle.properties
  2. 2 2
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/mapper/BaseMapper.java

+ 1 - 1
gradle.properties

@@ -1,4 +1,4 @@
-APP_VERSION=3.5.6
+APP_VERSION=3.5.7-SNAPSHOT
 APP_GROUP=com.baomidou
 signing.keyId=1FD337F9
 signing.password=243194995

+ 2 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/mapper/BaseMapper.java

@@ -124,8 +124,8 @@ public interface BaseMapper<T> extends Mapper<T> {
      * @since 3.5.7
      */
     default int deleteById(Serializable id, boolean useFill) {
-        if (useFill) {
-            Class<?> entityClass = GenericTypeUtils.resolveTypeArguments(getClass(), BaseMapper.class)[0];
+        Class<?> entityClass = GenericTypeUtils.resolveTypeArguments(getClass(), BaseMapper.class)[0];
+        if (!entityClass.isAssignableFrom(id.getClass()) && useFill) {
             TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
             if (tableInfo.isWithLogicDelete() && tableInfo.isWithUpdateFill()) {
                 T instance = tableInfo.newInstance();