package com.yc.education.service.impl;

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.JournalismMapper;
import com.yc.education.model.Journalism;
import com.yc.education.service.JournalismService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * huangpan
 * 2019/9/24
 * energy
 */
@Service
public class JournalismServiceImpl extends BaseService<Journalism> implements JournalismService {
    @Autowired
    JournalismMapper journalismMapper;
    @Override
    public List<Journalism> getJournalism(Integer pageNum, Integer pageSize, String titleName, Integer typesort) {
        PageHelper.startPage(pageNum, pageSize);
        return journalismMapper.getJournalism( titleName, typesort);
    }

    @Override
    public List<Journalism> findJOurnalism() {
        return journalismMapper.findJournalism();

    }

    @Override
    public Journalism getJournalismId(int id) {
        return journalismMapper.getJournalismId(id);
    }

    @Override
    public void deleteJournalismId(int id) {
        journalismMapper.deleteByPrimaryKey(id);

    }


}
