package com.xinelu.manage.service.patientquestionoptionresult.impl;

import com.xinelu.manage.domain.patientquestionoptionresult.PatientQuestionOptionResult;
import com.xinelu.manage.mapper.patientquestionoptionresult.PatientQuestionOptionResultMapper;
import com.xinelu.manage.service.patientquestionoptionresult.IPatientQuestionOptionResultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 患者问卷题目选项提交结果信息Service业务层处理
 *
 * @author xinelu
 * @date 2024-03-28
 */
@Service
public class PatientQuestionOptionResultServiceImpl implements IPatientQuestionOptionResultService {
    @Resource
    private PatientQuestionOptionResultMapper patientQuestionOptionResultMapper;

    /**
     * 查询患者问卷题目选项提交结果信息
     *
     * @param id 患者问卷题目选项提交结果信息主键
     * @return 患者问卷题目选项提交结果信息
     */
    @Override
    public PatientQuestionOptionResult selectPatientQuestionOptionResultById(Long id) {
        return patientQuestionOptionResultMapper.selectPatientQuestionOptionResultById(id);
    }

    /**
     * 查询患者问卷题目选项提交结果信息列表
     *
     * @param patientQuestionOptionResult 患者问卷题目选项提交结果信息
     * @return 患者问卷题目选项提交结果信息
     */
    @Override
    public List<PatientQuestionOptionResult> selectPatientQuestionOptionResultList(PatientQuestionOptionResult patientQuestionOptionResult) {
        return patientQuestionOptionResultMapper.selectPatientQuestionOptionResultList(patientQuestionOptionResult);
    }

    /**
     * 新增患者问卷题目选项提交结果信息
     *
     * @param patientQuestionOptionResult 患者问卷题目选项提交结果信息
     * @return 结果
     */
    @Override
    public int insertPatientQuestionOptionResult(PatientQuestionOptionResult patientQuestionOptionResult) {
        patientQuestionOptionResult.setCreateTime(LocalDateTime.now());
        return patientQuestionOptionResultMapper.insertPatientQuestionOptionResult(patientQuestionOptionResult);
    }

    /**
     * 修改患者问卷题目选项提交结果信息
     *
     * @param patientQuestionOptionResult 患者问卷题目选项提交结果信息
     * @return 结果
     */
    @Override
    public int updatePatientQuestionOptionResult(PatientQuestionOptionResult patientQuestionOptionResult) {
        patientQuestionOptionResult.setUpdateTime(LocalDateTime.now());
        return patientQuestionOptionResultMapper.updatePatientQuestionOptionResult(patientQuestionOptionResult);
    }

    /**
     * 批量删除患者问卷题目选项提交结果信息
     *
     * @param ids 需要删除的患者问卷题目选项提交结果信息主键
     * @return 结果
     */
    @Override
    public int deletePatientQuestionOptionResultByIds(Long[] ids) {
        return patientQuestionOptionResultMapper.deletePatientQuestionOptionResultByIds(ids);
    }

    /**
     * 删除患者问卷题目选项提交结果信息信息
     *
     * @param id 患者问卷题目选项提交结果信息主键
     * @return 结果
     */
    @Override
    public int deletePatientQuestionOptionResultById(Long id) {
        return patientQuestionOptionResultMapper.deletePatientQuestionOptionResultById(id);
    }
}
