package com.fs.hospital.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.hospital.param.HospitalStoreParam;
import com.fs.hospital.vo.HospitalStoreHVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.hospital.mapper.HospitalStoreMapper;
import com.fs.hospital.domain.HospitalStore;
import com.fs.hospital.service.IHospitalStoreService;

/**
 * 诊所供应商关联Service业务层处理
 *
 * @author fs
 * @date 2024-03-12
 */
@Service
public class HospitalStoreServiceImpl implements IHospitalStoreService
{
    @Autowired
    private HospitalStoreMapper hospitalStoreMapper;

    /**
     * 查询诊所供应商关联
     *
     * @param id 诊所供应商关联主键
     * @return 诊所供应商关联
     */
    @Override
    public HospitalStore selectHospitalStoreById(Long id)
    {
        return hospitalStoreMapper.selectHospitalStoreById(id);
    }

    /**
     * 查询诊所供应商关联列表
     *
     * @param hospitalStore 诊所供应商关联
     * @return 诊所供应商关联
     */
    @Override
    public List<HospitalStore> selectHospitalStoreList(HospitalStore hospitalStore)
    {
        return hospitalStoreMapper.selectHospitalStoreList(hospitalStore);
    }

    /**
     * 新增诊所供应商关联
     *
     * @param hospitalStore 诊所供应商关联
     * @return 结果
     */
    @Override
    public int insertHospitalStore(HospitalStore hospitalStore)
    {
        hospitalStore.setCreateTime(DateUtils.getNowDate());
        return hospitalStoreMapper.insertHospitalStore(hospitalStore);
    }

    /**
     * 修改诊所供应商关联
     *
     * @param hospitalStore 诊所供应商关联
     * @return 结果
     */
    @Override
    public int updateHospitalStore(HospitalStore hospitalStore)
    {
        return hospitalStoreMapper.updateHospitalStore(hospitalStore);
    }

    /**
     * 批量删除诊所供应商关联
     *
     * @param ids 需要删除的诊所供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteHospitalStoreByIds(Long[] ids)
    {
        return hospitalStoreMapper.deleteHospitalStoreByIds(ids);
    }

    /**
     * 删除诊所供应商关联信息
     *
     * @param id 诊所供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteHospitalStoreById(Long id)
    {
        return hospitalStoreMapper.deleteHospitalStoreById(id);
    }

    @Override
    public List<HospitalStoreHVO> selectHospitalStoreListPVO(HospitalStoreParam param) {
        return hospitalStoreMapper.selectHospitalStoreListPVO(param);
    }
}
