package com.ruoyi.invest.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.invest.mapper.TProjectDecisionMapper;
import com.ruoyi.invest.domain.TProjectDecision;
import com.ruoyi.invest.service.ITProjectDecisionService;

/**
 * 投决申请Service业务层处理
 * 
 * @author zjc
 * @date 2024-04-02
 */
@Service
public class TProjectDecisionServiceImpl implements ITProjectDecisionService 
{
    @Autowired
    private TProjectDecisionMapper tProjectDecisionMapper;

    /**
     * 查询投决申请
     * 
     * @param id 投决申请主键
     * @return 投决申请
     */
    @Override
    public TProjectDecision selectTProjectDecisionById(String id)
    {
        return tProjectDecisionMapper.selectTProjectDecisionById(id);
    }

    /**
     * 查询投决申请列表
     * 
     * @param tProjectDecision 投决申请
     * @return 投决申请
     */
    @Override
    public List<TProjectDecision> selectTProjectDecisionList(TProjectDecision tProjectDecision)
    {
        return tProjectDecisionMapper.selectTProjectDecisionList(tProjectDecision);
    }

    /**
     * 新增投决申请
     * 
     * @param tProjectDecision 投决申请
     * @return 结果
     */
    @Override
    public int insertTProjectDecision(TProjectDecision tProjectDecision)
    {
        tProjectDecision.setCreateTime(DateUtils.getNowDate());
        return tProjectDecisionMapper.insertTProjectDecision(tProjectDecision);
    }

    /**
     * 修改投决申请
     * 
     * @param tProjectDecision 投决申请
     * @return 结果
     */
    @Override
    public int updateTProjectDecision(TProjectDecision tProjectDecision)
    {
        tProjectDecision.setUpdateTime(DateUtils.getNowDate());
        return tProjectDecisionMapper.updateTProjectDecision(tProjectDecision);
    }

    /**
     * 批量删除投决申请
     * 
     * @param ids 需要删除的投决申请主键
     * @return 结果
     */
    @Override
    public int deleteTProjectDecisionByIds(String[] ids)
    {
        return tProjectDecisionMapper.deleteTProjectDecisionByIds(ids);
    }

    /**
     * 删除投决申请信息
     * 
     * @param id 投决申请主键
     * @return 结果
     */
    @Override
    public int deleteTProjectDecisionById(String id)
    {
        return tProjectDecisionMapper.deleteTProjectDecisionById(id);
    }

    /**
     * 根据项目ID获取最新投决申请
     * @param projectPoolId
     * @return
     */
    @Override
    public TProjectDecision listProjectPoolIdNew(String projectPoolId) {
        return tProjectDecisionMapper.listProjectPoolIdNew(projectPoolId);
    }
}
