package com.jeeplus.psimanage.collect.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
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.psimanage.collect.domain.PsiCollectBasic;
import com.jeeplus.psimanage.collect.domain.PsiCollectBasicsReturn;
import com.jeeplus.psimanage.collect.service.dto.PsiCollectDto;
import com.jeeplus.psimanage.collect.service.dto.PsiWareHouseSummaryDto;
import com.jeeplus.psimanage.collect.service.dto.TreeUserDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

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

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

    List<String> findChildIds(String department);

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

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

    String getUserNameByUserId(String handledBy);

    PsiCollectBasicsReturn selectReturnByBasicId(String id);

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

    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByTenantId(String tenantId);

    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findJxcUserList( @Param("name")String name);

    String getOfficeNameByOfficeId(String handledByOffice);

}
