package com.ruoyi.ss.resetRecord.service;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.resetRecord.domain.SmResetRecord;
import com.ruoyi.ss.resetRecord.domain.SmResetRecordQuery;
import com.ruoyi.ss.resetRecord.domain.SmResetRecordVo;
import com.ruoyi.ss.resetRecord.mapper.SmResetRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 归零记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-01
 */
@Service
public class SmResetRecordServiceImpl implements ISmResetRecordService
{
    @Autowired
    private SmResetRecordMapper smResetRecordMapper;

    /**
     * 查询归零记录
     *
     * @param id 归零记录主键
     * @return 归零记录
     */
    @Override
    public SmResetRecordVo selectSmResetRecordById(Long id)
    {
        return smResetRecordMapper.selectSmResetRecordById(id);
    }

    /**
     * 查询归零记录列表
     *
     * @param smResetRecord 归零记录
     * @return 归零记录
     */
    @Override
    public List<SmResetRecordVo> selectSmResetRecordList(SmResetRecordQuery smResetRecord)
    {
        return smResetRecordMapper.selectSmResetRecordList(smResetRecord);
    }

    /**
     * 新增归零记录
     *
     * @param smResetRecord 归零记录
     * @return 结果
     */
    @Override
    public int insertSmResetRecord(SmResetRecord smResetRecord)
    {
        smResetRecord.setCreateTime(DateUtils.getNowDate());
        return smResetRecordMapper.insertSmResetRecord(smResetRecord);
    }

    /**
     * 修改归零记录
     *
     * @param smResetRecord 归零记录
     * @return 结果
     */
    @Override
    public int updateSmResetRecord(SmResetRecord smResetRecord)
    {
        return smResetRecordMapper.updateSmResetRecord(smResetRecord);
    }

    /**
     * 批量删除归零记录
     *
     * @param ids 需要删除的归零记录主键
     * @return 结果
     */
    @Override
    public int deleteSmResetRecordByIds(Long[] ids)
    {
        return smResetRecordMapper.deleteSmResetRecordByIds(ids);
    }

    /**
     * 删除归零记录信息
     *
     * @param id 归零记录主键
     * @return 结果
     */
    @Override
    public int deleteSmResetRecordById(Long id)
    {
        return smResetRecordMapper.deleteSmResetRecordById(id);
    }
}
