package com.dsk.cscec.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.CbSummaryActual;
import org.apache.ibatis.annotations.Param;

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

/**
 * 成本汇总-每月费用(CbSummaryActual)表数据库访问层
 *
 * @author cyf
 * @since 2024-02-06
 */
public interface CbSummaryActualMapper extends BaseMapper<CbSummaryActual> {
    /**
     * 批量新增或按主键更新数据（MyBatis原生foreach方法）
     *
     * @param entities List<CbSummaryActual> 实例对象列表
     * @return 影响行数
     */
    int insertOrUpdateBatch(@Param("entities") List<CbSummaryActual> entities);

    /**
     * 截至本月费用
     * @param cbSummaryId
     * @param expenseDate
     * @return
     */
    Map<String, BigDecimal> getTotal(@Param("cbSummaryId") Long cbSummaryId, @Param("expenseDate") String expenseDate);
}
