package com.ruoyi.course.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.course.domain.ScStudent;
import com.ruoyi.course.mapper.ScStudentMapper;
import com.ruoyi.course.service.IScStudentService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 学生基本信息 服务实现类
 * </p>
 *
 *
 * @since 2020-04-27 07:13:40
 */
@Service
public class ScStudentServiceImpl extends ServiceImpl<ScStudentMapper, ScStudent> implements IScStudentService {


    @Override
    public  Long getStudentByAppUserId(Long appUserId){
        QueryWrapper<ScStudent> qw = new QueryWrapper<>();
        qw.eq("app_user_id", appUserId);
        ScStudent student = this.getOne(qw);
        if (null != student) {
            return student.getStudentId();
        }
        return null;
    }
}
