package com.sunxung.factoring.mapper.acceptancesheet;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sunxung.factoring.entity.acceptance.AcceptanceBasicInfo;
import com.sunxung.factoring.entity.acceptance.vo.GoodsSearch;
import com.sunxung.factoring.entity.project.vo.BusinessProcessingTaskVo;
import com.sunxung.factoring.entity.project.vo.SearchBusinessProcessingTask;
import com.sunxung.factoring.entity.settlement.SettlementBasicInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liutao
 * @date 2021.9.10
 */
@Mapper
public interface AcceptanceBasicInfoMapper extends BaseMapper<AcceptanceBasicInfo> {

    /**
     * 因为 AcceptanceBasicInfo 继承了 project  没有businessNumber 所以getById 方法需要重新写一个
     * @param id
     * @return
     */
    AcceptanceBasicInfo getSpecialOneById(Long id);

    /**
     * 根据id查询所需数据 流程控制反射调用
     *
     * @param id
     * @return
     */
    AcceptanceBasicInfo getListPage(Long id);

    /**
     * 查询我已处理的验收单
     *
     * @param search
     * @return
     */
    List<BusinessProcessingTaskVo> findMyCompletedList(SearchBusinessProcessingTask search);

    /**
     * 查询我的全部验收单
     *
     * @param search
     * @return
     */
    List<BusinessProcessingTaskVo> findAllList(SearchBusinessProcessingTask search);

    /**
     * 查询已经结算并且审核通过的验收单信息
     *
     * @param goodsSearch
     * @return
     */
    List<SettlementBasicInfo> findGoodsBySettlement(GoodsSearch goodsSearch);

    /**
     * 获取可以做结算的验收单
     *
     * @param businessNumber
     * @param supplierId
     * @param status
     * @return
     */
    List<AcceptanceBasicInfo> getCanBeBillGoodsInformation(@Param("businessNumber") String businessNumber, @Param("supplierId") Long supplierId, @Param("status") Long status);

    /**
     * 查询所有  供应商登录
     *
     * @param search
     * @return
     */
    List<BusinessProcessingTaskVo> findAllListSupplier(SearchBusinessProcessingTask search);
}
