package com.hzs.member.achieve.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.member.achieve.CuMemberTree;
import com.hzs.common.domain.member.achieve.ext.CuMemberRetailSExt;
import com.hzs.common.domain.member.ext.CuMemberSettleExt;

import java.util.List;

/**
 * 会员网体历史记录 服务类
 */
public interface ICuMemberTreeService extends IService<CuMemberTree> {

    /**
     * 判断是否存在临时表
     *
     * @param tableName 表名
     */
    Integer queryExistOracleTable(String tableName);

    /**
     * 根据pkmember查询
     *
     * @param settleTableName
     * @param pkMember
     * @return
     */
    CuMemberSettleExt queryCuMemberTreeByPkMemberTable(String settleTableName, Long pkMember);

    /**
     * 查询推荐关系
     *
     * @param settleTableName
     * @param pkMember
     * @param vertexIdList    体系
     * @return
     */
    List<CuMemberRetailSExt> queryCuMemberTreeParentTable(String settleTableName, Long pkMember, List<Integer> vertexIdList);

    /**
     * 查询直推人数
     *
     * @param settleTableName
     * @param pkMember
     * @return
     */
    Long queryCuMemberTreeParentTableCount(String settleTableName, Long pkMember);

    /**
     * 查询秒结表是否有值
     *
     * @param settleTableName
     * @return
     */
    Long selectByTreeMemberCount(String settleTableName, Long pkMember);

    /**
     * 查询伞下安置新增业绩
     *
     * @param settleTableName
     * @param pkMember
     * @return
     */
    List<CuMemberSettleExt> brollyBelowResettle(String settleTableName, Long pkMember);

    /**
     * 根据pkmember查询 关联parent
     *
     * @param settleTableName
     * @param pkMember
     * @return
     */
    CuMemberRetailSExt queryCuMemberTreeByPlacePkMemberTable(String settleTableName, Long pkMember);

}
