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

import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService;
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 PatientQuestionSubmitResultServiceImpl implements IPatientQuestionSubmitResultService {
    @Resource
    private PatientQuestionSubmitResultMapper patientQuestionSubmitResultMapper;

    /**
     * 查询患者问卷提交结果信息
     *
     * @param id 患者问卷提交结果信息主键
     * @return 患者问卷提交结果信息
     */
    @Override
    public PatientQuestionSubmitResult selectPatientQuestionSubmitResultById(Long id) {
        return patientQuestionSubmitResultMapper.selectPatientQuestionSubmitResultById(id);
    }

    /**
     * 查询患者问卷提交结果信息列表
     *
     * @param patientQuestionSubmitResult 患者问卷提交结果信息
     * @return 患者问卷提交结果信息
     */
    @Override
    public List<PatientQuestionSubmitResult> selectPatientQuestionSubmitResultList(PatientQuestionSubmitResult patientQuestionSubmitResult) {
        return patientQuestionSubmitResultMapper.selectPatientQuestionSubmitResultList(patientQuestionSubmitResult);
    }

    /**
     * 新增患者问卷提交结果信息
     *
     * @param patientQuestionSubmitResult 患者问卷提交结果信息
     * @return 结果
     */
    @Override
    public int insertPatientQuestionSubmitResult(PatientQuestionSubmitResult patientQuestionSubmitResult) {
        patientQuestionSubmitResult.setCreateTime(LocalDateTime.now());
        return patientQuestionSubmitResultMapper.insertPatientQuestionSubmitResult(patientQuestionSubmitResult);
    }

    /**
     * 修改患者问卷提交结果信息
     *
     * @param patientQuestionSubmitResult 患者问卷提交结果信息
     * @return 结果
     */
    @Override
    public int updatePatientQuestionSubmitResult(PatientQuestionSubmitResult patientQuestionSubmitResult) {
        patientQuestionSubmitResult.setUpdateTime(LocalDateTime.now());
        return patientQuestionSubmitResultMapper.updatePatientQuestionSubmitResult(patientQuestionSubmitResult);
    }

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

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