package com.ynfy.buss.practice.userpracticequestion.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ynfy.buss.practice.userpracticequestion.entity.UserPracticeQuestion;
import com.ynfy.buss.practice.userpracticequestion.mapper.UserPracticeQuestionMapper;
import com.ynfy.buss.practice.userpracticequestion.service.IUserPracticeQuestionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 用户练习题目表
 * @Author: jeecg-boot
 * @Date: 2023-11-19
 * @Version: V1.0
 */
@Service
public class UserPracticeQuestionServiceImpl extends ServiceImpl<UserPracticeQuestionMapper, UserPracticeQuestion> implements IUserPracticeQuestionService {


    @Override
    public List<UserPracticeQuestion> listByUserPracticeId(String userPracticeId) {
        LambdaQueryWrapper<UserPracticeQuestion> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserPracticeQuestion::getUserPracticeId, userPracticeId).orderByAsc(UserPracticeQuestion::getSort);
        return list(wrapper);
    }
}
