package com.ruoyi.ss.receiveBill.service;

import com.ruoyi.ss.device.domain.vo.DeviceVO;
import com.ruoyi.ss.receiveBill.domain.ReceiveBill;
import com.ruoyi.ss.receiveBill.domain.ReceiveBillQuery;
import com.ruoyi.ss.receiveBill.domain.ReceiveBillVO;
import com.ruoyi.ss.receiveBill.domain.vo.ReceiveAmountVO;
import com.ruoyi.ss.user.domain.SmUserVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 应收账单Service接口
 *
 * @author ruoyi
 * @date 2024-07-22
 */
public interface ReceiveBillService
{
    /**
     * 查询应收账单
     *
     * @param billId 应收账单主键
     * @return 应收账单
     */
    public ReceiveBillVO selectReceiveBillByBillId(Long billId);

    /**
     * 查询应收账单列表
     *
     * @param receiveBill 应收账单
     * @return 应收账单集合
     */
    public List<ReceiveBillVO> selectReceiveBillList(ReceiveBillQuery receiveBill);

    /**
     * 新增应收账单
     *
     * @param receiveBill 应收账单
     * @return 结果
     */
    public int insertReceiveBill(ReceiveBill receiveBill);

    /**
     * 修改应收账单
     *
     * @param receiveBill 应收账单
     * @return 结果
     */
    public int updateReceiveBill(ReceiveBill receiveBill);

    /**
     * 批量删除应收账单
     *
     * @param billIds 需要删除的应收账单主键集合
     * @return 结果
     */
    public int deleteReceiveBillByBillIds(Long[] billIds);

    /**
     * 删除应收账单信息
     *
     * @param billId 应收账单主键
     * @return 结果
     */
    public int deleteReceiveBillByBillId(Long billId);

    /**
     * 月费商户出账
     *
     * @param mch                商户信息
     * @param device             设备信息
     */
    int genBillByMonthAndPay(SmUserVO mch, DeviceVO device);

    /**
     * 查询数量
     */
    int selectCount(ReceiveBillQuery query);

    /**
     * 查询账单金额总额
     */
    BigDecimal selectSumOfAmount(ReceiveBillQuery query);

    <K> List<ReceiveAmountVO<K>> selectCommonSumOfAmount(ReceiveBillQuery receiveQuery, String groupBy);
}
