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.TProjectRecord;
import com.ruoyi.invest.mapper.TProjectRecordMapper;
import com.ruoyi.invest.service.ITProjectRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * 跟进记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-21
 */
@Service
public class TProjectRecordServiceImpl implements ITProjectRecordService
{
    @Autowired
    private TProjectRecordMapper tProjectRecordMapper;

    /**
     * 查询跟进记录
     * 
     * @param id 跟进记录主键
     * @return 跟进记录
     */
    @Override
    public TProjectRecord selectTProjectRecordById(String id)
    {
        return tProjectRecordMapper.selectTProjectRecordById(id);
    }

    /**
     * 查询跟进记录列表
     * 
     * @param tProjectRecord 跟进记录
     * @return 跟进记录
     */
    @Override
    public List<TProjectRecord> selectTProjectRecordList(TProjectRecord tProjectRecord)
    {
        return tProjectRecordMapper.selectTProjectRecordList(tProjectRecord);
    }

    /**
     * 新增跟进记录
     * 
     * @param tProjectRecord 跟进记录
     * @return 结果
     */
    @Override
    public int insertTProjectRecord(TProjectRecord tProjectRecord)
    {
        tProjectRecord.setCreateTime(DateUtils.getNowDate());
        return tProjectRecordMapper.insertTProjectRecord(tProjectRecord);
    }

    /**
     * 修改跟进记录
     * 
     * @param tProjectRecord 跟进记录
     * @return 结果
     */
    @Override
    public int updateTProjectRecord(TProjectRecord tProjectRecord)
    {
        tProjectRecord.setUpdateTime(DateUtils.getNowDate());
        return tProjectRecordMapper.updateTProjectRecord(tProjectRecord);
    }

    /**
     * 批量删除跟进记录
     * 
     * @param ids 需要删除的跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteTProjectRecordByIds(String[] ids)
    {
        return tProjectRecordMapper.deleteTProjectRecordByIds(ids);
    }

    /**
     * 删除跟进记录信息
     * 
     * @param id 跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteTProjectRecordById(String id)
    {
        return tProjectRecordMapper.deleteTProjectRecordById(id);
    }

    /**
     * 批量删除跟进记录
     *
     * @param ids 需要删除的跟进记录主键
     * @return 结果
     */
    @Override
    public int updateTProjectRecordByIds(String[] ids) {
        return tProjectRecordMapper.updateTProjectRecordByIds(ids);
    }

    /**
     * 根据项目ID获取跟进记录
     * @param projectId
     * @return
     */
    @Override
    public List<TProjectRecord> listProjectId(String projectId) {
        return tProjectRecordMapper.listProjectId(projectId);
    }
}
