package com.yc.education.service.impl;/**
 * huangpan
 * 2019/10/15
 * energy
 */

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.PersonnelMapper;
import com.yc.education.model.Personnel;
import com.yc.education.service.PersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName PersonnelServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/15 11:37
 *@Version 1.0
 */
@Service
public class PersonnelServiceImpl extends BaseService<Personnel> implements PersonnelService {
    @Autowired
    PersonnelMapper personnelMapper;

    @Override
    public List<Personnel> getPersonnels() {
        return personnelMapper.getPersonnels();
    }

    @Override
    public Personnel getPersonnelById(Integer id) {
        return personnelMapper.getPersonnelById(id);
    }

    @Override
    public void delPersonnel(Integer id) {
        personnelMapper.deleteByPrimaryKey(id);


    }

    @Override
    public Personnel getPersonnelLogin(String name, String password) {
        return personnelMapper.getPersonnelLogin(name, password);
    }

    @Override
    public List<Personnel> getPersonnelPage(Integer pageNum, Integer pageSize, String titleName) {
        PageHelper.startPage(pageNum, pageSize);
        return personnelMapper.getPersonnelPage(titleName);
    }
}
