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.SysMilestone;
import com.ruoyi.system.mapper.SysMilestoneMapper;
import com.ruoyi.system.service.ISysMilestoneService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.DateUtils;

@Service
public class SysMilestoneServiceImpl implements ISysMilestoneService
{
    @Autowired
    private SysMilestoneMapper sysMilestoneMapper;

    @Override
    public SysMilestone selectSysMilestoneById(Long id)
    {
        return sysMilestoneMapper.selectSysMilestoneById(id);
    }

    @Override
    public List<SysMilestone> selectSysMilestoneList(SysMilestone sysMilestone)
    {
        return sysMilestoneMapper.selectSysMilestoneList(sysMilestone);
    }

    @Override
    public int insertSysMilestone(SysMilestone sysMilestone)
    {
        sysMilestone.setCreateBy(SecurityUtils.getUsername());
        sysMilestone.setCreateTime(DateUtils.getNowDate());
        return sysMilestoneMapper.insertSysMilestone(sysMilestone);
    }

    @Override
    public int updateSysMilestone(SysMilestone sysMilestone)
    {
        sysMilestone.setUpdateBy(SecurityUtils.getUsername());
        sysMilestone.setUpdateTime(DateUtils.getNowDate());
        return sysMilestoneMapper.updateSysMilestone(sysMilestone);
    }

    @Override
    public int deleteSysMilestoneByIds(Long[] ids)
    {
        return sysMilestoneMapper.deleteSysMilestoneByIds(ids);
    }

    @Override
    public int deleteSysMilestoneById(Long id)
    {
        return sysMilestoneMapper.deleteSysMilestoneById(id);
    }
}
