package com.viettel.campaign.repository.ccms_full;

import com.viettel.campaign.model.ccms_full.ContactCustResult;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.sql.Date;

@Repository
public interface ContactCustResultRepository extends JpaRepository<ContactCustResult, Long> {

    @Query(value = "SELECT MAX(createTime) FROM ContactCustResult WHERE campaignId = :campaignId AND agentId = :agentId AND status = 1")
    Date getMaxCreateTime(@Param("campaignId") Long campaignId, @Param("agentId") Long agentId);
}
