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.HospitalProductLogsMapper;
import com.fs.hospital.domain.HospitalProductLogs;
import com.fs.hospital.service.IHospitalProductLogsService;

/**
 * 商品记录Service业务层处理
 *
 * @author fs
 * @date 2024-03-12
 */
@Service
public class HospitalProductLogsServiceImpl implements IHospitalProductLogsService
{
    @Autowired
    private HospitalProductLogsMapper hospitalProductLogsMapper;

    /**
     * 查询商品记录
     *
     * @param logsId 商品记录主键
     * @return 商品记录
     */
    @Override
    public HospitalProductLogs selectHospitalProductLogsByLogsId(Long logsId)
    {
        return hospitalProductLogsMapper.selectHospitalProductLogsByLogsId(logsId);
    }

    /**
     * 查询商品记录列表
     *
     * @param hospitalProductLogs 商品记录
     * @return 商品记录
     */
    @Override
    public List<HospitalProductLogs> selectHospitalProductLogsList(HospitalProductLogs hospitalProductLogs)
    {
        return hospitalProductLogsMapper.selectHospitalProductLogsList(hospitalProductLogs);
    }

    /**
     * 新增商品记录
     *
     * @param hospitalProductLogs 商品记录
     * @return 结果
     */
    @Override
    public int insertHospitalProductLogs(HospitalProductLogs hospitalProductLogs)
    {
        hospitalProductLogs.setCreateTime(DateUtils.getNowDate());
        return hospitalProductLogsMapper.insertHospitalProductLogs(hospitalProductLogs);
    }

    /**
     * 修改商品记录
     *
     * @param hospitalProductLogs 商品记录
     * @return 结果
     */
    @Override
    public int updateHospitalProductLogs(HospitalProductLogs hospitalProductLogs)
    {
        return hospitalProductLogsMapper.updateHospitalProductLogs(hospitalProductLogs);
    }

    /**
     * 批量删除商品记录
     *
     * @param logsIds 需要删除的商品记录主键
     * @return 结果
     */
    @Override
    public int deleteHospitalProductLogsByLogsIds(Long[] logsIds)
    {
        return hospitalProductLogsMapper.deleteHospitalProductLogsByLogsIds(logsIds);
    }

    /**
     * 删除商品记录信息
     *
     * @param logsId 商品记录主键
     * @return 结果
     */
    @Override
    public int deleteHospitalProductLogsByLogsId(Long logsId)
    {
        return hospitalProductLogsMapper.deleteHospitalProductLogsByLogsId(logsId);
    }
}
