package com.yc.education.service.impl;/**
 * huangpan
 * 2019/11/5
 * tongnai
 */

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.NewsenMapper;
import com.yc.education.model.Newsen;
import com.yc.education.service.NewsenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName NewsServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/11/5 11:59
 *@Version 1.0
 */
@Service
public class NewsenServiceImpl extends BaseService<Newsen> implements NewsenService {
    @Autowired
    NewsenMapper newsenMapper;

    @Override
    public List<Newsen> getNews(Integer pageSize, Integer pageNum, String titleName,String startTime,String endTime) {
        PageHelper.startPage(pageNum, pageSize);
        return newsenMapper.getNews(titleName,startTime,endTime );
    }

    @Override
    public Newsen getNewsById(Integer id) {
        return newsenMapper.getNewsById(id);
    }

    @Override
    public void delNewsById(Integer id) {
        newsenMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Newsen selNewsId() {
        return newsenMapper.selNewsId();
    }

    @Override
    public List<Newsen> selNews() {
        return newsenMapper.selNews();
    }

    @Override
    public Newsen selNewsSize(Integer id) {
        return newsenMapper.selNewsSize(id);
    }

    @Override
    public Newsen selNewsNum(Integer id) {
        return newsenMapper.selNewsNum(id);
    }
}
