package com.ruoyi.model.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletAnswerTrainMapper;
import com.ruoyi.model.domain.AppletAnswerTrain;
import com.ruoyi.model.service.IAppletAnswerTrainService;

/**
 * 用户培训考核答案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletAnswerTrainServiceImpl extends ServiceImpl<AppletAnswerTrainMapper, AppletAnswerTrain> implements IAppletAnswerTrainService
{
    @Autowired
    private AppletAnswerTrainMapper appletAnswerTrainMapper;

    /**
     * 查询用户培训考核答案
     * 
     * @param id 用户培训考核答案主键
     * @return 用户培训考核答案
     */
    @Override
    public AppletAnswerTrain selectAppletAnswerTrainById(Long id)
    {
        return appletAnswerTrainMapper.selectAppletAnswerTrainById(id);
    }

    /**
     * 查询用户培训考核答案列表
     * 
     * @param appletAnswerTrain 用户培训考核答案
     * @return 用户培训考核答案
     */
    @Override
    public List<AppletAnswerTrain> selectAppletAnswerTrainList(AppletAnswerTrain appletAnswerTrain)
    {
        return appletAnswerTrainMapper.selectAppletAnswerTrainList(appletAnswerTrain);
    }

    /**
     * 新增用户培训考核答案
     * 
     * @param appletAnswerTrain 用户培训考核答案
     * @return 结果
     */
    @Override
    public int insertAppletAnswerTrain(AppletAnswerTrain appletAnswerTrain)
    {
        appletAnswerTrain.setCreateTime(DateUtils.getNowDate());
        return appletAnswerTrainMapper.insertAppletAnswerTrain(appletAnswerTrain);
    }

    /**
     * 修改用户培训考核答案
     * 
     * @param appletAnswerTrain 用户培训考核答案
     * @return 结果
     */
    @Override
    public int updateAppletAnswerTrain(AppletAnswerTrain appletAnswerTrain)
    {
        appletAnswerTrain.setUpdateTime(DateUtils.getNowDate());
        return appletAnswerTrainMapper.updateAppletAnswerTrain(appletAnswerTrain);
    }

    /**
     * 批量删除用户培训考核答案
     * 
     * @param ids 需要删除的用户培训考核答案主键
     * @return 结果
     */
    @Override
    public int deleteAppletAnswerTrainByIds(Long[] ids)
    {
        return appletAnswerTrainMapper.deleteAppletAnswerTrainByIds(ids);
    }

    /**
     * 删除用户培训考核答案信息
     * 
     * @param id 用户培训考核答案主键
     * @return 结果
     */
    @Override
    public int deleteAppletAnswerTrainById(Long id)
    {
        return appletAnswerTrainMapper.deleteAppletAnswerTrainById(id);
    }
}
