package com.njzscloud.dispose.cst.org.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njzscloud.dispose.cst.customer.pojo.entity.CustomerEntity;
import com.njzscloud.dispose.cst.customer.pojo.result.CustomerResult;
import com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult;
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
import com.njzscloud.dispose.cst.org.pojo.result.OrgResult;
import com.njzscloud.dispose.cst.org.pojo.result.TransOrgStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 组织信息
 * @author lzq
 */
@Mapper
public interface OrgMapper extends BaseMapper<OrgEntity> {
    boolean admitCustomer(@Param("orgId") Long orgId, @Param("customerId") Long customerId);

    boolean quitOrg(@Param("customerId") Long customerId);

    Page<OrgResult> paging(Page<OrgResult> page, @Param("ew") QueryWrapper<OrgResult> ew);

    List<CustomerResult> queryList(@Param("ew") QueryWrapper<CustomerEntity> ew);

    SearchCustomerResult getCustomer(@Param("customerId") Long customerId);

    /**
     * 查询运输方统计信息
     * @param orgIds 组织ID列表
     * @return 统计信息列表
     */
    List<TransOrgStatistics> queryTransOrgStatistics(@Param("orgIds") List<Long> orgIds);
}
