package com.crm.ucard.dao.mapper;


import com.crm.rely.backend.core.dto.ucard.CardApplyDto;
import com.crm.rely.backend.core.entity.base.BaseEntity;
import com.crm.rely.backend.core.entity.ucard.CardApplyPageEntity;
import com.crm.rely.backend.core.pojo.table.ucard.CardApplyTable;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CardApplyMapper {

    Integer countList(CardApplyPageEntity entity);

    List<CardApplyDto> pageList(CardApplyPageEntity entity);

    /**
     * 查询开卡中
     */
    CardApplyTable findByUniqueIdAndCardTypeId(@Param("uniqueId") String uniqueId, @Param("cardTypeId") Integer cardTypeId);

    /**
     * 查看详情
     */
    CardApplyDto findById(BaseEntity entity);

    CardApplyTable cardNumberVerify(String cardNumber);

    /**
     * 根据UniqueId 查询持卡人为拒绝并且持卡人id不为空的数据
     */
    CardApplyTable findByUniqueIdAndHolderIdNotNullAndHolderStatusIsReject(@Param("uniqueId") String uniqueId);

    List<String> queryAllUsedCardNumber();

}
