package com.dcs.hnyz.service.impl;

import java.util.List;
import com.dcs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dcs.hnyz.mapper.DcsRequestTaskMapper;
import com.dcs.hnyz.domain.DcsRequestTask;
import com.dcs.hnyz.service.IDcsRequestTaskService;

/**
 * 请求任务Service业务层处理
 *
 * @author wuhb
 * @date 2025-08-02
 */
@Service
public class DcsRequestTaskServiceImpl implements IDcsRequestTaskService
{
    @Autowired
    private DcsRequestTaskMapper dcsRequestTaskMapper;

    /**
     * 查询请求任务
     *
     * @param requestId 请求任务主键
     * @return 请求任务
     */
    @Override
    public DcsRequestTask selectDcsRequestTaskByRequestId(Long requestId)
    {
        return dcsRequestTaskMapper.selectDcsRequestTaskByRequestId(requestId);
    }

    /**
     * 查询请求任务列表
     *
     * @param dcsRequestTask 请求任务
     * @return 请求任务
     */
    @Override
    public List<DcsRequestTask> selectDcsRequestTaskList(DcsRequestTask dcsRequestTask)
    {
        return dcsRequestTaskMapper.selectDcsRequestTaskList(dcsRequestTask);
    }

    /**
     * 新增请求任务
     *
     * @param dcsRequestTask 请求任务
     * @return 结果
     */
    @Override
    public int insertDcsRequestTask(DcsRequestTask dcsRequestTask)
    {
        dcsRequestTask.setCreateTime(DateUtils.getNowDate());
        return dcsRequestTaskMapper.insertDcsRequestTask(dcsRequestTask);
    }

    /**
     * 修改请求任务
     *
     * @param dcsRequestTask 请求任务
     * @return 结果
     */
    @Override
    public int updateDcsRequestTask(DcsRequestTask dcsRequestTask)
    {
        dcsRequestTask.setUpdateTime(DateUtils.getNowDate());
        return dcsRequestTaskMapper.updateDcsRequestTask(dcsRequestTask);
    }

    /**
     * 批量删除请求任务
     *
     * @param requestIds 需要删除的请求任务主键
     * @return 结果
     */
    @Override
    public int deleteDcsRequestTaskByRequestIds(Long[] requestIds)
    {
        return dcsRequestTaskMapper.deleteDcsRequestTaskByRequestIds(requestIds);
    }

    /**
     * 删除请求任务信息
     *
     * @param requestId 请求任务主键
     * @return 结果
     */
    @Override
    public int deleteDcsRequestTaskByRequestId(Long requestId)
    {
        return dcsRequestTaskMapper.deleteDcsRequestTaskByRequestId(requestId);
    }
}
