package com.miaxis.app.hospital.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miaxis.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.miaxis.app.hospital.mapper.HospitalInfoMapper;
import com.miaxis.app.hospital.domain.HospitalInfo;
import com.miaxis.app.hospital.service.IHospitalInfoService;

/**
 * 体检医院Service业务层处理
 *
 * @author miaxis
 * @date 2021-01-11
 */
@Service
public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, HospitalInfo> implements IHospitalInfoService {
    @Autowired
    private HospitalInfoMapper hospitalInfoMapper;

    /**
     * 查询体检医院
     *
     * @param id 体检医院ID
     * @return 体检医院
     */
    @Override
    public HospitalInfo selectHospitalInfoById(Long id){
        return hospitalInfoMapper.selectHospitalInfoById(id);
    }

    /**
     * 查询体检医院列表
     *
     * @param hospitalInfo 体检医院
     * @return 体检医院
     */
    @Override
    public List<HospitalInfo> selectHospitalInfoList(HospitalInfo hospitalInfo){
        return hospitalInfoMapper.selectHospitalInfoList(hospitalInfo);
    }

    /**
     * 新增体检医院
     *
     * @param hospitalInfo 体检医院
     * @return 结果
     */
    @Override
    public int insertHospitalInfo(HospitalInfo hospitalInfo){
        hospitalInfo.setCreateTime(DateUtils.getNowDate());
        return hospitalInfoMapper.insertHospitalInfo(hospitalInfo);
    }

    /**
     * 修改体检医院
     *
     * @param hospitalInfo 体检医院
     * @return 结果
     */
    @Override
    public int updateHospitalInfo(HospitalInfo hospitalInfo){
        hospitalInfo.setUpdateTime(DateUtils.getNowDate());
        return hospitalInfoMapper.updateHospitalInfo(hospitalInfo);
    }

    /**
     * 批量删除体检医院
     *
     * @param ids 需要删除的体检医院ID
     * @return 结果
     */
    @Override
    public int deleteHospitalInfoByIds(Long[] ids){
        return hospitalInfoMapper.deleteHospitalInfoByIds(ids);
    }

    /**
     * 删除体检医院信息
     *
     * @param id 体检医院ID
     * @return 结果
     */
    @Override
    public int deleteHospitalInfoById(Long id){
        return hospitalInfoMapper.deleteHospitalInfoById(id);
    }
}
