package com.sqx.modules.pay.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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();

    List<CashOut> selectYesterday();

    List<CashOut> selectTemp();

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

    Integer selectTodayCashCount(@Param("userId") Long userId, @Param("state") Integer state,@Param("time") String time);

    Double selectSysUserCashOutSum(@Param("sysUserId") Long sysUserId, @Param("time") String time);

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

    Integer countMoney(@Param("start") String start, @Param("end") String end, @Param("flag") Integer flag);

    Integer stayMoney(@Param("start") String start, @Param("end") String end, @Param("flag") Integer flag);

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

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

    List<CashOut> selectCashOutPage(CashOut cashOut,@Param("isApp") boolean isApp);

    List<CashOut> selectCashOutList(@Param("cashOut") CashOut cashOut);

    BigDecimal selectSumMoney(@Param("userId") Long userId, @Param("state") Integer state);

}
