package com.casic.missiles.mapper.finance;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.casic.missiles.dto.business.order.labIncomeResponse;
import com.casic.missiles.dto.cockpit.ManageTrendResponse;
import com.casic.missiles.dto.customer.CustomerExcellentResponse;
import com.casic.missiles.dto.finance.AgreementApprovalListRequest;
import com.casic.missiles.dto.finance.AgreementApprovalListResponse;
import com.casic.missiles.model.finance.FinanceAgreementInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 合同表 Mapper 接口
 * </p>
 *
 * @author wangpeng
 * @since 2023-03-31
 */
public interface FinanceAgreementInfoMapper extends BaseMapper<FinanceAgreementInfo> {

    List<FinanceAgreementInfo> selectDraftListForApproval(Page<AgreementApprovalListResponse> page, @Param("request") AgreementApprovalListRequest request);

    List<FinanceAgreementInfo> selectBatchForApproval(Page<AgreementApprovalListResponse> page, @Param("request") AgreementApprovalListRequest request, @Param("businessKey")List<String> businessKeys);

    Long selectMaxAgreementNo();

    List<CustomerExcellentResponse> selectCustomerExcellentList();

    Integer selectCompleteAmount(@Param("dimension") String dimension, @Param("status") String status);

    List<labIncomeResponse> selectAmountByDept(@Param("dimension") String dimension);

    List<CustomerExcellentResponse> selectCustomerExcellentForCockpit();

    List<ManageTrendResponse> selectPreMonthCountByYear();
}
