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.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);

    Double sumMoney(@Param("time") String time, @Param("flag") Integer flag);

    Double sumMoneyMonthByUserId(@Param("time") String time, @Param("userId") Long userId);

    BigDecimal sumMoneyByUserId(@Param("userId") Long userId, @Param("time") String time, @Param("flag") Integer flag);

    Integer countMoney(@Param("time") String time, @Param("flag") Integer flag);


    Integer stayCount(@Param("time") String time, @Param("flag") Integer flag);

    Double stayMoney(@Param("time") String time, @Param("flag") Integer flag);

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

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

    IPage<CashOut> selectCashOutPage(Page<CashOut> page,String userName,String zhifubaoName, String zhifubao, String userId,
                                     Integer state, Integer userType, String startTime, String endTime,String phone );

    List<CashOut> selectCashOutList(String userName ,String zhifubaoName, String zhifubao, String userId,
                                     Integer state, Integer userType, String startTime, String endTime,String phone );

    Double selectCashMoneyByClassify(@Param("time") String time, @Param("flag") Integer flag,@Param("classify") Integer classify,@Param("state") Integer state);

    Integer selectCashCountByClassify(@Param("time") String time, @Param("flag") Integer flag,@Param("classify") Integer classify,@Param("state") Integer state);

}
