package com.ruoyi.manage.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.domain.DialIndicatorLog;
import com.ruoyi.manage.mapper.DialIndicatorLogMapper;
import com.ruoyi.manage.service.IDialIndicatorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 计报警记录Service业务层处理
 * 
 * @author boman
 * @date 2025-06-17
 */
@Service
public class DialIndicatorLogServiceImpl implements IDialIndicatorLogService
{
    @Autowired
    private DialIndicatorLogMapper dialIndicatorLogMapper;

    /**
     * 查询计报警记录
     * 
     * @param logId 计报警记录主键
     * @return 计报警记录
     */
    @Override
    public DialIndicatorLog selectDialIndicatorLogByLogId(Long logId)
    {
        return dialIndicatorLogMapper.selectDialIndicatorLogByLogId(logId);
    }

    /**
     * 查询计报警记录列表
     * 
     * @param dialIndicatorLog 计报警记录
     * @return 计报警记录
     */
    @Override
    public List<DialIndicatorLog> selectDialIndicatorLogList(DialIndicatorLog dialIndicatorLog)
    {
        return dialIndicatorLogMapper.selectDialIndicatorLogList(dialIndicatorLog);
    }

    /**
     * 新增计报警记录
     * 
     * @param dialIndicatorLog 计报警记录
     * @return 结果
     */
    @Override
    public int insertDialIndicatorLog(DialIndicatorLog dialIndicatorLog)
    {
        dialIndicatorLog.setCreateTime(DateUtils.getNowDate());
        return dialIndicatorLogMapper.insertDialIndicatorLog(dialIndicatorLog);
    }

    /**
     * 修改计报警记录
     * 
     * @param dialIndicatorLog 计报警记录
     * @return 结果
     */
    @Override
    public int updateDialIndicatorLog(DialIndicatorLog dialIndicatorLog)
    {
        dialIndicatorLog.setUpdateTime(DateUtils.getNowDate());
        return dialIndicatorLogMapper.updateDialIndicatorLog(dialIndicatorLog);
    }

    /**
     * 批量删除计报警记录
     * 
     * @param logIds 需要删除的计报警记录主键
     * @return 结果
     */
    @Override
    public int deleteDialIndicatorLogByLogIds(Long[] logIds)
    {
        return dialIndicatorLogMapper.deleteDialIndicatorLogByLogIds(logIds);
    }

    /**
     * 删除计报警记录信息
     * 
     * @param logId 计报警记录主键
     * @return 结果
     */
    @Override
    public int deleteDialIndicatorLogByLogId(Long logId)
    {
        return dialIndicatorLogMapper.deleteDialIndicatorLogByLogId(logId);
    }
}
