<%_ if (position === 'import') { _%>
    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    <%_ } else { _%>
import java.util.Optional;
    <%_ } _%>
<%_ } _%>
<%_ if (position === 'method') { _%>

    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
    default Optional<CommonTable> findOneByEntityName(String entityName) {
        return Optional.ofNullable(this.selectOne(new LambdaQueryWrapper<CommonTable>().eq(CommonTable::getEntityName, entityName)));
    }
    <%_ } else { _%>
    Optional<CommonTable> findOneByEntityName(String entityName);
    <%_ } _%>
<%_ } _%>
