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

import com.xinelu.manage.domain.signpatientpackage.SignPatientPackage;
import com.xinelu.manage.mapper.signpatientpackage.SignPatientPackageMapper;
import com.xinelu.manage.service.signpatientpackage.ISignPatientPackageService;
import org.springframework.stereotype.Service;

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

/**
 * 签约患者服务包信息Service业务层处理
 *
 * @author haown
 * @date 2024-02-27
 */
@Service
public class SignPatientPackageServiceImpl implements ISignPatientPackageService {
    @Resource
    private SignPatientPackageMapper signPatientPackageMapper;

    /**
     * 查询签约患者服务包信息
     *
     * @param id 签约患者服务包信息主键
     * @return 签约患者服务包信息
     */
    @Override
    public SignPatientPackage selectSignPatientPackageById(Long id) {
        return signPatientPackageMapper.selectSignPatientPackageById(id);
    }

    /**
     * 查询签约患者服务包信息列表
     *
     * @param signPatientPackage 签约患者服务包信息
     * @return 签约患者服务包信息
     */
    @Override
    public List<SignPatientPackage> selectSignPatientPackageList(SignPatientPackage signPatientPackage) {
        return signPatientPackageMapper.selectSignPatientPackageList(signPatientPackage);
    }

    /**
     * 新增签约患者服务包信息
     *
     * @param signPatientPackage 签约患者服务包信息
     * @return 结果
     */
    @Override
    public int insertSignPatientPackage(SignPatientPackage signPatientPackage) {
        signPatientPackage.setCreateTime(LocalDateTime.now());
        return signPatientPackageMapper.insertSignPatientPackage(signPatientPackage);
    }

    /**
     * 修改签约患者服务包信息
     *
     * @param signPatientPackage 签约患者服务包信息
     * @return 结果
     */
    @Override
    public int updateSignPatientPackage(SignPatientPackage signPatientPackage) {
        signPatientPackage.setUpdateTime(LocalDateTime.now());
        return signPatientPackageMapper.updateSignPatientPackage(signPatientPackage);
    }

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

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