package com.zhongshu.card.server.core.dao.school;

import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.client.type.CardCancelState;
import com.zhongshu.card.server.core.dao.school.extend.CardInfoPoolDaoExtend;
import com.zhongshu.card.server.core.domain.school.Area;
import com.zhongshu.card.server.core.domain.school.CardInfoPool;

import java.util.List;

/**
 * 区域Dao
 *
 * @author TRX
 * @date 2024/3/21
 */
public interface CardInfoPoolDao extends MongoDao<CardInfoPool>, CardInfoPoolDaoExtend {

    CardInfoPool findTopById(String id);

    CardInfoPool findTopByCode(String code);

    CardInfoPool findTopByCodeAndOid(String code, String oid);

    CardInfoPool findTopByCodeAndProjectOid(String code, String projectOid);

    List<CardInfoPool> findTop10ByProjectOidAndCodeLikeAndIsUsedAndCardCancelState(String projectOid, String code, Boolean isUsed, CardCancelState cardCancelState);

    CardInfoPool findTopByProjectOidAndCodeAndIsUsedAndCardCancelState(String projectOid, String code, Boolean isUsed, CardCancelState cardCancelState);

    boolean existsByCodeAndProjectOid(String code, String projectOid);

    boolean existsByCode(String code);
}
