package com.ruoyi.hezhi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hezhi.domain.TbAuthorizeHonor;
import com.ruoyi.hezhi.mapper.TbAuthorizeHonorMapper;
import com.ruoyi.hezhi.service.ITbAuthorizeHonorService;
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-16
 */
@Service
public class TbAuthorizeHonorServiceImpl implements ITbAuthorizeHonorService
{
    @Autowired
    private TbAuthorizeHonorMapper tbAuthorizeHonorMapper;

    /**
     * 查询授权荣誉
     *
     * @param authorizeHonorId 授权荣誉主键
     * @return 授权荣誉
     */
    @Override
    public TbAuthorizeHonor selectTbAuthorizeHonorByAuthorizeHonorId(Long authorizeHonorId)
    {
        return tbAuthorizeHonorMapper.selectTbAuthorizeHonorByAuthorizeHonorId(authorizeHonorId);
    }

    /**
     * 查询授权荣誉列表
     *
     * @param tbAuthorizeHonor 授权荣誉
     * @return 授权荣誉
     */
    @Override
    public List<TbAuthorizeHonor> selectTbAuthorizeHonorList(TbAuthorizeHonor tbAuthorizeHonor)
    {
        return tbAuthorizeHonorMapper.selectTbAuthorizeHonorList(tbAuthorizeHonor);
    }

    /**
     * 新增授权荣誉
     *
     * @param tbAuthorizeHonor 授权荣誉
     * @return 结果
     */
    @Override
    public int insertTbAuthorizeHonor(TbAuthorizeHonor tbAuthorizeHonor)
    {
        tbAuthorizeHonor.setCreateTime(DateUtils.getNowDate());
        return tbAuthorizeHonorMapper.insertTbAuthorizeHonor(tbAuthorizeHonor);
    }

    /**
     * 修改授权荣誉
     *
     * @param tbAuthorizeHonor 授权荣誉
     * @return 结果
     */
    @Override
    public int updateTbAuthorizeHonor(TbAuthorizeHonor tbAuthorizeHonor)
    {
        tbAuthorizeHonor.setUpdateTime(DateUtils.getNowDate());
        return tbAuthorizeHonorMapper.updateTbAuthorizeHonor(tbAuthorizeHonor);
    }

    /**
     * 批量删除授权荣誉
     *
     * @param authorizeHonorIds 需要删除的授权荣誉主键
     * @return 结果
     */
    @Override
    public int deleteTbAuthorizeHonorByAuthorizeHonorIds(Long[] authorizeHonorIds)
    {
        return tbAuthorizeHonorMapper.deleteTbAuthorizeHonorByAuthorizeHonorIds(authorizeHonorIds);
    }

    /**
     * 删除授权荣誉信息
     *
     * @param authorizeHonorId 授权荣誉主键
     * @return 结果
     */
    @Override
    public int deleteTbAuthorizeHonorByAuthorizeHonorId(Long authorizeHonorId)
    {
        return tbAuthorizeHonorMapper.deleteTbAuthorizeHonorByAuthorizeHonorId(authorizeHonorId);
    }

    /**
     * 授权及荣誉列表
     *
     * @param params 参数
     * @return 授权及荣誉列表
     */
    @Override
    public List<Map<String, Object>> getAuthorizeHonorList(Map<String, Object> params) {
        return tbAuthorizeHonorMapper.getAuthorizeHonorList(params);
    }
}
