package com.dcsoft.system.service.impl;

import java.util.List;
import com.dcsoft.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dcsoft.system.mapper.SysEmpowerRecordMapper;
import com.dcsoft.system.domain.SysEmpowerRecord;
import com.dcsoft.system.service.ISysEmpowerRecordService;

/**
 * 授权记录Service业务层处理
 *
 * @author nichun
 * @date 2023-03-08
 */
@Service
public class SysEmpowerRecordServiceImpl implements ISysEmpowerRecordService
{
    @Autowired
    private SysEmpowerRecordMapper sysEmpowerRecordMapper;

    /**
     * 查询授权记录
     *
     * @param id 授权记录主键
     * @return 授权记录
     */
    @Override
    public SysEmpowerRecord selectSysEmpowerRecordById(Long id)
    {
        return sysEmpowerRecordMapper.selectSysEmpowerRecordById(id);
    }

    /**
     * 查询授权记录列表
     *
     * @param sysEmpowerRecord 授权记录
     * @return 授权记录
     */
    @Override
    public List<SysEmpowerRecord> selectSysEmpowerRecordList(SysEmpowerRecord sysEmpowerRecord)
    {
        return sysEmpowerRecordMapper.selectSysEmpowerRecordList(sysEmpowerRecord);
    }

    /**
     * 新增授权记录
     *
     * @param sysEmpowerRecord 授权记录
     * @return 结果
     */
    @Override
    public int insertSysEmpowerRecord(SysEmpowerRecord sysEmpowerRecord)
    {
        sysEmpowerRecord.setCreateTime(DateUtils.getNowDate());
        return sysEmpowerRecordMapper.insertSysEmpowerRecord(sysEmpowerRecord);
    }

    /**
     * 修改授权记录
     *
     * @param sysEmpowerRecord 授权记录
     * @return 结果
     */
    @Override
    public int updateSysEmpowerRecord(SysEmpowerRecord sysEmpowerRecord)
    {
        sysEmpowerRecord.setUpdateTime(DateUtils.getNowDate());
        return sysEmpowerRecordMapper.updateSysEmpowerRecord(sysEmpowerRecord);
    }

    /**
     * 批量删除授权记录
     *
     * @param ids 需要删除的授权记录主键
     * @return 结果
     */
    @Override
    public int deleteSysEmpowerRecordByIds(Long[] ids)
    {
        return sysEmpowerRecordMapper.deleteSysEmpowerRecordByIds(ids);
    }

    /**
     * 删除授权记录信息
     *
     * @param id 授权记录主键
     * @return 结果
     */
    @Override
    public int deleteSysEmpowerRecordById(Long id)
    {
        return sysEmpowerRecordMapper.deleteSysEmpowerRecordById(id);
    }

    @Override
    public int deleteSysEmpowerRecordByPeopleId(Long peopleId) {
        return sysEmpowerRecordMapper.deleteSysEmpowerRecordByPeopleId(peopleId);
    }
}
