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

import com.xinelu.manage.domain.signpatientpackagehardware.SignPatientPackageHardware;
import com.xinelu.manage.mapper.signpatientpackagehardware.SignPatientPackageHardwareMapper;
import com.xinelu.manage.service.signpatientpackagehardware.ISignPatientPackageHardwareService;
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 SignPatientPackageHardwareServiceImpl implements ISignPatientPackageHardwareService {
    @Resource
    private SignPatientPackageHardwareMapper signPatientPackageHardwareMapper;

    /**
     * 查询签约患者服务包硬件信息
     *
     * @param id 签约患者服务包硬件信息主键
     * @return 签约患者服务包硬件信息
     */
    @Override
    public SignPatientPackageHardware selectSignPatientPackageHardwareById(Long id) {
        return signPatientPackageHardwareMapper.selectSignPatientPackageHardwareById(id);
    }

    /**
     * 查询签约患者服务包硬件信息列表
     *
     * @param signPatientPackageHardware 签约患者服务包硬件信息
     * @return 签约患者服务包硬件信息
     */
    @Override
    public List<SignPatientPackageHardware> selectSignPatientPackageHardwareList(SignPatientPackageHardware signPatientPackageHardware) {
        return signPatientPackageHardwareMapper.selectSignPatientPackageHardwareList(signPatientPackageHardware);
    }

    /**
     * 新增签约患者服务包硬件信息
     *
     * @param signPatientPackageHardware 签约患者服务包硬件信息
     * @return 结果
     */
    @Override
    public int insertSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) {
        signPatientPackageHardware.setCreateTime(LocalDateTime.now());
        return signPatientPackageHardwareMapper.insertSignPatientPackageHardware(signPatientPackageHardware);
    }

    /**
     * 修改签约患者服务包硬件信息
     *
     * @param signPatientPackageHardware 签约患者服务包硬件信息
     * @return 结果
     */
    @Override
    public int updateSignPatientPackageHardware(SignPatientPackageHardware signPatientPackageHardware) {
        signPatientPackageHardware.setUpdateTime(LocalDateTime.now());
        return signPatientPackageHardwareMapper.updateSignPatientPackageHardware(signPatientPackageHardware);
    }

    /**
     * 批量删除签约患者服务包硬件信息
     *
     * @param ids 需要删除的签约患者服务包硬件信息主键
     * @return 结果
     */
    @Override
    public int deleteSignPatientPackageHardwareByIds(Long[] ids) {
        return signPatientPackageHardwareMapper.deleteSignPatientPackageHardwareByIds(ids);
    }

    /**
     * 删除签约患者服务包硬件信息信息
     *
     * @param id 签约患者服务包硬件信息主键
     * @return 结果
     */
    @Override
    public int deleteSignPatientPackageHardwareById(Long id) {
        return signPatientPackageHardwareMapper.deleteSignPatientPackageHardwareById(id);
    }
}
