package com.muchinfo.mtp3interface.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.muchinfo.mtp3pojos.entity.Useraccount;
import com.muchinfo.mtp3pojos.entity.Userreckonaccount;
import com.muchinfo.mtp3pojos.vo.common.InvestorSelectParam;
import com.muchinfo.mtp3pojos.vo.common.InvestorSelectResult;
import com.muchinfo.mtp3pojos.vo.common.OrganSelectParam;
import com.muchinfo.mtp3pojos.vo.common.OrganSelectResult;
import com.muchinfo.mtp3pojos.vo.investor.*;
import com.muchinfo.mtp3pojos.vo.organ.UserAccountReqParam;
import com.muchinfo.mtp3pojos.vo.organ.UserAccountRspResult;
import com.muchinfo.mtp3pojos.vo.organ.son.OrganSonTransferParam;
import com.muchinfo.mtp3pojos.vo.organ.son.OrganSonTransferResult;
import com.muchinfo.mtp3pojos.vo.profitshar.ProfitSharGroupOrganResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author XKF
 * @since 2024-04-16
 */
@Mapper
public interface IUseraccountMapper extends BaseMapper<Useraccount> {

    List<OrganSelectResult> queryOrganSelect(@Param("vo") OrganSelectParam vo);

    IPage<UserAccountRspResult> queryOrganPage(IPage<UserAccountRspResult> page, @Param("vo") UserAccountReqParam userInfoReqParam);

    IPage<UserAccountRspResult> querySonOrganPage(IPage<UserAccountRspResult> page, @Param("vo") UserAccountReqParam userInfoReqParam);

    /**
     * 获取交易商列表信息 分页查询
     *
     * @param page
     * @param dealerQueryParam
     * @return
     */
    IPage<DealerQueryResult> queryInvestorPage(IPage<DealerQueryResult> page, @Param("vo") DealerQueryParam dealerQueryParam);

    List<DealerQueryResult> queryInvestorPage(@Param("vo") DealerQueryParam dealerQueryParam);

    List<InvestorSelectResult> queryInvestorSelect(@Param("vo") InvestorSelectParam investorSelectParam);

    UserAccountDetailVo selectDetail(@Param("userid") Long userid);

    UserAccountDetailVo selectNewDetail(@Param("userid") Long userid);

    String selectOrganName(@Param("userid") Long userid);

    List<InvestorSelectResult> getOrganListAll(@Param("userId") Long userId, @Param("searchCode") String searchCode);

    String selectUserName(@Param("matchaccountid") Long matchaccountid);

    void updateAccount(@Param("userid") Long userid);

    IPage<InvestorModifyResult> queryModifyPage(IPage<InvestorModifyResult> page, @Param("vo") InvestorModifyParam param);

    List<UserAccountRspResult> getAreaAndAllChilds(@Param("areaid") Long areaid);

    Integer querySonOrganLevel(@Param("userid") Long userid, @Param("memberuserid") Long memberuserid);

    List<ProfitSharGroupOrganResult> getNoGroupSubOrgan(@Param("areauserid") Long areauserid);

    IPage<InvestorPersonalizedResult> queryPersonalized(IPage<InvestorPersonalizedResult> page, @Param("groupname") String groupname, @Param("userid") Long userid);

    IPage<InvestorPerDetailQueryResult> queryPersonalizedDetail(IPage<InvestorPerDetailQueryResult> page, @Param("vo") InvestorPerDetailQueryParam param);

    IPage<AccountRiskConfigResult> queryAccountRiskConfigPage(IPage<AccountRiskConfigResult> page, @Param("vo") AccountRiskConfigParam param);

    List<InvestorInitBZResult> getCustomerTypeByGoodsid(@Param("goodsid") Long goodsid, @Param("customertypeid") Integer customertypeid);

    List<RulesConfigVo> getTradeRuleDescriptions(@Param("vo") PersonalizationDelParam param);

    List<FeesConfigVo> getTradeFeeDescriptions(@Param("vo") PersonalizationDelParam param);

    List<OrganSelectResult> queryOrganSelect2And3(@Param("vo") OrganSelectParam param);

    List<Useraccount> queryUserAccount(@Param("userid") Long userid);

    List<Userreckonaccount> queryUra(@Param("userid") Long userid);

    List<OrganSelectResult> queryExchSonOrgin(@Param("vo") OrganSelectParam vo);

    IPage<UserAccountRspResult> queryOrganSonModify(IPage<UserAccountRspResult> page, @Param("vo") UserAccountReqParam param);

    IPage<OrganSonTransferResult> queryOrganSonTransfer(IPage<OrganSonTransferResult> page, @Param("vo") OrganSonTransferParam param);

    List<Useraccount> getInvestorTODiversion(Long memberuserid, Long areauserid, Long brokeruserid);

    List<Useraccount> queryUser(String subarealevelpath);

    void deleteSubAreaGroupDetailByUserid(Long userid);

    List<OrganSelectResult> querySonOrganPageByLevel(Integer subarealevel, String searchcode);

    IPage<InvestorCancelApplyResult> usercancelapply(IPage<InvestorCancelApplyResult> page, @Param("vo") InvestorCancelApplyParam param);

    List<InitInvestorTradeResult> getNoTradeConfigInvestorsLikeName(@Param("memberuserid") Long memberuserid, @Param("searchName") String searchName);
}
