package com.ruoyi.hezhi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hezhi.domain.TbEnterpriseProgress;
import com.ruoyi.hezhi.mapper.TbEnterpriseProgressMapper;
import com.ruoyi.hezhi.service.ITbEnterpriseProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 企业历程Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class TbEnterpriseProgressServiceImpl implements ITbEnterpriseProgressService
{
    @Autowired
    private TbEnterpriseProgressMapper tbEnterpriseProgressMapper;

    /**
     * 查询企业历程
     *
     * @param enterpriseProgressId 企业历程主键
     * @return 企业历程
     */
    @Override
    public TbEnterpriseProgress selectTbEnterpriseProgressByEnterpriseProgressId(Long enterpriseProgressId)
    {
        return tbEnterpriseProgressMapper.selectTbEnterpriseProgressByEnterpriseProgressId(enterpriseProgressId);
    }

    /**
     * 查询企业历程列表
     *
     * @param tbEnterpriseProgress 企业历程
     * @return 企业历程
     */
    @Override
    public List<TbEnterpriseProgress> selectTbEnterpriseProgressList(TbEnterpriseProgress tbEnterpriseProgress)
    {
        return tbEnterpriseProgressMapper.selectTbEnterpriseProgressList(tbEnterpriseProgress);
    }

    /**
     * 新增企业历程
     *
     * @param tbEnterpriseProgress 企业历程
     * @return 结果
     */
    @Override
    public int insertTbEnterpriseProgress(TbEnterpriseProgress tbEnterpriseProgress)
    {
        tbEnterpriseProgress.setCreateTime(DateUtils.getNowDate());
        return tbEnterpriseProgressMapper.insertTbEnterpriseProgress(tbEnterpriseProgress);
    }

    /**
     * 修改企业历程
     *
     * @param tbEnterpriseProgress 企业历程
     * @return 结果
     */
    @Override
    public int updateTbEnterpriseProgress(TbEnterpriseProgress tbEnterpriseProgress)
    {
        tbEnterpriseProgress.setUpdateTime(DateUtils.getNowDate());
        return tbEnterpriseProgressMapper.updateTbEnterpriseProgress(tbEnterpriseProgress);
    }

    /**
     * 批量删除企业历程
     *
     * @param enterpriseProgressIds 需要删除的企业历程主键
     * @return 结果
     */
    @Override
    public int deleteTbEnterpriseProgressByEnterpriseProgressIds(Long[] enterpriseProgressIds)
    {
        return tbEnterpriseProgressMapper.deleteTbEnterpriseProgressByEnterpriseProgressIds(enterpriseProgressIds);
    }

    /**
     * 删除企业历程信息
     *
     * @param enterpriseProgressId 企业历程主键
     * @return 结果
     */
    @Override
    public int deleteTbEnterpriseProgressByEnterpriseProgressId(Long enterpriseProgressId)
    {
        return tbEnterpriseProgressMapper.deleteTbEnterpriseProgressByEnterpriseProgressId(enterpriseProgressId);
    }

    /**
     * 企业历程列表
     *
     * @return 企业历程列表
     */
    @Override
    public List<Map<String, Object>> getEnterpriseProgressList() {
        return tbEnterpriseProgressMapper.getEnterpriseProgressList();
    }
}
