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.common.utils.Result;
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);

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

    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 cashSumMoney(@Param("date") String date,@Param("dateType") String dateType);

    int cashCount(@Param("date") String date,@Param("dateType") String dateType);

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

    int awaitCashCount(@Param("date") String date,@Param("dateType") String dateType);

    IPage<CashOut> selectCashOut(Page<CashOut> pages,@Param("userId") Long userId);

    BigDecimal monthCashOutMoney(@Param("userId") Long userId,@Param("date") String date);

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

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

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

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

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

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

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

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

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

    BigDecimal cargoInsurance(String date, String dateType);

    BigDecimal MoneySumByIndentType(String date, String dateType, String indentType);

    BigDecimal cashDepositMoney(String date, String dateType);

}
