package com.sundot.airport.equipment.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sundot.airport.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sundot.airport.equipment.mapper.EquipmentInspectionRecordMapper;
import com.sundot.airport.equipment.domain.EquipmentInspectionRecord;
import com.sundot.airport.equipment.service.IEquipmentInspectionRecordService;

/**
 * 设备定检记录Service业务层处理
 *
 * @author ruoyi
 * @date 2026-05-12
 */
@Service
public class EquipmentInspectionRecordServiceImpl extends ServiceImpl<EquipmentInspectionRecordMapper, EquipmentInspectionRecord> implements IEquipmentInspectionRecordService {
    @Autowired
    private EquipmentInspectionRecordMapper equipmentInspectionRecordMapper;

    /**
     * 查询设备定检记录
     *
     * @param id 设备定检记录主键
     * @return 设备定检记录
     */
    @Override
    public EquipmentInspectionRecord selectEquipmentInspectionRecordById(Long id) {
        return equipmentInspectionRecordMapper.selectEquipmentInspectionRecordById(id);
    }

    /**
     * 查询设备定检记录列表
     *
     * @param equipmentInspectionRecord 设备定检记录
     * @return 设备定检记录
     */
    @Override
    public List<EquipmentInspectionRecord> selectEquipmentInspectionRecordList(EquipmentInspectionRecord equipmentInspectionRecord) {
        return equipmentInspectionRecordMapper.selectEquipmentInspectionRecordList(equipmentInspectionRecord);
    }

    /**
     * 新增设备定检记录
     *
     * @param equipmentInspectionRecord 设备定检记录
     * @return 结果
     */
    @Override
    public int insertEquipmentInspectionRecord(EquipmentInspectionRecord equipmentInspectionRecord) {
        equipmentInspectionRecord.setCreateTime(DateUtils.getNowDate());
        return equipmentInspectionRecordMapper.insertEquipmentInspectionRecord(equipmentInspectionRecord);
    }

    /**
     * 修改设备定检记录
     *
     * @param equipmentInspectionRecord 设备定检记录
     * @return 结果
     */
    @Override
    public int updateEquipmentInspectionRecord(EquipmentInspectionRecord equipmentInspectionRecord) {
        equipmentInspectionRecord.setUpdateTime(DateUtils.getNowDate());
        return equipmentInspectionRecordMapper.updateEquipmentInspectionRecord(equipmentInspectionRecord);
    }

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

    /**
     * 删除设备定检记录信息
     *
     * @param id 设备定检记录主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentInspectionRecordById(Long id) {
        return equipmentInspectionRecordMapper.deleteEquipmentInspectionRecordById(id);
    }
}
