package com.ruoyi.project.inspection.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.inspection.mapper.TInspectionRecordMapper;
import com.ruoyi.project.inspection.domain.TInspectionRecord;
import com.ruoyi.project.inspection.service.ITInspectionRecordService;

/**
 * 巡检记录Service业务层处理
 *
 * @author ruoyi
 * @date 2022-06-22
 */
@Service
public class TInspectionRecordServiceImpl implements ITInspectionRecordService
{
    @Autowired
    private TInspectionRecordMapper tInspectionRecordMapper;

    /**
     * 查询巡检记录
     *
     * @param id 巡检记录ID
     * @return 巡检记录
     */
    @Override
    public TInspectionRecord selectTInspectionRecordById(Long id)
    {
        return tInspectionRecordMapper.selectTInspectionRecordById(id);
    }

    /**
     * 查询巡检记录列表
     *
     * @param tInspectionRecord 巡检记录
     * @return 巡检记录
     */
    @Override
    public List<TInspectionRecord> selectTInspectionRecordList(TInspectionRecord tInspectionRecord)
    {
        return tInspectionRecordMapper.selectTInspectionRecordList(tInspectionRecord);
    }

    /**
     * 新增巡检记录
     *
     * @param tInspectionRecord 巡检记录
     * @return 结果
     */
    @Override
    public int insertTInspectionRecord(TInspectionRecord tInspectionRecord)
    {
        return tInspectionRecordMapper.insertTInspectionRecord(tInspectionRecord);
    }

    /**
     * 修改巡检记录
     *
     * @param tInspectionRecord 巡检记录
     * @return 结果
     */
    @Override
    public int updateTInspectionRecord(TInspectionRecord tInspectionRecord)
    {
        return tInspectionRecordMapper.updateTInspectionRecord(tInspectionRecord);
    }

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

    /**
     * 删除巡检记录信息
     *
     * @param id 巡检记录ID
     * @return 结果
     */
    @Override
    public int deleteTInspectionRecordById(Long id)
    {
        return tInspectionRecordMapper.deleteTInspectionRecordById(id);
    }

    /**
     * 根据区域巡查记录id查询设备巡查记录
     * @param regionId
     * @return
     */
    @Override
    public List<TInspectionRecord> selectByRegionId(Long regionId) {
        return tInspectionRecordMapper.selectByRegionId(regionId);
    }

    @Override
    public int deleteTInspectionRecordByRegionIds(Long[] regionIds) {
        return tInspectionRecordMapper.deleteTInspectionRecordByRegionIds(regionIds);
    }

    @Override
    public int deleteTInspectionRecordByRegionId(Long regionId) {
        return tInspectionRecordMapper.deleteTInspectionRecordByRegionId(regionId);
    }
}
