package com.github.wxiaoqi.security.admin.mapper;

import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathSumDto;
import com.github.wxiaoqi.security.admin.entity.MyWalletCath;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;

/**
 * 钱包提现表
 * 
 * @author zjw
 * @email 18178966185@163.com
 * @date 2019-07-11 14:14:54
 */
public interface MyWalletCathMapper extends Mapper<MyWalletCath> {

    List<WalletCathListDTO> selectByUserNameOrPhoneOrWithDrawSate(@Param("userName") String userName,
                                                                  @Param("phone") String phone,
                                                                  @Param("state") Integer state,
                                                                  @Param("orderNo") String orderNo,
                                                                  @Param("startTime") Long startTime,
                                                                  @Param("endTime") Long endTime);

    List<PersonalConsumptionDTO> findUserWithDrawingByUserIds(@Param("userIds") List<Integer> userIds);


    /**
     * 计算提现的金额
     * @param type 1-日；2-月
     * @return
     */
    WalletCathSumDto sumCathAmount(@Param("userId") Integer userId,@Param("type") int type);
}
