package com.seer.teach.teacher.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seer.teach.teacher.module.entity.ExampleQuestionsEntity;
import com.seer.teach.teacher.module.mapper.ExampleQuestionsMapper;
import com.seer.teach.teacher.service.ExampleQuestionsService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 例题表 服务实现类
 * </p>
 *
 * @author Wang
 * @since 2025-10-09 15:20:36
 */
@Service
public class ExampleQuestionsServiceImpl extends ServiceImpl<ExampleQuestionsMapper, ExampleQuestionsEntity> implements ExampleQuestionsService {

    @Override
    public List<ExampleQuestionsEntity> getQuestionsByKnowleIds(Collection<Integer> knowledgePointIds) {
        return super.list(new LambdaQueryWrapper<>(ExampleQuestionsEntity.class).in(ExampleQuestionsEntity::getKnowId, knowledgePointIds));
    }

    @Override
    public List<ExampleQuestionsEntity> getQuestionsByKnowleId(Integer knowledgePointId) {
        return super.list(new LambdaQueryWrapper<>(ExampleQuestionsEntity.class).eq(ExampleQuestionsEntity::getKnowId, knowledgePointId));
    }
}
