package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysAchievement;
import com.ruoyi.system.mapper.SysAchievementMapper;
import com.ruoyi.system.service.ISysAchievementService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.DateUtils;

@Service
public class SysAchievementServiceImpl implements ISysAchievementService
{
    @Autowired
    private SysAchievementMapper sysAchievementMapper;

    @Override
    public SysAchievement selectSysAchievementById(Long id)
    {
        return sysAchievementMapper.selectSysAchievementById(id);
    }

    @Override
    public List<SysAchievement> selectSysAchievementList(SysAchievement sysAchievement)
    {
        return sysAchievementMapper.selectSysAchievementList(sysAchievement);
    }

    @Override
    public int insertSysAchievement(SysAchievement sysAchievement)
    {
        sysAchievement.setCreateBy(SecurityUtils.getUsername());
        sysAchievement.setCreateTime(DateUtils.getNowDate());
        return sysAchievementMapper.insertSysAchievement(sysAchievement);
    }

    @Override
    public int updateSysAchievement(SysAchievement sysAchievement)
    {
        sysAchievement.setUpdateBy(SecurityUtils.getUsername());
        sysAchievement.setUpdateTime(DateUtils.getNowDate());
        return sysAchievementMapper.updateSysAchievement(sysAchievement);
    }

    @Override
    public int deleteSysAchievementByIds(Long[] ids)
    {
        return sysAchievementMapper.deleteSysAchievementByIds(ids);
    }

    @Override
    public int deleteSysAchievementById(Long id)
    {
        return sysAchievementMapper.deleteSysAchievementById(id);
    }
}
