package com.xisc.pm.domain.repository;

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

import org.hzero.mybatis.base.BaseRepository;

import com.xisc.pm.domain.entity.PmRuntimeContract;

/**
 * 合同范围表(PmRuntimeContract)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-10-11 09:35:44
 */
public interface PmRuntimeContractRepository extends BaseRepository<PmRuntimeContract> {
    /**
     * 查询
     *
     * @param pmRuntimeContract 查询条件
     * @return 返回值
     */
    List<PmRuntimeContract> selectList(PmRuntimeContract pmRuntimeContract);

    /**
     * 根据主键查询（可关联表）
     *
     * @param contractId 主键
     * @return 返回值
     */
    PmRuntimeContract selectByPrimary(Long contractId);
    
    /**
     * 查询总合约尾量合同小板数
     * @param requestId
     * @param tenantId
     * @return
     */
    BigDecimal selectAllNumberByRemainingFlag(Long requestId, Long tenantId);

    int deleteByRequestId(List<Long> requestIds);
    
    Map<String , PmRuntimeContract> selectWt(Long requestId, Long tenantId);
}
