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 com.sqx.modules.exportExecl.dto.AccountEntry;
import com.sqx.modules.pay.controller.query.CashOutQueryDTO;
import com.sqx.modules.pay.controller.query.WalletDetailQuery;
import com.sqx.modules.pay.vo.CashOutVO;
import com.sqx.modules.pay.vo.WalletDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {

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

    Double selectMyProfit(Long userId);

    IPage<UserMoneyDetails> selectUserMoneyDetails(Page<UserMoneyDetails> pages, @Param("userId") Long userId, @Param("classify") Integer classify);

    IPage<UserMoneyDetails> selectPwCashDetails(Page<UserMoneyDetails> pages, @Param("userName") String userName, @Param("date") String date,
                                                @Param("dateType") String dateType, @Param("zhifubao") String zhifubao, @Param("zhifubaoName") String zhifubaoName,
                                                @Param("userId") Long userId);

    IPage<UserMoneyDetails> selectShopCashDeposit(Page<UserMoneyDetails> pages, Long shopId, Integer classify);

    IPage<UserMoneyDetails> selectShopCashDepositList(Page<UserMoneyDetails> pages, Long shopId);

    IPage<WalletDetailVO> walletDetailList(@Param("page") Page<UserMoneyDetails> pages, @Param("query") WalletDetailQuery query);

    BigDecimal walletDetailStatistics(@Param("query") WalletDetailQuery query);

    List<WalletDetailVO> excelWalletDetails(@Param("query") WalletDetailQuery query);

    List<UserMoneyDetails> accountEntryManagementDetailsList(@Param("row") Integer row, @Param("limit") Integer limit, @Param("shopName") String shopName, @Param("shopPhone") String shopPhone,
                                                             @Param("userPhone") String userPhone, @Param("couponName") String couponName,
                                                             @Param("orderNumber") String orderNumber, @Param("startTime") String startTime, @Param("endTime") String endTime);

    int accountEntryManagementDetailsCount(@Param("shopName") String shopName, @Param("shopPhone") String shopPhone,
                                           @Param("userPhone") String userPhone, @Param("couponName") String couponName,
                                           @Param("orderNumber") String orderNumber, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<UserMoneyDetails> excelAccountEntry(@Param("query") AccountEntry query);

    IPage<UserMoneyDetails> accountEntryAbnormal(Page<UserMoneyDetails> pages,@Param("query") AccountEntry query);

    List<UserMoneyDetails> excelAccountEntryAbnormal(@Param("query") AccountEntry query);
}
