package com.viettel.campaign.repository;

import com.viettel.campaign.model.CustomerList;
import com.viettel.campaign.web.dto.ResultDTO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface CustomerListRepository extends JpaRepository<CustomerList, Long> {

    CustomerList findCustomerListByCustomerListId(long customerListId);

    CustomerList findByCustomerListCode(String customerListCode);

    @Modifying
    @Query("delete from CustomerList c where c.customerListId in (:ids)")
    int deleteIds(@Param("ids") List<Long> ids);
}
