package com.yunfeiyun.agmp.common.web.system.service.impl;

import com.yunfeiyun.agmp.common.framework.web.service.ISysOperLogService;
import com.yunfeiyun.agmp.common.web.system.mapper.SysOperLogMapper;
import com.yunfeiyun.agmp.common.core.domain.entity.SysOperLog;
import com.yunfeiyun.agmp.common.core.domain.model.IBaseOperLog;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 操作日志 服务层处理
 * 
 * @author 杨晓辉
 */
@Service
public class SysOperLogServiceImpl implements ISysOperLogService
{
    @Resource
    private SysOperLogMapper sysOperLogMapper;

    /**
     * 新增操作日志
     * 
     * @param operLog 操作日志对象
     */
    @Override
    public void insertOperlog(IBaseOperLog operLog)
    {
        operLog.setOperId(operLog.getId());
        sysOperLogMapper.insertOperlog(operLog);
    }

    /**
     * 查询系统操作日志集合
     * 
     * @param operLog 操作日志对象
     * @return 操作日志集合
     */
    @Override
    public List<IBaseOperLog> selectOperLogList(IBaseOperLog operLog)
    {
        return sysOperLogMapper.selectOperLogList(operLog);
    }

    /**
     * 批量删除系统操作日志
     * 
     * @param operIds 需要删除的操作日志ID
     * @return 结果
     */
    @Override
    public int deleteOperLogByIds(String[] operIds)
    {
        return sysOperLogMapper.deleteOperLogByIds(operIds);
    }

    /**
     * 查询操作日志详细
     * 
     * @param operId 操作ID
     * @return 操作日志对象
     */
    @Override
    public SysOperLog selectOperLogById(String operId)
    {
        return sysOperLogMapper.selectOperLogById(operId);
    }

    /**
     * 清空操作日志
     */
    @Override
    public void cleanOperLog()
    {
        sysOperLogMapper.cleanOperLog();
    }
}
