package com.dashitech.businessdata.dao;

import com.dashitech.businessdata.entity.CallRecordEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;

/**
 */
public interface ICallRecordDAO extends JpaRepository<CallRecordEntity, String> {
    CallRecordEntity save(CallRecordEntity callLogEntity);

    @Query(value = " select a from CallRecordEntity a where a.callerIdNumber=:callerIdNumber and a.destinationNumber=:destinationNumber and a.createdTime=:createdTime ")
    CallRecordEntity selectByParams(@Param("callerIdNumber") String callerIdNumber, @Param("destinationNumber") String destinationNumber, @Param("createdTime") Date createdTime);

    @Query(value = " select a.id from CallRecordEntity a where a.callAccept=:uuid ")
    Long selectIdByUuid(@Param("uuid") String uuid);
}
