package com.sw.mes.store.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sw.mes.core.response.Result;
import com.sw.mes.store.entity.WarehouseModel;
import com.sw.mes.store.dto.WarehouseModelDto;

import javax.servlet.ServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @Author wupeng
 * @Description 针对表【warehouse_model】的数据库操作Service
 * @Date 11:13 2023/7/24
 * @Param
 * @return
 **/
public interface WarehouseModelService extends IService<WarehouseModel> {

    Result removeWithCheck(Long[] ids);

    List<WarehouseModelDto> getChildLocationIds(Long parentId);

    /**
     * 根据父id查询库位信息
     */
    List<WarehouseModel> findByParentId(Long parentId);

    WarehouseModel findByName(String name);

    WarehouseModel findByCode(String code);

    List<WarehouseModel> findByUserId(Integer userId);

    Result create(WarehouseModelDto warehouseModelDto);

    Map<String, WarehouseModelDto> getSuperior(Long id);
    Page<WarehouseModel> listByPage(IPage page, ServletRequest request);

    void updateByDto(WarehouseModelDto dto);

    WarehouseModel getCode(String code);
}
