package com.jeeplus.psimanage.foodPurchase.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.psimanage.foodPurchase.domain.PsiFoodPurchaseBasic;
import com.jeeplus.psimanage.foodPurchase.service.dto.PsiFoodPurchaseDto;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface PsiFoodPurchaseBasicMapper extends BaseMapper<PsiFoodPurchaseBasic> {

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

    List<String> findChildIds(String department);

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

    String getUserNameByUserId(String handledBy);

    String getOfficeNameByOfficeId(String handledByOffice);

    BigDecimal statistics(@Param(Constants.WRAPPER) QueryWrapper<PsiFoodPurchaseDto> queryWrapper);

    void updateFlowInfoById(@Param("id") String id, @Param("status") String status,
                            @Param("procInsId") String procInsId, @Param("processDefinitionId") String processDefinitionId);
}
