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

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.pssr.mapper.TPssrTurndownMapper;
import com.ruoyi.project.pssr.domain.TPssrTurndown;
import com.ruoyi.project.pssr.service.ITPssrTurndownService;

/**
 * PSSR驳回原因Service业务层处理
 *
 * @author ssy
 * @date 2024-11-25
 */
@Service
public class TPssrTurndownServiceImpl implements ITPssrTurndownService
{
    @Autowired
    private TPssrTurndownMapper tPssrTurndownMapper;

    /**
     * 查询PSSR驳回原因
     *
     * @param id PSSR驳回原因ID
     * @return PSSR驳回原因
     */
    @Override
    public TPssrTurndown selectTPssrTurndownById(Long id)
    {
        return tPssrTurndownMapper.selectTPssrTurndownById(id);
    }
   @Override
    public String selectTPssrTurndownByItem(Long subId,Long itemId, String forShort)
    {
        TPssrTurndown turndown = new TPssrTurndown();
        turndown.setItemId(itemId);
        turndown.setSubId(subId);
        turndown.setForShort(forShort);
        return tPssrTurndownMapper.selectTPssrTurndownByItem(turndown);
    }

    /**
     * 查询PSSR驳回原因列表
     *
     * @param tPssrTurndown PSSR驳回原因
     * @return PSSR驳回原因
     */
    @Override
    public List<TPssrTurndown> selectTPssrTurndownList(TPssrTurndown tPssrTurndown)
    {
        return tPssrTurndownMapper.selectTPssrTurndownList(tPssrTurndown);
    }

    /**
     * 新增PSSR驳回原因
     *
     * @param tPssrTurndown PSSR驳回原因
     * @return 结果
     */
    @Override
    public int insertTPssrTurndown(TPssrTurndown tPssrTurndown)
    {
        return tPssrTurndownMapper.insertTPssrTurndown(tPssrTurndown);
    }

    /**
     * 修改PSSR驳回原因
     *
     * @param tPssrTurndown PSSR驳回原因
     * @return 结果
     */
    @Override
    public int updateTPssrTurndown(TPssrTurndown tPssrTurndown)
    {
        return tPssrTurndownMapper.updateTPssrTurndown(tPssrTurndown);
    }

    /**
     * 批量删除PSSR驳回原因
     *
     * @param ids 需要删除的PSSR驳回原因ID
     * @return 结果
     */
    @Override
    public int deleteTPssrTurndownByIds(Long[] ids)
    {
        return tPssrTurndownMapper.deleteTPssrTurndownByIds(ids);
    }

    /**
     * 删除PSSR驳回原因信息
     *
     * @param id PSSR驳回原因ID
     * @return 结果
     */
    @Override
    public int deleteTPssrTurndownById(Long id)
    {
        return tPssrTurndownMapper.deleteTPssrTurndownById(id);
    }
}
