package com.ruoyi.care.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.care.mapper.CareProtocolMapper;
import com.ruoyi.care.domain.CareProtocol;
import com.ruoyi.care.service.ICareProtocolService;

/**
 * 协议Service业务层处理
 * 
 * @author qy
 * @date 2024-11-26
 */
@Service
public class CareProtocolServiceImpl implements ICareProtocolService 
{
    @Autowired
    private CareProtocolMapper careProtocolMapper;

    /**
     * 查询协议
     * 
     * @param id 协议主键
     * @return 协议
     */
    @Override
    public CareProtocol selectCareProtocolById(Long id)
    {
        return careProtocolMapper.selectCareProtocolById(id);
    }

    /**
     * 查询协议列表
     * 
     * @param careProtocol 协议
     * @return 协议
     */
    @Override
    public List<CareProtocol> selectCareProtocolList(CareProtocol careProtocol)
    {
        return careProtocolMapper.selectCareProtocolList(careProtocol);
    }

    /**
     * 新增协议
     * 
     * @param careProtocol 协议
     * @return 结果
     */
    @Override
    public int insertCareProtocol(CareProtocol careProtocol)
    {
        careProtocol.setCreateTime(DateUtils.getNowDate());
        return careProtocolMapper.insertCareProtocol(careProtocol);
    }

    /**
     * 修改协议
     * 
     * @param careProtocol 协议
     * @return 结果
     */
    @Override
    public int updateCareProtocol(CareProtocol careProtocol)
    {
        careProtocol.setUpdateTime(DateUtils.getNowDate());
        return careProtocolMapper.updateCareProtocol(careProtocol);
    }

    /**
     * 批量删除协议
     * 
     * @param ids 需要删除的协议主键
     * @return 结果
     */
    @Override
    public int deleteCareProtocolByIds(Long[] ids)
    {
        return careProtocolMapper.deleteCareProtocolByIds(ids);
    }

    /**
     * 删除协议信息
     * 
     * @param id 协议主键
     * @return 结果
     */
    @Override
    public int deleteCareProtocolById(Long id)
    {
        return careProtocolMapper.deleteCareProtocolById(id);
    }
}
