|
@@ -118,13 +118,13 @@ public abstract class AbstractTemplateEngine {
|
|
|
String entityName = tableInfo.getEntityName();
|
|
|
String mapperPath = getPathInfo(OutputFile.mapper);
|
|
|
Mapper mapper = this.getConfigBuilder().getStrategyConfig().mapper();
|
|
|
- if (mapper.isGenerateMapper() || (StringUtils.isNotBlank(tableInfo.getMapperName()) && StringUtils.isNotBlank(mapperPath))) {
|
|
|
+ if (mapper.isGenerateMapper()) {
|
|
|
String mapperFile = String.format((mapperPath + File.separator + tableInfo.getMapperName() + suffixJavaOrKt()), entityName);
|
|
|
outputFile(getOutputFile(mapperFile, OutputFile.mapper), objectMap, templateFilePath(mapper.getMapperTemplatePath()), getConfigBuilder().getStrategyConfig().mapper().isFileOverride());
|
|
|
}
|
|
|
// MpMapper.xml
|
|
|
String xmlPath = getPathInfo(OutputFile.xml);
|
|
|
- if (mapper.isGenerateMapperXml() || (StringUtils.isNotBlank(tableInfo.getXmlName()) && StringUtils.isNotBlank(xmlPath))) {
|
|
|
+ if (mapper.isGenerateMapperXml()) {
|
|
|
String xmlFile = String.format((xmlPath + File.separator + tableInfo.getXmlName() + ConstVal.XML_SUFFIX), entityName);
|
|
|
outputFile(getOutputFile(xmlFile, OutputFile.xml), objectMap, templateFilePath(mapper.getMapperXmlTemplatePath()), getConfigBuilder().getStrategyConfig().mapper().isFileOverride());
|
|
|
}
|
|
@@ -144,14 +144,12 @@ public abstract class AbstractTemplateEngine {
|
|
|
Service service = this.getConfigBuilder().getStrategyConfig().service();
|
|
|
if (service.isGenerateService()) {
|
|
|
String servicePath = getPathInfo(OutputFile.service);
|
|
|
- if (StringUtils.isNotBlank(tableInfo.getServiceName()) && StringUtils.isNotBlank(servicePath)) {
|
|
|
- String serviceFile = String.format((servicePath + File.separator + tableInfo.getServiceName() + suffixJavaOrKt()), entityName);
|
|
|
- outputFile(getOutputFile(serviceFile, OutputFile.service), objectMap, templateFilePath(service.getServiceTemplate()), getConfigBuilder().getStrategyConfig().service().isFileOverride());
|
|
|
- }
|
|
|
+ String serviceFile = String.format((servicePath + File.separator + tableInfo.getServiceName() + suffixJavaOrKt()), entityName);
|
|
|
+ outputFile(getOutputFile(serviceFile, OutputFile.service), objectMap, templateFilePath(service.getServiceTemplate()), getConfigBuilder().getStrategyConfig().service().isFileOverride());
|
|
|
}
|
|
|
// MpServiceImpl.java
|
|
|
String serviceImplPath = getPathInfo(OutputFile.serviceImpl);
|
|
|
- if (service.isGenerateServiceImpl() || (StringUtils.isNotBlank(tableInfo.getServiceImplName()) && StringUtils.isNotBlank(serviceImplPath))) {
|
|
|
+ if (service.isGenerateServiceImpl()) {
|
|
|
String implFile = String.format((serviceImplPath + File.separator + tableInfo.getServiceImplName() + suffixJavaOrKt()), entityName);
|
|
|
outputFile(getOutputFile(implFile, OutputFile.serviceImpl), objectMap, templateFilePath(service.getServiceImplTemplate()), getConfigBuilder().getStrategyConfig().service().isFileOverride());
|
|
|
}
|
|
@@ -168,7 +166,7 @@ public abstract class AbstractTemplateEngine {
|
|
|
// MpController.java
|
|
|
Controller controller = this.getConfigBuilder().getStrategyConfig().controller();
|
|
|
String controllerPath = getPathInfo(OutputFile.controller);
|
|
|
- if (controller.isGenerate() || (StringUtils.isNotBlank(tableInfo.getControllerName()) && StringUtils.isNotBlank(controllerPath))) {
|
|
|
+ if (controller.isGenerate()) {
|
|
|
String entityName = tableInfo.getEntityName();
|
|
|
String controllerFile = String.format((controllerPath + File.separator + tableInfo.getControllerName() + suffixJavaOrKt()), entityName);
|
|
|
outputFile(getOutputFile(controllerFile, OutputFile.controller), objectMap, templateFilePath(controller.getTemplatePath()), getConfigBuilder().getStrategyConfig().controller().isFileOverride());
|