mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
feat: 新增是否添加 @Mapper 注解。
This commit is contained in:
parent
1e688d93e2
commit
93d1ceb6d1
@ -46,6 +46,11 @@ public class MapperConfig {
|
|||||||
*/
|
*/
|
||||||
private boolean overwriteEnable;
|
private boolean overwriteEnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否添加 {@code @Mapper} 注解。
|
||||||
|
*/
|
||||||
|
private boolean mapperAnnotation;
|
||||||
|
|
||||||
public String buildSuperClassImport() {
|
public String buildSuperClassImport() {
|
||||||
return supperClass.getName();
|
return supperClass.getName();
|
||||||
}
|
}
|
||||||
@ -114,4 +119,13 @@ public class MapperConfig {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMapperAnnotation() {
|
||||||
|
return mapperAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapperConfig setMapperAnnotation(boolean mapperAnnotation) {
|
||||||
|
this.mapperAnnotation = mapperAnnotation;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,5 +1,8 @@
|
|||||||
package #(packageConfig.mapperPackage);
|
package #(packageConfig.mapperPackage);
|
||||||
|
|
||||||
|
#if(mapperConfig.isMapperAnnotation())
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
#end
|
||||||
import #(mapperConfig.buildSuperClassImport());
|
import #(mapperConfig.buildSuperClassImport());
|
||||||
import #(packageConfig.entityPackage).#(table.buildEntityClassName());
|
import #(packageConfig.entityPackage).#(table.buildEntityClassName());
|
||||||
|
|
||||||
@ -9,6 +12,9 @@ import #(packageConfig.entityPackage).#(table.buildEntityClassName());
|
|||||||
* @author #(javadocConfig.getAuthor())
|
* @author #(javadocConfig.getAuthor())
|
||||||
* @since #(javadocConfig.getSince())
|
* @since #(javadocConfig.getSince())
|
||||||
*/
|
*/
|
||||||
|
#if(mapperConfig.isMapperAnnotation())
|
||||||
|
@Mapper
|
||||||
|
#end
|
||||||
public interface #(table.buildMapperClassName()) extends #(mapperConfig.buildSuperClassName())<#(table.buildEntityClassName())> {
|
public interface #(table.buildMapperClassName()) extends #(mapperConfig.buildSuperClassName())<#(table.buildEntityClassName())> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user