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.TProjectApprovalMapper;
import com.ruoyi.invest.domain.TProjectApproval;
import com.ruoyi.invest.service.ITProjectApprovalService;

/**
 * 立项申请Service业务层处理
 * 
 * @author zjc
 * @date 2024-04-02
 */
@Service
public class TProjectApprovalServiceImpl implements ITProjectApprovalService 
{
    @Autowired
    private TProjectApprovalMapper tProjectApprovalMapper;

    /**
     * 查询立项申请
     * 
     * @param id 立项申请主键
     * @return 立项申请
     */
    @Override
    public TProjectApproval selectTProjectApprovalById(String id)
    {
        return tProjectApprovalMapper.selectTProjectApprovalById(id);
    }

    /**
     * 查询立项申请列表
     * 
     * @param tProjectApproval 立项申请
     * @return 立项申请
     */
    @Override
    public List<TProjectApproval> selectTProjectApprovalList(TProjectApproval tProjectApproval)
    {
        return tProjectApprovalMapper.selectTProjectApprovalList(tProjectApproval);
    }

    /**
     * 新增立项申请
     * 
     * @param tProjectApproval 立项申请
     * @return 结果
     */
    @Override
    public int insertTProjectApproval(TProjectApproval tProjectApproval)
    {
        tProjectApproval.setCreateTime(DateUtils.getNowDate());
        return tProjectApprovalMapper.insertTProjectApproval(tProjectApproval);
    }

    /**
     * 修改立项申请
     * 
     * @param tProjectApproval 立项申请
     * @return 结果
     */
    @Override
    public int updateTProjectApproval(TProjectApproval tProjectApproval)
    {
        tProjectApproval.setUpdateTime(DateUtils.getNowDate());
        return tProjectApprovalMapper.updateTProjectApproval(tProjectApproval);
    }

    /**
     * 批量删除立项申请
     * 
     * @param ids 需要删除的立项申请主键
     * @return 结果
     */
    @Override
    public int deleteTProjectApprovalByIds(String[] ids)
    {
        return tProjectApprovalMapper.deleteTProjectApprovalByIds(ids);
    }

    /**
     * 删除立项申请信息
     * 
     * @param id 立项申请主键
     * @return 结果
     */
    @Override
    public int deleteTProjectApprovalById(String id)
    {
        return tProjectApprovalMapper.deleteTProjectApprovalById(id);
    }

    /**
     * 根据项目ID获取最新立项申请
     * @param projectPoolId
     * @return
     */
    @Override
    public TProjectApproval listProjectPoolIdNew(String projectPoolId) {
        return tProjectApprovalMapper.listProjectPoolIdNew(projectPoolId);
    }
}
