package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletTrainMapper;
import com.ruoyi.model.domain.AppletTrain;
import com.ruoyi.model.service.IAppletTrainService;

/**
 * 服务培训Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletTrainServiceImpl implements IAppletTrainService
{
    @Autowired
    private AppletTrainMapper appletTrainMapper;

    /**
     * 查询服务培训
     *
     * @param id 服务培训主键
     * @return 服务培训
     */
    @Override
    public AppletTrain selectAppletTrainById(Long id)
    {
        return appletTrainMapper.selectAppletTrainById(id);
    }

    /**
     * 查询服务培训列表
     *
     * @param appletTrain 服务培训
     * @return 服务培训
     */
    @Override
    public List<AppletTrain> selectAppletTrainList(AppletTrain appletTrain)
    {
        return appletTrainMapper.selectAppletTrainList(appletTrain);
    }

    /**
     * 新增服务培训
     *
     * @param appletTrain 服务培训
     * @return 结果
     */
    @Override
    public int insertAppletTrain(AppletTrain appletTrain)
    {
        appletTrain.setCreateTime(DateUtils.getNowDate());
        return appletTrainMapper.insertAppletTrain(appletTrain);
    }

    /**
     * 修改服务培训
     *
     * @param appletTrain 服务培训
     * @return 结果
     */
    @Override
    public int updateAppletTrain(AppletTrain appletTrain)
    {
        appletTrain.setUpdateTime(DateUtils.getNowDate());
        return appletTrainMapper.updateAppletTrain(appletTrain);
    }

    /**
     * 批量删除服务培训
     *
     * @param ids 需要删除的服务培训主键
     * @return 结果
     */
    @Override
    public int deleteAppletTrainByIds(Long[] ids)
    {
        return appletTrainMapper.deleteAppletTrainByIds(ids);
    }

    /**
     * 删除服务培训信息
     *
     * @param id 服务培训主键
     * @return 结果
     */
    @Override
    public int deleteAppletTrainById(Long id)
    {
        return appletTrainMapper.deleteAppletTrainById(id);
    }
}
