fix: selectSub配置无效

This commit is contained in:
yulichang 2024-06-16 20:18:20 +08:00
parent 86888633f6
commit 266d71293f
2 changed files with 4 additions and 2 deletions

View File

@ -65,11 +65,12 @@ public class MybatisPlusJoinAutoConfiguration {
ObjectProvider<MybatisPlusJoinIfExistsConsumer> IfExistsConsumers) {
this.properties = Optional.ofNullable(propertiesConsumers.getIfAvailable()).map(c -> c.config(properties)).orElse(properties);
ConfigProperties.banner = this.properties.getBanner();
ConfigProperties.subTableLogic = this.properties.getSubTableLogic();
ConfigProperties.msCache = this.properties.isMsCache();
ConfigProperties.tableAlias = this.properties.getTableAlias();
ConfigProperties.joinPrefix = this.properties.getJoinPrefix();
ConfigProperties.logicDelType = this.properties.getLogicDelType();
ConfigProperties.subQueryAlias = this.properties.getSubQueryAlias();
ConfigProperties.subTableLogic = this.properties.getSubTableLogic();
ConfigProperties.mappingMaxCount = this.properties.getMappingMaxCount();
ConfigProperties.ifExists = Optional.ofNullable(IfExistsConsumers.getIfAvailable())
.map(m -> (BiPredicate<Object, IfExistsSqlKeyWordEnum>) m)

View File

@ -51,13 +51,14 @@ public class XPluginImpl implements Plugin {
// 读取配置
Prop prop = new Prop(context.cfg());
ConfigProperties.banner = prop.get("banner", Boolean::parseBoolean);
ConfigProperties.subTableLogic = prop.get("subTableLogic", Boolean::parseBoolean);
ConfigProperties.msCache = prop.get("msCache", Boolean::parseBoolean);
ConfigProperties.tableAlias = prop.get("tableAlias", Function.identity());
ConfigProperties.joinPrefix = prop.get("joinPrefix", Function.identity());
ConfigProperties.logicDelType = prop.get("logicDelType", val ->
// fix on/off yes/no 会转为Boolean
LogicDelTypeEnum.WHERE.name().equalsIgnoreCase(val) ? LogicDelTypeEnum.WHERE : LogicDelTypeEnum.ON);
ConfigProperties.subTableLogic = prop.get("subTableLogic", Boolean::parseBoolean);
ConfigProperties.subQueryAlias = prop.get("subQueryAlias", Function.identity());
ConfigProperties.mappingMaxCount = prop.get("mappingMaxCount", Integer::parseInt);
ConfigProperties.ifExists = prop.get("ifExists", val ->
Arrays.stream(IfExistsEnum.values()).filter(e -> e.name().equalsIgnoreCase(val)).findFirst()