package com.game.business.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.game.business.domain.FinTranRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.game.business.dto.AppUserTeamTranserDto;
import com.game.business.dto.AppUserTeamTranserRecordDto;
import com.game.business.dto.FinTranDto;
import com.game.business.dto.FinTranRecordDTO;
import com.game.business.vo.FinTranVo;
import com.game.common.core.domain.HttpRet;
import com.game.common.core.domain.R;
import org.apache.ibatis.annotations.Param;

/**
 * 消费记录Service接口
 *
 * @author game
 * @date 2024-06-18
 */
public interface IFinTranRecordService extends IService<FinTranRecord> {
    /**
     * 查询消费记录
     *
     * @param id 消费记录主键
     * @return 消费记录
     */
    public FinTranRecord selectFinTranRecordById(Long id);

    /**
     * 查询消费记录列表
     *
     * @param finTranRecord 消费记录
     * @return 消费记录集合
     */
    public List<FinTranRecord> selectFinTranRecordList(FinTranRecord finTranRecord);

    /**
     * 新增消费记录
     *
     * @param finTranRecord 消费记录
     * @return 结果
     */
    public int insertFinTranRecord(FinTranRecord finTranRecord);

    /**
     * 修改消费记录
     *
     * @param finTranRecord 消费记录
     * @return 结果
     */
    public int updateFinTranRecord(FinTranRecord finTranRecord);

    /**
     * 批量删除消费记录
     *
     * @param ids 需要删除的消费记录主键集合
     * @return 结果
     */
    public int deleteFinTranRecordByIds(Long[] ids);

    /**
     * 删除消费记录信息
     *
     * @param id 消费记录主键
     * @return 结果
     */
    public int deleteFinTranRecordById(Long id);


    /**
     * 删除消费记录信息
     *
     * @param userId 用户id
     * @return 结果
     */
    public List<FinTranRecord> getUserRecordList(String userId,String beginTime,String endTime);

    Long nextId();

    /**
     * 余额转账
     * */
    public HttpRet<Boolean> transfer(AppUserTeamTranserDto transfer);

    /**
     * 金币转账
     * */
    public HttpRet<Boolean> coinTransfer(AppUserTeamTranserDto transfer);

    /**
     * 代存记录
     * */
    public List<FinTranRecord> transferRecord(AppUserTeamTranserRecordDto transerRecordDto);

    public List<FinTranRecord> selecListByWrapper(LambdaQueryWrapper<FinTranRecord> queryWrapper);

    public JSONObject selecFinTranRecordCount(FinTranRecordDTO finTranRecordDTO);

    List<FinTranVo> selectTranList(FinTranDto finTranDto);

    /**
     * 根据type查询流水
     * */
    List<FinTranRecord> selectUserTran(Integer type1, String type3s, Long userId, Date beginDate,Date endDate,Integer withDrawFlag);

    Double sumUserTran(Integer type1, String type3s, Long userId, Date beginDate,Date endDate,Integer withDrawFlag);

    Double sumUserRechareTran(Long userId,Date beginDate,Date endDate);

    Map<String,Double> selectExChangeSum(FinTranRecordDTO recordDTO);
}