package com.sqx.modules.app.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.app.entity.UserMoneyDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.HashMap;

@Mapper
public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {

    Double monthIncome(@Param("date") String date,@Param("userId") Long userId);

    Double selectMyProfit(Long userId);

    IPage<UserMoneyDetails> selectMoneyDetails(Page<UserMoneyDetails> pages, @Param("userId") Long userId);

    IPage<HashMap<String, Object>> getProfitList(@Param("pages") Page<HashMap<String, Object>> pages, @Param("userId") Long userId, @Param("type") Integer type);

    IPage<HashMap<String, Object>> getAgentRanking(Page<HashMap<String, Object>> pages);

    IPage<UserMoneyDetails> findMoneyDetails(@Param("pages") Page<UserMoneyDetails> pages, @Param("userMoneyDetails") UserMoneyDetails userMoneyDetails);

    BigDecimal deductMoneySum(String date, Integer dateType);

    BigDecimal cashDepositMoney(String date, Integer dateType);

    IPage<UserMoneyDetails> selectCashDeposit(Page<UserMoneyDetails> pages, String phone, Integer type, Long userId);



}
