package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDangersRectificationsMapper;
import com.zehong.system.domain.TDangersRectifications;
import com.zehong.system.service.ITDangersRectificationsService;

/**
 * 隐患及整改Service业务层处理
 *
 * @author zehong
 * @date 2026-03-16
 */
@Service
public class TDangersRectificationsServiceImpl implements ITDangersRectificationsService
{
    @Autowired
    private TDangersRectificationsMapper tDangersRectificationsMapper;

    /**
     * 查询隐患及整改
     *
     * @param id 隐患及整改ID
     * @return 隐患及整改
     */
    @Override
    public TDangersRectifications selectTDangersRectificationsById(Long id)
    {
        return tDangersRectificationsMapper.selectTDangersRectificationsById(id);
    }

    /**
     * 查询隐患及整改列表
     *
     * @param tDangersRectifications 隐患及整改
     * @return 隐患及整改
     */
    @Override
    public List<TDangersRectifications> selectTDangersRectificationsList(TDangersRectifications tDangersRectifications)
    {
        return tDangersRectificationsMapper.selectTDangersRectificationsList(tDangersRectifications);
    }

    /**
     * 新增隐患及整改
     *
     * @param tDangersRectifications 隐患及整改
     * @return 结果
     */
    @Override
    public int insertTDangersRectifications(TDangersRectifications tDangersRectifications)
    {
        tDangersRectifications.setCreateTime(DateUtils.getNowDate());
        return tDangersRectificationsMapper.insertTDangersRectifications(tDangersRectifications);
    }

    /**
     * 修改隐患及整改
     *
     * @param tDangersRectifications 隐患及整改
     * @return 结果
     */
    @Override
    public int updateTDangersRectifications(TDangersRectifications tDangersRectifications)
    {
        return tDangersRectificationsMapper.updateTDangersRectifications(tDangersRectifications);
    }

    /**
     * 批量删除隐患及整改
     *
     * @param ids 需要删除的隐患及整改ID
     * @return 结果
     */
    @Override
    public int deleteTDangersRectificationsByIds(Long[] ids)
    {
        return tDangersRectificationsMapper.deleteTDangersRectificationsByIds(ids);
    }

    /**
     * 删除隐患及整改信息
     *
     * @param id 隐患及整改ID
     * @return 结果
     */
    @Override
    public int deleteTDangersRectificationsById(Long id)
    {
        return tDangersRectificationsMapper.deleteTDangersRectificationsById(id);
    }
}