package com.ruoyi.abuwx.service.impl;

import com.ruoyi.abuwx.domain.PointsConfig;
import com.ruoyi.abuwx.mapper.PointsConfigMapper;
import com.ruoyi.abuwx.service.IPointsConfigService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 积分配置Service业务层处理
 * 
 * @author lujie
 * @date 2025-01-15
 */
@Service
public class PointsConfigServiceImpl implements IPointsConfigService 
{
    @Autowired
    private PointsConfigMapper pointsConfigMapper;

    /**
     * 查询积分配置
     * 
     * @param id 积分配置主键
     * @return 积分配置
     */
    @Override
    public PointsConfig selectPointsConfigById(Long id)
    {
        return pointsConfigMapper.selectPointsConfigById(id);
    }

    /**
     * 查询积分配置列表
     * 
     * @param pointsConfig 积分配置
     * @return 积分配置
     */
    @Override
    public List<PointsConfig> selectPointsConfigList(PointsConfig pointsConfig)
    {
        return pointsConfigMapper.selectPointsConfigList(pointsConfig);
    }

    /**
     * 新增积分配置
     * 
     * @param pointsConfig 积分配置
     * @return 结果
     */
    @Override
    public int insertPointsConfig(PointsConfig pointsConfig)
    {
        pointsConfig.setCreateTime(DateUtils.getNowDate());
        return pointsConfigMapper.insertPointsConfig(pointsConfig);
    }

    /**
     * 修改积分配置
     * 
     * @param pointsConfig 积分配置
     * @return 结果
     */
    @Override
    public int updatePointsConfig(PointsConfig pointsConfig)
    {
        pointsConfig.setUpdateTime(DateUtils.getNowDate());
        return pointsConfigMapper.updatePointsConfig(pointsConfig);
    }

    /**
     * 批量删除积分配置
     * 
     * @param ids 需要删除的积分配置主键
     * @return 结果
     */
    @Override
    public int deletePointsConfigByIds(Long[] ids)
    {
        return pointsConfigMapper.deletePointsConfigByIds(ids);
    }

    /**
     * 删除积分配置信息
     * 
     * @param id 积分配置主键
     * @return 结果
     */
    @Override
    public int deletePointsConfigById(Long id)
    {
        return pointsConfigMapper.deletePointsConfigById(id);
    }
}
