package com.cool.store.dao.store;

import com.cool.store.entity.store.StoreMaterialBlacklistDO;
import com.cool.store.mapper.store.StoreMaterialBlacklistMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * <p>
 * 门店物料黑名单
 * </p>
 *
 * @author wangff
 * @since 2026/3/31
 */
@Repository
@RequiredArgsConstructor
public class StoreMaterialBlacklistDAO {
    private final StoreMaterialBlacklistMapper storeMaterialBlacklistMapper;

    public List<StoreMaterialBlacklistDO> getByStoreId(String storeId) {
        Example example = new Example(StoreMaterialBlacklistDO.class);
        example.createCriteria()
                .andEqualTo("storeId", storeId);
        example.setOrderByClause("create_time DESC");
        return storeMaterialBlacklistMapper.selectByExample(example);
    }
}
