package cn.sh.stc.sict.theme.hphy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;

import cn.sh.stc.sict.theme.hphy.dao.HphyQuestionOptionMapper;
import cn.sh.stc.sict.theme.hphy.model.HphyQuestionOption;
import cn.sh.stc.sict.theme.hphy.service.HphyQuestionOptionService;

import java.util.List;


@Service("hphyQuestionOptionService")
@AllArgsConstructor
public class HphyQuestionOptionServiceImpl extends ServiceImpl<HphyQuestionOptionMapper, HphyQuestionOption> implements HphyQuestionOptionService {

    private final HphyQuestionOptionMapper hphyQuestionOptionMapper;

    @Override
    public List<HphyQuestionOption> listByQuestionId(Long questionId) {
        LambdaQueryWrapper<HphyQuestionOption> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(HphyQuestionOption::getQuestionId, questionId)
                .orderByAsc(HphyQuestionOption::getSort);
        return this.list(wrapper);
    }
}
