<%_ if (position === 'import') { _%>
    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    <%_ } _%>
    <%_ if (ormTool === 'hibernate' && !implementsEagerLoadApis) { _%>
import java.util.Optional;
    <%_ } _%>
<%_ } _%>
<%_ if (position === 'method') { _%>
    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
    default Boolean existsByName(String name) {
        return this.selectCount(new LambdaQueryWrapper<UReportFile>().eq(UReportFile::getName, name)) > 0;
    }
    <%_ } else { _%>
    Boolean existsByName(String name);
    <%_ } _%>

    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
    default Optional<UReportFile> getByName(String name) {
        return Optional.ofNullable(this.selectOne(new LambdaQueryWrapper<UReportFile>().eq(UReportFile::getName, name)));
    }
    <%_ } else { _%>
    Optional<UReportFile> getByName(String name);
    <%_ } _%>

    <%_ if (ormTool === 'mybatis' && databaseTypeSql) { _%>
    default void deleteByName(String name) {
        this.delete(new LambdaQueryWrapper<UReportFile>().eq(UReportFile::getName, name));
    }
    <%_ } else { _%>
    void deleteByName(String name);
    <%_ } _%>
<%_ } _%>
