/**
 * Copyright
 * All right reserved.
 * 项目名称:
 * 创建日期:2022/3/9
 */
package org.springblade.modules.business.notice.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.business.notice.dto.NoticeDTO;
import org.springblade.modules.business.notice.entity.NoticeEntity;
import org.springblade.modules.business.notice.mapper.NoticeMapper;
import org.springblade.modules.business.notice.service.INoticeService;
import org.springblade.modules.business.notice.vo.NoticeVO;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/***
 * Date:2022-03-08
 * Title:通知公告 服务实现类
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author liu-nan
 * @mender：（文件的修改者，文件创建者之外的人）
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
@Service
public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, NoticeEntity> implements INoticeService {

	@Override
	public List<NoticeVO> selectList(NoticeDTO noticeDTO) {
		return baseMapper.selectList(noticeDTO);
	}

	@Override
	public IPage<NoticeVO> selectPage(IPage<NoticeVO> page, NoticeDTO noticeDTO) {
		noticeDTO.setTenantId(AuthUtil.getTenantId());
		return page.setRecords(baseMapper.selectPage(page, noticeDTO));
	}

	@Override
	public Long unviewNoticeCount(NoticeDTO noticeDTO) {
		return baseMapper.unviewNoticeCount(noticeDTO);
	}

}
