templates.service.impl.ftl Maven / Gradle / Ivy
package ${entityInfo.serviceImplPackage};
<#list imports as pkg>
import ${pkg};
#list>
/**
*
* ${entityInfo.tableInfo.remarks!} Service 实现类
*
*
* @author ${author!}
* @since ${date}
*/
@${serviceAnnotationName}
public class ${entityInfo.serviceImplName}${superExtend}<#if serviceImplConfig.isGeneric()><${entityInfo.name},<#if entityInfo.idFieldInfo??>${entityInfo.idFieldInfo.typeName}<#else>Void#if>>#if><#if serviceConfig.isEnable()> implements ${entityInfo.serviceName}#if> {
<#if serviceImplConfig.isInjectDao(generatorConfig)>
@${autowiredAnnotationName}
private ${serviceImplConfig.injectDaoClassName(generatorConfig,entityInfo)} ${util.firstToLower(serviceImplConfig.injectDaoClassName(generatorConfig,entityInfo))};
protected ${serviceImplConfig.injectDaoClassName(generatorConfig,entityInfo)} getDao() {
return ${util.firstToLower(serviceImplConfig.injectDaoClassName(generatorConfig,entityInfo))};
}
#if>
<#if !serviceImplConfig.isInjectDao(generatorConfig) && serviceImplConfig.isInjectMapper()>
@${autowiredAnnotationName}
private ${serviceImplConfig.mapperClassName(entityInfo)} ${util.firstToLower(serviceImplConfig.mapperClassName(entityInfo))};
protected ${entityInfo.mapperName} getMapper(){
return this.${util.firstToLower(entityInfo.mapperName)};
}
private QueryChain<${entityInfo.name}> queryChain() {
return QueryChain.of(${util.firstToLower(serviceImplConfig.mapperClassName(entityInfo))});
}
private UpdateChain updateChain() {
return UpdateChain.of(${util.firstToLower(serviceImplConfig.mapperClassName(entityInfo))});
}
private InsertChain insertChain(){
return InsertChain.of(${util.firstToLower(serviceImplConfig.mapperClassName(entityInfo))});
}
private DeleteChain deleteChain(){
return DeleteChain.of(${util.firstToLower(serviceImplConfig.mapperClassName(entityInfo))});
}
#if>
}