package com.sqx.modules.pay.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.pay.entity.CashOut;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

/**
 * @author fang
 * @date 2020/7/8
 */
@Mapper
public interface CashOutDao extends BaseMapper<CashOut> {

    List<CashOut> selectCashOutLimit3();

    Double selectCashOutSum(@Param("userId") Long userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    BigDecimal sumMoney(@Param("date") String date, @Param("dateType") String dateType, @Param("state") Integer state);

    Integer countMoney(@Param("date") String date, @Param("dateType") String dateType, @Param("state") Integer state);

    Integer stayMoney(@Param("date") String date, @Param("dateType") String dateType);

    void updateMayMoney(@Param("type") Integer type,@Param("userId")Long userId,@Param("money") Double money);

    Double selectMayMoney(@Param("userId") Long userId);

    void addMoneyDetails(@Param("userId") Long userId,@Param("title") String title, @Param("content")String content, @Param("type")Integer type, @Param("money")BigDecimal money, @Param("createTime")Timestamp createTime);

    BigDecimal applyMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal accomplishMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal refuseMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal zhifubaoMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal weixinMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal cashDepositMoneySum(@Param("date") String date, @Param("dateType") String dateType);

    BigDecimal cashDepositMoney(String date, String dateType);

    IPage<CashOut> selectAdminHelpProfit(@Param("pages") Page<CashOut> pages, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("cashOut") CashOut cashOut);
}
