package com.fs.hospital.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.hospital.mapper.HospitalWarehouseMapper;
import com.fs.hospital.domain.HospitalWarehouse;
import com.fs.hospital.service.IHospitalWarehouseService;

/**
 * 诊所仓库Service业务层处理
 *
 * @author fs
 * @date 2024-03-12
 */
@Service
public class HospitalWarehouseServiceImpl implements IHospitalWarehouseService
{
    @Autowired
    private HospitalWarehouseMapper hospitalWarehouseMapper;

    /**
     * 查询诊所仓库
     *
     * @param warehouseId 诊所仓库主键
     * @return 诊所仓库
     */
    @Override
    public HospitalWarehouse selectHospitalWarehouseByWarehouseId(Long warehouseId)
    {
        return hospitalWarehouseMapper.selectHospitalWarehouseByWarehouseId(warehouseId);
    }

    /**
     * 查询诊所仓库列表
     *
     * @param hospitalWarehouse 诊所仓库
     * @return 诊所仓库
     */
    @Override
    public List<HospitalWarehouse> selectHospitalWarehouseList(HospitalWarehouse hospitalWarehouse)
    {
        return hospitalWarehouseMapper.selectHospitalWarehouseList(hospitalWarehouse);
    }

    /**
     * 新增诊所仓库
     *
     * @param hospitalWarehouse 诊所仓库
     * @return 结果
     */
    @Override
    public int insertHospitalWarehouse(HospitalWarehouse hospitalWarehouse)
    {
        hospitalWarehouse.setCreateTime(DateUtils.getNowDate());
        return hospitalWarehouseMapper.insertHospitalWarehouse(hospitalWarehouse);
    }

    /**
     * 修改诊所仓库
     *
     * @param hospitalWarehouse 诊所仓库
     * @return 结果
     */
    @Override
    public int updateHospitalWarehouse(HospitalWarehouse hospitalWarehouse)
    {
        return hospitalWarehouseMapper.updateHospitalWarehouse(hospitalWarehouse);
    }

    /**
     * 批量删除诊所仓库
     *
     * @param warehouseIds 需要删除的诊所仓库主键
     * @return 结果
     */
    @Override
    public int deleteHospitalWarehouseByWarehouseIds(Long[] warehouseIds)
    {
        return hospitalWarehouseMapper.deleteHospitalWarehouseByWarehouseIds(warehouseIds);
    }

    /**
     * 删除诊所仓库信息
     *
     * @param warehouseId 诊所仓库主键
     * @return 结果
     */
    @Override
    public int deleteHospitalWarehouseByWarehouseId(Long warehouseId)
    {
        return hospitalWarehouseMapper.deleteHospitalWarehouseByWarehouseId(warehouseId);
    }
}
