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

import com.utic.center.common.annotation.SqlOperation;
import com.utic.center.utic.traf.server.dao.mapper.dwdb.DwdbTrafficMapper;
import com.utic.center.utic.traf.server.dto.DataCountDto;
import com.utic.center.utic.traf.server.dto.LinkTrafCenterDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@Repository
@RequiredArgsConstructor
public class DwdbTrafficRepository {
    
    private final DwdbTrafficMapper mapper;

    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
    public DataCountDto findTrafficCenterHistDataExists(String targetMonth) {
        return this.mapper.findTrafficCenterHistDataExists(targetMonth);
    }
    @SqlOperation(type = SqlOperation.SqlType.TRUNCATE, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
    public int truncateTrafficCenterHist(String targetMonth) {
        return this.mapper.truncateTrafficCenterHist(targetMonth);
    }
    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
    public int insertTrafficCenterHist(String targetMonth, LinkTrafCenterDto obj) {
        return this.mapper.insertTrafficCenterHist(targetMonth, obj);
    }

}
