package com.crm.web.dao.repository;

import com.crm.rely.backend.dao.repository.BaseRepository;
import com.crm.rely.backend.model.pojo.table.WebCustomAnalysisTemplateTable;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;
import java.util.List;

@Repository
public interface WebCustomAnalysisTemplateRepository extends BaseRepository<WebCustomAnalysisTemplateTable> {

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    WebCustomAnalysisTemplateTable findFirstById(Long id);

    WebCustomAnalysisTemplateTable getFirstById(Long id);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    List<WebCustomAnalysisTemplateTable> findAllByIdIn(List<Long> ids);

    List<WebCustomAnalysisTemplateTable> getAllByIdNotIn(List<Long> ids);
}
