package com.jeeplus.pubmodules.collect.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jeeplus.pubmodules.collect.domain.CollectBasic;
import com.jeeplus.pubmodules.collect.domain.CollectBasicsReturn;
import com.jeeplus.pubmodules.collect.service.dto.CollectDto;
import com.jeeplus.pubmodules.collect.service.dto.WareHouseSummaryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 王强
 * @create: 2023-01-03 16:29
 **/
public interface CollectBasicMapper extends BaseMapper<CollectBasic> {

    void updateStatusById(@Param("id") String id, @Param("type") String type);

    List<String> findChildIds(String department);

    IPage<CollectDto> findList(Page<CollectDto> page, @Param(Constants.WRAPPER) QueryWrapper<CollectDto> queryWrapper);

    IPage<WareHouseSummaryDto> findWareHouseList(Page<WareHouseSummaryDto> page, @Param(Constants.WRAPPER) QueryWrapper<WareHouseSummaryDto> queryWrapper);

    String getUserNameByUserId(String handledBy);

    CollectBasicsReturn selectReturnByBasicId(String id);

    /**
     * 清除退回原因
     * @param id
     */
    void setCauseEmptyById(String id);

    String getOfficeNameByOfficeId(String handledByOffice);
}
