package com.utic.center.utic.traf.server.dao.repository.utic;

import com.utic.center.common.annotation.SqlOperation;
import com.utic.center.utic.traf.server.dao.mapper.utic.LinkMapper;
import com.utic.center.utic.traf.server.dto.LinkCountDto;
import com.utic.center.utic.traf.server.dto.LinkDto;
import com.utic.center.utic.traf.server.dto.LogicalLinkDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@RequiredArgsConstructor
public class LinkRepository {

    private final LinkMapper mapper;

    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "LINK(LEVEL_COUNT)")
    public LinkCountDto findLinkCount() {
        return this.mapper.findLinkCount();
    }
    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "LINK", param = "linkLevel")
    public List<LinkDto> findLinkAll(String linkLevel) {
        return this.mapper.findLinkAll(linkLevel);
    }
    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "LOGICALLINK", param = "linkLevel")
    public List<LogicalLinkDto> findLogicalLinkAll(String linkLevel) {
        return this.mapper.findLogicalLinkAll(linkLevel);
    }
}
