package com.ruoyi.ss.receiveBill.mapper;

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 org.apache.ibatis.annotations.Param;

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

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

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

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

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

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

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

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

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

    <K> List<ReceiveAmountVO<K>> selectCommonSumOfAmount(@Param("query") ReceiveBillQuery query, @Param("groupBy") String groupBy);
}
