package com.jeeplus.test.materialManagement.purchase.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.test.materialManagement.purchase.domain.MaterialBasic;
import com.jeeplus.test.materialManagement.purchase.service.dto.MaterialInfoDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 王强
 * @create: 2022-12-02 16:57
 **/
public interface MaterialBasicMapper extends BaseMapper<MaterialBasic> {

    List<String> findChildIds(String department);

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

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

    String getHandledName(String handledBy);

    /**
     * 根据采购编号查相关数据
     * @param purchaseNo
     * @return
     */
    MaterialBasic getInfoByPurchaseNo(String purchaseNo);

    String getUserNameByUserId(String handledBy);
}
