package com.sunxung.factoring.mapper.businessManagement;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sunxung.factoring.entity.businessmanagement.BusinessBasicInfo;
import com.sunxung.factoring.entity.project.vo.BusinessProcessingTaskVo;
import com.sunxung.factoring.entity.project.vo.SearchBusinessProcessingTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author liutao
 */
@Mapper
public interface BusinessBasicInfoMapper extends BaseMapper<BusinessBasicInfo> {

    /**
     * 获取符合条件的业务
     *
     * @param map
     * @return
     */
    List<BusinessBasicInfo> getBusinessList(Map map);

    /**
     * 查询全员权限的可见数据
     *
     * @param map
     * @return
     */
    List<BusinessBasicInfo> selectBusinesAdmin(Map map);

    /**
     * 【供应商+核心企业】对应的业务编号
     *
     * @param supplierId
     * @param customerId
     * @param name
     * @return
     */
    List<BusinessBasicInfo> getLocalUserBusinessList(@Param("supplierId") Long supplierId, @Param("customerId") Long customerId, @Param("userId") Long userId, @Param("name") String name);

    /**
     * 供应商登录【供应商+核心企业+业务名称】对应的业务编号
     *
     * @param customerId
     * @param supplierId
     * @return
     */
    List<BusinessBasicInfo> getLocalSupplierBusinessList(@Param("customerId") Long customerId, @Param("supplierId") Long supplierId);

    /**
     * 【核心企业】对应的业务编号
     *
     * @param userId
     * @param customerId
     * @return
     */
    List<BusinessBasicInfo> getBusinessListByCustomer(@Param("userId") Long userId, @Param("customerId") Long customerId);

    /**
     * 结算单  底层【供应商+核心企业】对应的业务编号
     *
     * @param
     * @param businessName
     * @return
     */
    List<BusinessBasicInfo> getLocalUserBusinessListByAcceptance(@Param("supplierId") Long supplierId, @Param("customerId") Long customerId, @Param("userId") Long userId, @Param("businessName")String businessName);

    /**
     * 供应商登录【供应商+核心企业】对应的业务编号
     *
     * @param customerId
     * @param supplierId
     * @return
     */
    List<BusinessBasicInfo> getLocalSupplierBusinessListByAcceptance(@Param("customerId") Long customerId, @Param("supplierId") Long supplierId);


    /**
     * 发票模块【核心企业】对应的业务编号
     *
     * @param userId
     * @param customerId
     * @return
     */
    List<BusinessBasicInfo> getBusinessListByCustomerInvoice(@Param("userId") Long userId, @Param("customerId") Long customerId);

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

    /**
     * 查询全部数据
     *
     * @param search
     * @return
     */
    List<BusinessProcessingTaskVo> findAllList(SearchBusinessProcessingTask search);
}
