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.TDangerApprovalRecordMapper;
import com.zehong.system.domain.TDangerApprovalRecord;
import com.zehong.system.service.ITDangerApprovalRecordService;

/**
 * 隐患审核记录Service业务层处理
 * 
 * @author zehong
 * @date 2026-07-17
 */
@Service
public class TDangerApprovalRecordServiceImpl implements ITDangerApprovalRecordService 
{
    @Autowired
    private TDangerApprovalRecordMapper tDangerApprovalRecordMapper;

    /**
     * 查询隐患审核记录
     * 
     * @param approvalId 隐患审核记录ID
     * @return 隐患审核记录
     */
    @Override
    public TDangerApprovalRecord selectTDangerApprovalRecordById(Long approvalId)
    {
        return tDangerApprovalRecordMapper.selectTDangerApprovalRecordById(approvalId);
    }

    /**
     * 查询隐患审核记录列表
     * 
     * @param tDangerApprovalRecord 隐患审核记录
     * @return 隐患审核记录
     */
    @Override
    public List<TDangerApprovalRecord> selectTDangerApprovalRecordList(TDangerApprovalRecord tDangerApprovalRecord)
    {
        return tDangerApprovalRecordMapper.selectTDangerApprovalRecordList(tDangerApprovalRecord);
    }

    /**
     * 新增隐患审核记录
     * 
     * @param tDangerApprovalRecord 隐患审核记录
     * @return 结果
     */
    @Override
    public int insertTDangerApprovalRecord(TDangerApprovalRecord tDangerApprovalRecord)
    {
        tDangerApprovalRecord.setCreateTime(DateUtils.getNowDate());
        return tDangerApprovalRecordMapper.insertTDangerApprovalRecord(tDangerApprovalRecord);
    }

    /**
     * 修改隐患审核记录
     * 
     * @param tDangerApprovalRecord 隐患审核记录
     * @return 结果
     */
    @Override
    public int updateTDangerApprovalRecord(TDangerApprovalRecord tDangerApprovalRecord)
    {
        tDangerApprovalRecord.setUpdateTime(DateUtils.getNowDate());
        return tDangerApprovalRecordMapper.updateTDangerApprovalRecord(tDangerApprovalRecord);
    }

    /**
     * 批量删除隐患审核记录
     * 
     * @param approvalIds 需要删除的隐患审核记录ID
     * @return 结果
     */
    @Override
    public int deleteTDangerApprovalRecordByIds(Long[] approvalIds)
    {
        return tDangerApprovalRecordMapper.deleteTDangerApprovalRecordByIds(approvalIds);
    }

    /**
     * 删除隐患审核记录信息
     * 
     * @param approvalId 隐患审核记录ID
     * @return 结果
     */
    @Override
    public int deleteTDangerApprovalRecordById(Long approvalId)
    {
        return tDangerApprovalRecordMapper.deleteTDangerApprovalRecordById(approvalId);
    }
}
