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

import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubjectResult;
import com.xinelu.manage.mapper.patientquestionsubjectresult.PatientQuestionSubjectResultMapper;
import com.xinelu.manage.service.patientquestionsubjectresult.IPatientQuestionSubjectResultService;
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 PatientQuestionSubjectResultServiceImpl implements IPatientQuestionSubjectResultService {
    @Resource
    private PatientQuestionSubjectResultMapper patientQuestionSubjectResultMapper;

    /**
     * 查询患者问卷题目提交结果信息
     *
     * @param id 患者问卷题目提交结果信息主键
     * @return 患者问卷题目提交结果信息
     */
    @Override
    public PatientQuestionSubjectResult selectPatientQuestionSubjectResultById(Long id) {
        return patientQuestionSubjectResultMapper.selectPatientQuestionSubjectResultById(id);
    }

    /**
     * 查询患者问卷题目提交结果信息列表
     *
     * @param patientQuestionSubjectResult 患者问卷题目提交结果信息
     * @return 患者问卷题目提交结果信息
     */
    @Override
    public List<PatientQuestionSubjectResult> selectPatientQuestionSubjectResultList(PatientQuestionSubjectResult patientQuestionSubjectResult) {
        return patientQuestionSubjectResultMapper.selectPatientQuestionSubjectResultList(patientQuestionSubjectResult);
    }

    /**
     * 新增患者问卷题目提交结果信息
     *
     * @param patientQuestionSubjectResult 患者问卷题目提交结果信息
     * @return 结果
     */
    @Override
    public int insertPatientQuestionSubjectResult(PatientQuestionSubjectResult patientQuestionSubjectResult) {
        patientQuestionSubjectResult.setCreateTime(LocalDateTime.now());
        return patientQuestionSubjectResultMapper.insertPatientQuestionSubjectResult(patientQuestionSubjectResult);
    }

    /**
     * 修改患者问卷题目提交结果信息
     *
     * @param patientQuestionSubjectResult 患者问卷题目提交结果信息
     * @return 结果
     */
    @Override
    public int updatePatientQuestionSubjectResult(PatientQuestionSubjectResult patientQuestionSubjectResult) {
        patientQuestionSubjectResult.setUpdateTime(LocalDateTime.now());
        return patientQuestionSubjectResultMapper.updatePatientQuestionSubjectResult(patientQuestionSubjectResult);
    }

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

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