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

import com.xinelu.manage.domain.signpatientinformed.SignPatientInformed;
import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper;
import com.xinelu.manage.service.signpatientinformed.ISignPatientInformedService;
import org.springframework.stereotype.Service;

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

/**
 * 签约知情同意书信息Service业务层处理
 *
 * @author xinelu
 * @date 2024-02-27
 */
@Service
public class SignPatientInformedServiceImpl implements ISignPatientInformedService {
    @Resource
    private SignPatientInformedMapper signPatientInformedMapper;

    /**
     * 查询签约知情同意书信息
     *
     * @param id 签约知情同意书信息主键
     * @return 签约知情同意书信息
     */
    @Override
    public SignPatientInformed selectSignPatientInformedById(Long id) {
        return signPatientInformedMapper.selectSignPatientInformedById(id);
    }

    /**
     * 查询签约知情同意书信息列表
     *
     * @param signPatientInformed 签约知情同意书信息
     * @return 签约知情同意书信息
     */
    @Override
    public List<SignPatientInformed> selectSignPatientInformedList(SignPatientInformed signPatientInformed) {
        return signPatientInformedMapper.selectSignPatientInformedList(signPatientInformed);
    }

    /**
     * 新增签约知情同意书信息
     *
     * @param signPatientInformed 签约知情同意书信息
     * @return 结果
     */
    @Override
    public int insertSignPatientInformed(SignPatientInformed signPatientInformed) {
        signPatientInformed.setCreateTime(LocalDateTime.now());
        return signPatientInformedMapper.insertSignPatientInformed(signPatientInformed);
    }

    /**
     * 修改签约知情同意书信息
     *
     * @param signPatientInformed 签约知情同意书信息
     * @return 结果
     */
    @Override
    public int updateSignPatientInformed(SignPatientInformed signPatientInformed) {
        signPatientInformed.setUpdateTime(LocalDateTime.now());
        return signPatientInformedMapper.updateSignPatientInformed(signPatientInformed);
    }

    /**
     * 批量删除签约知情同意书信息
     *
     * @param ids 需要删除的签约知情同意书信息主键
     * @return 结果
     */
    @Override
    public int deleteSignPatientInformedByIds(Long[] ids) {
        return signPatientInformedMapper.deleteSignPatientInformedByIds(ids);
    }

    /**
     * 删除签约知情同意书信息信息
     *
     * @param id 签约知情同意书信息主键
     * @return 结果
     */
    @Override
    public int deleteSignPatientInformedById(Long id) {
        return signPatientInformedMapper.deleteSignPatientInformedById(id);
    }

}
