package com.yida.data.school.news.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yida.data.common.core.entity.notice.EduNoticeSchoolReceiveStudent;
import com.yida.data.school.news.mapper.EduNoticeSchoolReceiveStudentMapper;
import com.yida.data.school.news.service.EduNoticeSchoolReceiveStudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Slf4j
@Service
@Transactional
public class EduNoticeSchoolReceiveStudentServiceImpl extends
    ServiceImpl<EduNoticeSchoolReceiveStudentMapper, EduNoticeSchoolReceiveStudent> implements
    EduNoticeSchoolReceiveStudentService {

    @Override
    public void confirmNotice(Long parentId, Long noticeId) {
        EduNoticeSchoolReceiveStudent notConfirm = new EduNoticeSchoolReceiveStudent();
        notConfirm.setParentId(parentId);
        notConfirm.setNoticeId(noticeId);
        notConfirm.setIsConfirm(0);
        update(Wrappers.lambdaUpdate(notConfirm)
            .set(EduNoticeSchoolReceiveStudent::getIsConfirm, 1));
    }
}
