package com.ruoyi.mall.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallWarnOperateLogMapper;
import com.ruoyi.mall.domain.MallWarnOperateLog;
import com.ruoyi.mall.service.IMallWarnOperateLogService;

import javax.annotation.Resource;

/**
 * 告警操作记录Service业务层处理
 *
 * @author LCL
 * @date 2024-03-18
 */
@Service
public class MallWarnOperateLogServiceImpl implements IMallWarnOperateLogService
{
    @Resource
    private MallWarnOperateLogMapper mallWarnOperateLogMapper;

    /**
     * 查询告警操作记录
     *
     * @param warnOperateLogId 告警操作记录主键
     * @return 告警操作记录
     */
    @Override
    public MallWarnOperateLog selectMallWarnOperateLogByWarnOperateLogId(Long warnOperateLogId)
    {
        return mallWarnOperateLogMapper.selectMallWarnOperateLogByWarnOperateLogId(warnOperateLogId);
    }

    /**
     * 查询告警操作记录列表
     *
     * @param mallWarnOperateLog 告警操作记录
     * @return 告警操作记录
     */
    @Override
    public List<MallWarnOperateLog> selectMallWarnOperateLogList(MallWarnOperateLog mallWarnOperateLog)
    {
        return mallWarnOperateLogMapper.selectMallWarnOperateLogList(mallWarnOperateLog);
    }

    /**
     * 新增告警操作记录
     *
     * @param mallWarnOperateLog 告警操作记录
     * @return 结果
     */
    @Override
    public int insertMallWarnOperateLog(MallWarnOperateLog mallWarnOperateLog)
    {
        mallWarnOperateLog.setCreateAt(DateUtils.getTime());
        return mallWarnOperateLogMapper.insertMallWarnOperateLog(mallWarnOperateLog);
    }

    /**
     * 修改告警操作记录
     *
     * @param mallWarnOperateLog 告警操作记录
     * @return 结果
     */
    @Override
    public int updateMallWarnOperateLog(MallWarnOperateLog mallWarnOperateLog)
    {
        mallWarnOperateLog.setUpdateAt(DateUtils.getTime());
        return mallWarnOperateLogMapper.updateMallWarnOperateLog(mallWarnOperateLog);
    }

    /**
     * 批量删除告警操作记录
     *
     * @param warnOperateLogIds 需要删除的告警操作记录主键
     * @return 结果
     */
    @Override
    public int deleteMallWarnOperateLogByWarnOperateLogIds(Long[] warnOperateLogIds)
    {
        return mallWarnOperateLogMapper.deleteMallWarnOperateLogByWarnOperateLogIds(warnOperateLogIds);
    }

    /**
     * 删除告警操作记录信息
     *
     * @param warnOperateLogId 告警操作记录主键
     * @return 结果
     */
    @Override
    public int deleteMallWarnOperateLogByWarnOperateLogId(Long warnOperateLogId)
    {
        return mallWarnOperateLogMapper.deleteMallWarnOperateLogByWarnOperateLogId(warnOperateLogId);
    }

    /**
     * APP查询告警操作记录列表
     *
     * @param params 参数
     * @return 告警操作记录集合
     */
    @Override
    public List<Map<String, Object>> selectAppMallWarnOperateLogList(Map<String, Object> params) {
        return mallWarnOperateLogMapper.selectAppMallWarnOperateLogList(params);
    }
}
