package com.ruoyi.hezhi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hezhi.domain.TbEvaluateAgencyClass;
import com.ruoyi.hezhi.mapper.TbEvaluateAgencyClassMapper;
import com.ruoyi.hezhi.service.ITbEvaluateAgencyClassService;
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-10-23
 */
@Service
public class TbEvaluateAgencyClassServiceImpl implements ITbEvaluateAgencyClassService
{
    @Autowired
    private TbEvaluateAgencyClassMapper tbEvaluateAgencyClassMapper;

    /**
     * 查询评价机构分类
     *
     * @param evaluateAgencyClassId 评价机构分类主键
     * @return 评价机构分类
     */
    @Override
    public TbEvaluateAgencyClass selectTbEvaluateAgencyClassByEvaluateAgencyClassId(Long evaluateAgencyClassId)
    {
        return tbEvaluateAgencyClassMapper.selectTbEvaluateAgencyClassByEvaluateAgencyClassId(evaluateAgencyClassId);
    }

    /**
     * 查询评价机构分类列表
     *
     * @param tbEvaluateAgencyClass 评价机构分类
     * @return 评价机构分类
     */
    @Override
    public List<TbEvaluateAgencyClass> selectTbEvaluateAgencyClassList(TbEvaluateAgencyClass tbEvaluateAgencyClass)
    {
        return tbEvaluateAgencyClassMapper.selectTbEvaluateAgencyClassList(tbEvaluateAgencyClass);
    }

    /**
     * 新增评价机构分类
     *
     * @param tbEvaluateAgencyClass 评价机构分类
     * @return 结果
     */
    @Override
    public int insertTbEvaluateAgencyClass(TbEvaluateAgencyClass tbEvaluateAgencyClass)
    {
        tbEvaluateAgencyClass.setCreateTime(DateUtils.getNowDate());
        return tbEvaluateAgencyClassMapper.insertTbEvaluateAgencyClass(tbEvaluateAgencyClass);
    }

    /**
     * 修改评价机构分类
     *
     * @param tbEvaluateAgencyClass 评价机构分类
     * @return 结果
     */
    @Override
    public int updateTbEvaluateAgencyClass(TbEvaluateAgencyClass tbEvaluateAgencyClass)
    {
        tbEvaluateAgencyClass.setUpdateTime(DateUtils.getNowDate());
        return tbEvaluateAgencyClassMapper.updateTbEvaluateAgencyClass(tbEvaluateAgencyClass);
    }

    /**
     * 批量删除评价机构分类
     *
     * @param evaluateAgencyClassIds 需要删除的评价机构分类主键
     * @return 结果
     */
    @Override
    public int deleteTbEvaluateAgencyClassByEvaluateAgencyClassIds(Long[] evaluateAgencyClassIds)
    {
        return tbEvaluateAgencyClassMapper.deleteTbEvaluateAgencyClassByEvaluateAgencyClassIds(evaluateAgencyClassIds);
    }

    /**
     * 删除评价机构分类信息
     *
     * @param evaluateAgencyClassId 评价机构分类主键
     * @return 结果
     */
    @Override
    public int deleteTbEvaluateAgencyClassByEvaluateAgencyClassId(Long evaluateAgencyClassId)
    {
        return tbEvaluateAgencyClassMapper.deleteTbEvaluateAgencyClassByEvaluateAgencyClassId(evaluateAgencyClassId);
    }

    /**
     * 评价机构分类列表
     *
     * @param params 参数
     * @return 评价机构分类列表
     */
    @Override
    public List<Map<String, Object>> getEvaluateAgencyClassMapList(Map<String, Object> params) {
        return tbEvaluateAgencyClassMapper.getEvaluateAgencyClassMapList(params);
    }
}
