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.AppletAnswerMapper;
import com.ruoyi.model.domain.AppletAnswer;
import com.ruoyi.model.service.IAppletAnswerService;

/**
 * 基本考核答案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletAnswerServiceImpl implements IAppletAnswerService 
{
    @Autowired
    private AppletAnswerMapper appletAnswerMapper;

    /**
     * 查询基本考核答案
     * 
     * @param id 基本考核答案主键
     * @return 基本考核答案
     */
    @Override
    public AppletAnswer selectAppletAnswerById(Long id)
    {
        return appletAnswerMapper.selectAppletAnswerById(id);
    }

    /**
     * 查询基本考核答案列表
     * 
     * @param appletAnswer 基本考核答案
     * @return 基本考核答案
     */
    @Override
    public List<AppletAnswer> selectAppletAnswerList(AppletAnswer appletAnswer)
    {
        return appletAnswerMapper.selectAppletAnswerList(appletAnswer);
    }

    /**
     * 新增基本考核答案
     * 
     * @param appletAnswer 基本考核答案
     * @return 结果
     */
    @Override
    public int insertAppletAnswer(AppletAnswer appletAnswer)
    {
        appletAnswer.setCreateTime(DateUtils.getNowDate());
        return appletAnswerMapper.insertAppletAnswer(appletAnswer);
    }

    /**
     * 修改基本考核答案
     * 
     * @param appletAnswer 基本考核答案
     * @return 结果
     */
    @Override
    public int updateAppletAnswer(AppletAnswer appletAnswer)
    {
        appletAnswer.setUpdateTime(DateUtils.getNowDate());
        return appletAnswerMapper.updateAppletAnswer(appletAnswer);
    }

    /**
     * 批量删除基本考核答案
     * 
     * @param ids 需要删除的基本考核答案主键
     * @return 结果
     */
    @Override
    public int deleteAppletAnswerByIds(Long[] ids)
    {
        return appletAnswerMapper.deleteAppletAnswerByIds(ids);
    }

    /**
     * 删除基本考核答案信息
     * 
     * @param id 基本考核答案主键
     * @return 结果
     */
    @Override
    public int deleteAppletAnswerById(Long id)
    {
        return appletAnswerMapper.deleteAppletAnswerById(id);
    }
}
