package com.ruoyi.ss.refund.mapper;

import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.ss.refund.domain.Refund;
import com.ruoyi.ss.refund.domain.RefundQuery;
import com.ruoyi.ss.refund.domain.RefundVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 退款订单Mapper接口
 *
 * @author ruoyi
 * @date 2024-07-09
 */
public interface RefundMapper
{
    /**
     * 查询退款订单
     *
     * @param refundId 退款订单主键
     * @return 退款订单
     */
    public RefundVO selectRefundByRefundId(Long refundId);

    /**
     * 查询退款订单列表
     *
     * @param refund 退款订单
     * @return 退款订单集合
     */
    public List<RefundVO> selectRefundList(@Param("query") RefundQuery refund);

    /**
     * 新增退款订单
     *
     * @param refund 退款订单
     * @return 结果
     */
    public int insertRefund(Refund refund);

    /**
     * 修改退款订单
     *
     * @param refund 退款订单
     * @return 结果
     */
    public int updateRefund(@Param("data") Refund refund);

    /**
     * 删除退款订单
     *
     * @param refundId 退款订单主键
     * @return 结果
     */
    public int deleteRefundByRefundId(Long refundId);

    /**
     * 批量删除退款订单
     *
     * @param refundIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRefundByRefundIds(Long[] refundIds);

    RefundVO selectOne(@Param("query") RefundQuery query);

    /**
     * 条件更新
     */
    int updateByQuery(@Param("data") Refund data, @Param("query") RefundQuery query);

    /**
     * 按日查询退款金额
     */
    List<LocalDateDecimalVO> selectDailyAmount(@Param("query") RefundQuery query);
}
