package com.crm.manager.dao.repository;

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

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

/**
 * Created by max on 2020/6/17.
 */
@Repository
public interface CustomInfoRepository extends BaseRepository<CustomInfoTable> {

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

    CustomInfoTable getFirstByCId(Long cId);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    List<CustomInfoTable> findAllByAgentId(Long agentId);

    CustomInfoTable getFirstById(Long id);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    CustomInfoTable findFirstByEmail(String email);

}
