package cn.quant.andy.jpa.mybatis.mapper;

import cn.quant.andy.jpa.entity.InstitutionTransactionSummaryEntity;
import cn.quant.spring.data.domain.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface InstitutionTransactionSummaryMapper extends SummaryMapper, BaseMapper<InstitutionTransactionSummaryEntity> {

    int countTypes(@Param("txnType") String txnType, @Param("termNo") int termNo, @Param("postedFlag") boolean postedFlag);

    InstitutionTransactionSummaryEntity findOneById(@Param("id") Long id);

    List<InstitutionTransactionSummaryEntity> findDebitsByTermBase(@Param("baseCode") String baseCode, @Param("termNo") int termNo
            , @Param("baseOrderNo") String baseOrderNo, @Param("postedFlag") boolean postedFlag);

    List<InstitutionTransactionSummaryEntity> findAllByTerm(Pagination pagination, @Param("termNo") int termNo, @Param("txnFlag") String txnFlag
            , @Param("postedFlag") boolean postedFlag);

//    int deleteByPrimaryKey(Long transactionId);
//
//    int insert(InstitutionTransactionSummaryEntity record);
//
//    int insertSelective(InstitutionTransactionSummaryEntity record);
//
//    InstitutionTransactionSummaryEntity selectByPrimaryKey(Long transactionId);
//
//    int updateByPrimaryKeySelective(InstitutionTransactionSummaryEntity record);
//
//    int updateByPrimaryKey(InstitutionTransactionSummaryEntity record);
}