package com.xhpc.payment.mapper;

import com.xhpc.common.domain.XhpcRechargeOrder;
import org.apache.ibatis.annotations.Param;

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

/**
 * 充值订单信息 数据层
 *
 * @author ruoyi
 */
public interface XhpcRechargeOrderMapper {

    /**
     * 新增 充值订单信息
     *
     * @param xhpcRechargeOrder 充值订单信息
     * @return 结果
     */
    public int insert(XhpcRechargeOrder xhpcRechargeOrder);

    /**
     * 修改充值订单信息
     *
     * @param xhpcRechargeOrder 充值订单信息
     * @return 结果
     */
    public int update(XhpcRechargeOrder xhpcRechargeOrder);

    /**
     * 查询充值订单详情
     *
     * @param rechargeOrderId 充值订单id
     * @return 结果
     */
    public Map<String, Object> info(@Param("rechargeOrderId") Long rechargeOrderId);

    /**
     * 充值订单分页列表
     *
     * @param phone
     * @param rechargeOrderNumber
     * @param status
     * @param createTimeStart
     * @param createTimeEnd
     * @return
     */
    public List<Map<String, Object>> page(@Param("phone") String phone, @Param("rechargeOrderNumber") String rechargeOrderNumber, @Param("status") String status, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);

    /**
     * 统计
     *
     * @param phone
     * @param rechargeOrderNumber
     * @param status
     * @param createTimeStart
     * @param createTimeEnd
     * @return
     */
    public Map<String, Object> sumMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId,@Param("time1")String time1,@Param("time2")String time2,@Param("time3")String time3,@Param("time4")String time4);

    public Map<String, Object> sumUserMoney(@Param("phone")String phone,@Param("rechargeOrderNumber") String rechargeOrderNumber,@Param("status") String status,@Param("createTimeStart") String createTimeStart,@Param("createTimeEnd") String createTimeEnd,@Param("type")Integer type,@Param("source")Integer source,@Param("userId")Integer userId,@Param("tenantId")String tenantId);

    /**
     * 查询充值订单详情
     *
     * @param rechargeOrderNumber 充值订单编号
     * @return 结果
     */
    public XhpcRechargeOrder infoRechargeOrderNumber(@Param("rechargeOrderNumber") String rechargeOrderNumber);


    /**
     * 每隔30分钟，清理一次未支付的订单
     */
    public void updateRechargeOrderStatus();
}
