package io.renren.service.impl;


import io.renren.dao.SysPeopleMapper;
import io.renren.entity.SysPeople;
import io.renren.service.ISysPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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


/**
 * 人员管理Service业务层处理
 *
 * @author nichun
 * @date 2023-03-08
 */
@Service
public class SysPeopleServiceImpl implements ISysPeopleService
{
    @Autowired
    private SysPeopleMapper sysPeopleMapper;

    /**
     * 查询人员管理
     *
     * @param id 人员管理主键
     * @return 人员管理
     */
    @Override
    public SysPeople selectSysPeopleById(Long id)
    {
        return sysPeopleMapper.selectSysPeopleById(id);
    }

    /**
     * 查询人员管理列表
     *
     * @param sysPeople 人员管理
     * @return 人员管理
     */
    @Override
    public List<SysPeople> selectSysPeopleList(SysPeople sysPeople)
    {
        return sysPeopleMapper.selectSysPeopleList(sysPeople);
    }

    /**
     * 新增人员管理
     *
     * @param sysPeople 人员管理
     * @return 结果
     */
    @Override
    public int insertSysPeople(SysPeople sysPeople)
    {
        sysPeople.setCreateTime(new Date());
        return sysPeopleMapper.insertSysPeople(sysPeople);
    }

    /**
     * 修改人员管理
     *
     * @param sysPeople 人员管理
     * @return 结果
     */
    @Override
    public int updateSysPeople(SysPeople sysPeople)
    {
        sysPeople.setUpdateTime(new Date());
        return sysPeopleMapper.updateSysPeople(sysPeople);
    }

    /**
     * 批量删除人员管理
     *
     * @param ids 需要删除的人员管理主键
     * @return 结果
     */
    @Override
    public int deleteSysPeopleByIds(Long[] ids)
    {
        return sysPeopleMapper.deleteSysPeopleByIds(ids);
    }

    /**
     * 删除人员管理信息
     *
     * @param id 人员管理主键
     * @return 结果
     */
    @Override
    public int deleteSysPeopleById(Long id)
    {
        return sysPeopleMapper.deleteSysPeopleById(id);
    }

    @Override
    public SysPeople selectSysPeopleByOpenId(String openid) {
        return sysPeopleMapper.selectSysPeopleByOpenId(openid);
    }

    @Override
    public SysPeople selectSysPeopleByIdPwd(SysPeople sysPeople) {
        return sysPeopleMapper.selectSysPeopleByIdPwd(sysPeople);
    }

    @Override
    public SysPeople selectSysPeopleByGuid(SysPeople sysPeople) {
        return sysPeopleMapper.selectByGuid(sysPeople);
    }


}
