package com.ruoyi.invest.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.invest.domain.TProjectPool;
import com.ruoyi.invest.mapper.TProjectPoolMapper;
import com.ruoyi.invest.service.ITProjectPoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 项目池Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-21
 */
@Service
public class TProjectPoolServiceImpl implements ITProjectPoolService
{
    @Autowired
    private TProjectPoolMapper tProjectPoolMapper;

    /**
     * 查询项目池
     * 
     * @param id 项目池主键
     * @return 项目池
     */
    @Override
    public TProjectPool selectTProjectPoolById(String id)
    {
        return tProjectPoolMapper.selectTProjectPoolById(id);
    }

    /**
     * 查询项目池列表
     * 
     * @param tProjectPool 项目池
     * @return 项目池
     */
    @Override
    public List<TProjectPool> selectTProjectPoolList(TProjectPool tProjectPool)
    {
        return tProjectPoolMapper.selectTProjectPoolList(tProjectPool);
    }

    /**
     * 查询项目阶段列表
     *
     * @param tProjectPool 项目池
     * @return 项目池
     */
    @Override
    public List<TProjectPool> selectTProjectPoolListStage(TProjectPool tProjectPool) {
        return tProjectPoolMapper.selectTProjectPoolListStage(tProjectPool);
    }

    /**
     * 新增项目池
     * 
     * @param tProjectPool 项目池
     * @return 结果
     */
    @Override
    public int insertTProjectPool(TProjectPool tProjectPool)
    {
        tProjectPool.setCreateTime(DateUtils.getNowDate());
        return tProjectPoolMapper.insertTProjectPool(tProjectPool);
    }

    /**
     * 修改项目池
     * 
     * @param tProjectPool 项目池
     * @return 结果
     */
    @Override
    public int updateTProjectPool(TProjectPool tProjectPool)
    {
        tProjectPool.setUpdateTime(DateUtils.getNowDate());
        return tProjectPoolMapper.updateTProjectPool(tProjectPool);
    }

    /**
     * 批量删除项目池
     * 
     * @param ids 需要删除的项目池主键
     * @return 结果
     */
    @Override
    public int deleteTProjectPoolByIds(String[] ids)
    {
        return tProjectPoolMapper.deleteTProjectPoolByIds(ids);
    }

    /**
     * 删除项目池信息
     * 
     * @param id 项目池主键
     * @return 结果
     */
    @Override
    public int deleteTProjectPoolById(String id)
    {
        return tProjectPoolMapper.deleteTProjectPoolById(id);
    }

    /**
     * 批量删除项目池(修改del_flag状态)
     *
     * @param ids 需要删除的项目池主键
     * @return 结果
     */
    @Override
    public int updateTProjectPoolByIds(String[] ids) {
        return tProjectPoolMapper.updateTProjectPoolByIds(ids);
    }

    /**
     * 根绝年份后两位查询编号数量实现自增
     * @param year
     * @return
     */
    @Override
    public int selectTProjectPoolCode(String year) {
        return tProjectPoolMapper.selectTProjectPoolCode(year);
    }

    /**
     * 查询评估考察列表
     * @param tProjectPool
     * @return
     */
    @Override
    public List<TProjectPool> selectTProjectPoolReviewList(TProjectPool tProjectPool) {
        return tProjectPoolMapper.selectTProjectPoolReviewList(tProjectPool);
    }

    /**
     * 修改立项状态
     * @param id
     * @param flag
     * @return
     */
    @Override
    public int updateTProjectPoolByApprovalFlag(String id, String flag) {
        return tProjectPoolMapper.updateTProjectPoolByApprovalFlag(id,flag);
    }

    /**
     * 修改尽调状态
     * @param id
     * @param flag
     * @return
     */
    @Override
    public int updateTProjectPoolByInvestigateFlag(String id, String flag) {
        return tProjectPoolMapper.updateTProjectPoolByInvestigateFlag(id,flag);
    }

    /**
     * 修改投决状态
     * @param id
     * @param flag
     * @return
     */
    @Override
    public int updateTProjectPoolByDecisionFlag(String id, String flag) {
        return tProjectPoolMapper.updateTProjectPoolByDecisionFlag(id,flag);
    }
    /**
     * 修改终止状态
     * @param id
     * @param flag
     * @return
     */
    @Override
    public int updateTProjectPoolByTerminationFlag(String id, String flag) {
        return tProjectPoolMapper.updateTProjectPoolByTerminationFlag(id,flag);
    }

    /**
     * 修改投决状态
     * @param id
     * @param flag
     * @return
     */
    @Override
    public int updateTProjectPoolByDelFlag(String id, String flag) {
        return tProjectPoolMapper.updateTProjectPoolByDelFlag(id,flag);
    }

}
