package com.xjrsoft.module.student.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
import com.xjrsoft.module.student.entity.StudentReportRecord;
import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
import com.xjrsoft.module.student.service.IStudentReportRecordService;
import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @title: 学生报到记录表
* @Author dzx
* @Date: 2024-08-28
* @Version 1.0
*/
@Service
@AllArgsConstructor
public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentReportRecordMapper, StudentReportRecord> implements IStudentReportRecordService {
    @Override
    public StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto) {
        return this.baseMapper.getClassStatistics(dto);
    }

    @Override
    public List<StudentReportRecordStatisticsListVo> getStatisticsDataList(StudentReportRecordStatisticsDto dto) {
        return this.baseMapper.getStatisticsDataList(dto);
    }

    @Override
    public Boolean removeByUserId(List<Long> ids) {
        this.baseMapper.delete(
            new QueryWrapper<StudentReportRecord>().lambda().in(StudentReportRecord::getUserId, ids)
        );
        return true;
    }

    @Override
    public Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, StudentReportRecordPageDto dto) {
        return this.baseMapper.getMobilePage(page, dto);
    }
}
