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.CareHospitalMapper;
import com.ruoyi.care.domain.CareHospital;
import com.ruoyi.care.service.ICareHospitalService;

/**
 * 医院Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-29
 */
@Service
public class CareHospitalServiceImpl implements ICareHospitalService 
{
    @Autowired
    private CareHospitalMapper careHospitalMapper;

    /**
     * 查询医院
     * 
     * @param hospitalId 医院主键
     * @return 医院
     */
    @Override
    public CareHospital selectCareHospitalByHospitalId(Long hospitalId)
    {
        return careHospitalMapper.selectCareHospitalByHospitalId(hospitalId);
    }

    /**
     * 查询医院列表
     * 
     * @param careHospital 医院
     * @return 医院
     */
    @Override
    public List<CareHospital> selectCareHospitalList(CareHospital careHospital)
    {
        return careHospitalMapper.selectCareHospitalList(careHospital);
    }

    /**
     * 新增医院
     * 
     * @param careHospital 医院
     * @return 结果
     */
    @Override
    public int insertCareHospital(CareHospital careHospital)
    {
        careHospital.setCreateTime(DateUtils.getNowDate());
        return careHospitalMapper.insertCareHospital(careHospital);
    }

    /**
     * 修改医院
     * 
     * @param careHospital 医院
     * @return 结果
     */
    @Override
    public int updateCareHospital(CareHospital careHospital)
    {
        careHospital.setUpdateTime(DateUtils.getNowDate());
        return careHospitalMapper.updateCareHospital(careHospital);
    }

    /**
     * 批量删除医院
     * 
     * @param hospitalIds 需要删除的医院主键
     * @return 结果
     */
    @Override
    public int deleteCareHospitalByHospitalIds(Long[] hospitalIds)
    {
        return careHospitalMapper.deleteCareHospitalByHospitalIds(hospitalIds);
    }

    /**
     * 删除医院信息
     * 
     * @param hospitalId 医院主键
     * @return 结果
     */
    @Override
    public int deleteCareHospitalByHospitalId(Long hospitalId)
    {
        return careHospitalMapper.deleteCareHospitalByHospitalId(hospitalId);
    }
}
