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

import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.client.type.DictionaryType;
import com.zhongshu.card.server.core.dao.dictionary.extend.DictionaryDaoExtend;
import com.zhongshu.card.server.core.dao.dictionary.extend.DictionaryItemDaoExtend;
import com.zhongshu.card.server.core.domain.dictionary.DictionaryItem;

import java.util.List;

public interface DictionaryItemDao extends MongoDao<DictionaryItem>, DictionaryItemDaoExtend {

    DictionaryItem findTopById(String id);

    DictionaryItem findTopByDictionary_IdAndKey(String dictionaryId, String key);

    List<DictionaryItem> findTopByDictionary_IdAndKeyIn(String dictionaryId, List<String> keys);

    List<DictionaryItem> findByDictionary_Id(String dictionaryId);

    List<DictionaryItem> findByDictionary_IdIn(List<String> dictionaryIds);

    void deleteByDictionary_IdAndKeyNotInAndTypeIn(String dictionaryId, List<String> keys, List<DictionaryType> type);
}
