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.TProjectMeeting;
import com.ruoyi.invest.mapper.TProjectMeetingMapper;
import com.ruoyi.invest.service.ITProjectMeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会议记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-22
 */
@Service
public class TProjectMeetingServiceImpl implements ITProjectMeetingService
{
    @Autowired
    private TProjectMeetingMapper tProjectMeetingMapper;

    /**
     * 查询会议记录
     * 
     * @param id 会议记录主键
     * @return 会议记录
     */
    @Override
    public TProjectMeeting selectTProjectMeetingById(String id)
    {
        return tProjectMeetingMapper.selectTProjectMeetingById(id);
    }

    /**
     * 查询会议记录列表
     * 
     * @param tProjectMeeting 会议记录
     * @return 会议记录
     */
    @Override
    public List<TProjectMeeting> selectTProjectMeetingList(TProjectMeeting tProjectMeeting)
    {
        return tProjectMeetingMapper.selectTProjectMeetingList(tProjectMeeting);
    }

    /**
     * 新增会议记录
     * 
     * @param tProjectMeeting 会议记录
     * @return 结果
     */
    @Override
    public int insertTProjectMeeting(TProjectMeeting tProjectMeeting)
    {
        tProjectMeeting.setCreateTime(DateUtils.getNowDate());
        return tProjectMeetingMapper.insertTProjectMeeting(tProjectMeeting);
    }

    /**
     * 修改会议记录
     * 
     * @param tProjectMeeting 会议记录
     * @return 结果
     */
    @Override
    public int updateTProjectMeeting(TProjectMeeting tProjectMeeting)
    {
        tProjectMeeting.setUpdateTime(DateUtils.getNowDate());
        return tProjectMeetingMapper.updateTProjectMeeting(tProjectMeeting);
    }

    /**
     * 批量删除会议记录
     * 
     * @param ids 需要删除的会议记录主键
     * @return 结果
     */
    @Override
    public int deleteTProjectMeetingByIds(String[] ids)
    {
        return tProjectMeetingMapper.deleteTProjectMeetingByIds(ids);
    }

    /**
     * 删除会议记录信息
     * 
     * @param id 会议记录主键
     * @return 结果
     */
    @Override
    public int deleteTProjectMeetingById(String id)
    {
        return tProjectMeetingMapper.deleteTProjectMeetingById(id);
    }

    /**
     *
     * @param ids 需要删除的会议记录主键集合
     * @return
     */
    @Override
    public int updateTProjectMeetingByIds(String[] ids) {
        return tProjectMeetingMapper.updateTProjectMeetingByIds(ids);
    }

    /**
     * 根据项目ID获取会议记录
     * @param projectPoolId
     * @return
     */
    @Override
    public List<TProjectMeeting> listProjectPoolId(String projectPoolId) {
        return tProjectMeetingMapper.listProjectPoolId(projectPoolId);
    }

    /**
     * 根据项目ID获取最新会议记录
     * @param projectPoolId
     * @param meetingType
     * @return
     */
    @Override
    public TProjectMeeting listProjectPoolIdNew(String projectPoolId,String meetingType) {
        return tProjectMeetingMapper.listProjectPoolIdNew(projectPoolId,meetingType);
    }

    /**
     * 根据年查询会议编号
     * @param year
     * @return
     */
    @Override
    public Integer selectTProjectMeetingCode(String year) {
        return tProjectMeetingMapper.selectTProjectMeetingCode(year);
    }

    public TProjectMeeting selectTProjectMeetingByProjectPoolId(String projectPoolId){
        return tProjectMeetingMapper.selectTProjectMeetingByProjectPoolId(projectPoolId);
    }
}
