package com.crm.ucard.dao.repository;

import com.crm.rely.backend.core.pojo.table.ucard.SysUcardConfigTable;
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;

@Repository
public interface SysUcardConfigRepository extends BaseRepository<SysUcardConfigTable> {

    /**
     * 根据codes 获取系统配置信息
     *
     * @param codes code的列表
     * @return
     */
    List<SysUcardConfigTable> getByCodeIn(List<String> codes);

    /**
     * 根据银行code 获取系统配置信息
     *
     * @param code code
     * @return
     */
    SysUcardConfigTable getByCode(String code);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    SysUcardConfigTable findFirstByCode(String code);

}
