package com.dsk.cscec.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.CbSummary;
import com.dsk.cscec.domain.bo.CbSummaryActualListBo;
import com.dsk.cscec.domain.bo.CbSummaryBo;
import com.dsk.cscec.domain.vo.CbGainLossAnalysisListVo;
import com.dsk.cscec.domain.vo.CbSummaryActualListVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * 成本汇总(CbSummary)表数据库访问层
 *
 * @author cyf
 * @since 2024-02-06
 */
public interface CbSummaryMapper extends BaseMapper<CbSummary> {

    List<CbSummaryActualListVo> getByParentId(@Param("parentId") Long parentId, @Param("expenseDate") String expenseDate);

    CbSummaryActualListVo getById(@Param("id") Long id, @Param("expenseDate") String expenseDate);

    /**
     * 根据ids获取实际成本
     * @param entities
     * @param expenseDate
     * @return
     */
    List<CbSummaryActualListVo> getByIds(@Param("entities") List<CbSummary> entities, @Param("expenseDate") String expenseDate);

    /**
     * 根据月份获取所有项目汇总数据
     *
     * @param bo
     * @return
     */
    List<CbSummaryActualListVo> getProjectAll(@Param("bo") CbSummaryActualListBo bo);

    /**
     * 根据月份获取所有成本科目汇总数据
     *
     * @param bo
     * @return
     */
    List<CbSummaryActualListVo> getCostAccountAll(@Param("bo") CbSummaryActualListBo bo);

    /**
     * 获取已添加成本月份
     *
     * @param bo
     * @return
     */
    List<Map<String,Object>> getExpenseDateList(@Param("bo") CbSummaryBo bo);

    /**
     * 根据level获取名称/成本科目
     *
     * @param bo
     * @return
     */
    List<Map<String, Object>> selectByLevel(@Param("bo") CbSummaryBo bo);

    CbGainLossAnalysisListVo getGainLossAnalysisById(@Param("id") Long id, @Param("expenseDate") String expenseDate);

    List<CbGainLossAnalysisListVo> getGainLossAnalysisByParentId(@Param("id") Long parentId, @Param("expenseDate") String expenseDate);



}
