package com.willalp.erms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.willalp.erms.domain.HsGoodsStorage;
import com.willalp.erms.mapper.HsGoodsStorageMapper;
import com.willalp.erms.service.IHsGoodsStorageService;
import jodd.util.StringUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 物资库Service业务层处理
 *
 * @author willalp
 * @date 2023-03-08
 */
@Service
public class HsGoodsStorageServiceImpl extends ServiceImpl<HsGoodsStorageMapper, HsGoodsStorage> implements IHsGoodsStorageService {
    @Resource
    private HsGoodsStorageMapper hsGoodsStorageMapper;

    /**
     * 查询物资库列表
     *
     * @param hsGoodsStorage 物资库
     * @return 物资库
     */
    @Override
    public List<HsGoodsStorage> selectHsGoodsStorageList(HsGoodsStorage hsGoodsStorage) {
        return hsGoodsStorageMapper.selectHsGoodsStorageList(hsGoodsStorage);
    }

    @Override
    public  List<HsGoodsStorage> appGetGoodsByType(String type,String name) {
        if (StringUtil.isBlank(type)) {
            return null;
        }
        return baseMapper.appGetGoodsByType(type,name);
    }

    @Override
    public Map<String, Object> flowGetGoodsById(String id) {
        return baseMapper.flowGetGoodsById(id);
    }
}
