package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.checkPoint.CheckPointRecord;
import com.ruoyi.system.mapper.CheckPointRecordMapper;
import com.ruoyi.system.service.ICheckPointRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 巡更点记录Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class CheckPointRecordServiceImpl implements ICheckPointRecordService 
{
    @Autowired
    private CheckPointRecordMapper checkPointRecordMapper;

    /**
     * 查询巡更点记录
     * 
     * @param checkPointRecordId 巡更点记录主键
     * @return 巡更点记录
     */
    @Override
    public CheckPointRecord selectCheckPointRecordByCheckPointRecordId(Long checkPointRecordId)
    {
        return checkPointRecordMapper.selectCheckPointRecordByCheckPointRecordId(checkPointRecordId);
    }

    /**
     * 查询巡更点记录列表
     * 
     * @param checkPointRecord 巡更点记录
     * @return 巡更点记录
     */
    @Override
    public List<CheckPointRecord> selectCheckPointRecordList(CheckPointRecord checkPointRecord)
    {
        return checkPointRecordMapper.selectCheckPointRecordList(checkPointRecord);
    }

    /**
     * 新增巡更点记录
     * 
     * @param checkPointRecord 巡更点记录
     * @return 结果
     */
    @Override
    public int insertCheckPointRecord(CheckPointRecord checkPointRecord)
    {
        checkPointRecord.setCreateTime(DateUtils.getNowDate());
        return checkPointRecordMapper.insertCheckPointRecord(checkPointRecord);
    }

    /**
     * 修改巡更点记录
     * 
     * @param checkPointRecord 巡更点记录
     * @return 结果
     */
    @Override
    public int updateCheckPointRecord(CheckPointRecord checkPointRecord)
    {
        checkPointRecord.setUpdateTime(DateUtils.getNowDate());
        return checkPointRecordMapper.updateCheckPointRecord(checkPointRecord);
    }

    /**
     * 批量删除巡更点记录
     * 
     * @param checkPointRecordIds 需要删除的巡更点记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckPointRecordByCheckPointRecordIds(Long[] checkPointRecordIds)
    {
        return checkPointRecordMapper.deleteCheckPointRecordByCheckPointRecordIds(checkPointRecordIds);
    }

    /**
     * 删除巡更点记录信息
     * 
     * @param checkPointRecordId 巡更点记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckPointRecordByCheckPointRecordId(Long checkPointRecordId)
    {
        return checkPointRecordMapper.deleteCheckPointRecordByCheckPointRecordId(checkPointRecordId);
    }
}
