package com.crm.ucard.dao.repository;

import com.crm.rely.backend.core.pojo.table.ucard.CardRechargeOrderTable;
import com.crm.rely.backend.dao.repository.BaseRepository;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.jpa.repository.Lock;

import javax.persistence.LockModeType;

@Mapper
public interface CardRechargeOrderRepository extends BaseRepository<CardRechargeOrderTable> {

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    CardRechargeOrderTable findByMerchantOrderNo(String attr0);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    CardRechargeOrderTable getFirstById(Long id);

    CardRechargeOrderTable getFirstByCardNoAndStatusAndRechargeType(String cardNo, String status, String rechargeType);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    CardRechargeOrderTable getFirstByCardNoAndRechargeType(String cardNo, String rechargeType);
}
