package com.xinda.itsm.service.impl;

import java.util.List;
import com.xinda.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xinda.itsm.mapper.InspectionRecordMapper;
import com.xinda.itsm.domain.InspectionRecord;
import com.xinda.itsm.service.IInspectionRecordService;

/**
 * 巡检记录Service业务层处理
 * 
 * @author kerwincui
 * @date 2025-04-23
 */
@Service
public class InspectionRecordServiceImpl implements IInspectionRecordService 
{
    @Autowired
    private InspectionRecordMapper inspectionRecordMapper;

    /**
     * 查询巡检记录
     * 
     * @param id 巡检记录主键
     * @return 巡检记录
     */
    @Override
    public InspectionRecord selectInspectionRecordById(Long id)
    {
        return inspectionRecordMapper.selectInspectionRecordById(id);
    }

    /**
     * 查询巡检记录列表
     * 
     * @param inspectionRecord 巡检记录
     * @return 巡检记录
     */
    @Override
    public List<InspectionRecord> selectInspectionRecordList(InspectionRecord inspectionRecord)
    {
        return inspectionRecordMapper.selectInspectionRecordList(inspectionRecord);
    }

    /**
     * 新增巡检记录
     * 
     * @param inspectionRecord 巡检记录
     * @return 结果
     */
    @Override
    public int insertInspectionRecord(InspectionRecord inspectionRecord)
    {
        inspectionRecord.setCreateTime(DateUtils.getNowDate());
        return inspectionRecordMapper.insertInspectionRecord(inspectionRecord);
    }

    /**
     * 修改巡检记录
     * 
     * @param inspectionRecord 巡检记录
     * @return 结果
     */
    @Override
    public int updateInspectionRecord(InspectionRecord inspectionRecord)
    {
        inspectionRecord.setUpdateTime(DateUtils.getNowDate());
        return inspectionRecordMapper.updateInspectionRecord(inspectionRecord);
    }

    /**
     * 批量删除巡检记录
     * 
     * @param ids 需要删除的巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteInspectionRecordByIds(Long[] ids)
    {
        return inspectionRecordMapper.deleteInspectionRecordByIds(ids);
    }

    /**
     * 删除巡检记录信息
     * 
     * @param id 巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteInspectionRecordById(Long id)
    {
        return inspectionRecordMapper.deleteInspectionRecordById(id);
    }
}
