调整bom依赖修改Insert忽略自增注入Bug

This commit is contained in:
hubin 2023-11-15 16:35:33 +08:00
parent 7493bd3dff
commit b21758ac8c
3 changed files with 8 additions and 4 deletions

View File

@ -13,11 +13,15 @@ apply plugin: "io.spring.dependency-management"
dependencyManagement {
dependencies {
dependency "com.baomidou:mybatis-plus-annotation:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-boot-starter:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-boot-starter-test:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-core:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-extension:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-generator:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-boot-starter:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-boot-starter-test:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-spring-boot-autoconfigure:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-spring-boot-test-autoconfigure:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-spring-boot3-starter:${APP_VERSION}"
dependency "com.baomidou:mybatis-plus-spring-boot3-starter-test:${APP_VERSION}"
}
}

View File

@ -373,7 +373,7 @@ public class TableInfo implements Constants {
*/
public String getAllInsertSqlColumnMaybeIf(final String prefix, boolean ignoreAutoIncrementColumn) {
final String newPrefix = prefix == null ? EMPTY : prefix;
if (ignoreAutoIncrementColumn) {
if (ignoreAutoIncrementColumn && idType == IdType.AUTO) {
return fieldList.stream().map(i -> i.getInsertSqlColumnMaybeIf(newPrefix))
.filter(Objects::nonNull).collect(joining(NEWLINE));
}

View File

@ -25,7 +25,7 @@ include 'spring-boot-starter'
include ':spring-boot-starter:mybatis-plus-boot-starter'
include ':spring-boot-starter:mybatis-plus-boot-starter-test'
include ':spring-boot-starter:mybatis-plus-spring-boot-autoconfigure'
include ':spring-boot-starter:mybatis-plus-spring-boot-test-autoconfigure'
include ':spring-boot-starter:mybatis-plus-spring-boot3-starter'
include ':spring-boot-starter:mybatis-plus-spring-boot3-starter-test'
include ':spring-boot-starter:mybatis-plus-spring-boot-test-autoconfigure'