package com.xisc.pm.domain.repository;

import java.util.List;

import org.hzero.mybatis.base.BaseRepository;

import com.xisc.pm.app.service.autoboard.dto.PmAutoPdCheckDTO;
import com.xisc.pm.app.service.autoboard.dto.PmAutoPdContractSummaryDTO;
import com.xisc.pm.app.service.autoboard.dto.PmAutoPdPublishedDetailDTO;
import com.xisc.pm.app.service.autoboard.dto.PmAutoPdResultRequestDTO;
import com.xisc.pm.app.service.autoboard.dto.PmAutoPdVersionDTO;
import com.xisc.pm.domain.entity.PmAutoPdResult;

/**
 * 自动组板结果信息表资源库
 *
 * @author jun.zeng 2024-11-21 11:05:36
 */
public interface PmAutoPdResultRepository extends BaseRepository<PmAutoPdResult> {

    List<PmAutoPdResult> selectList(PmAutoPdResultRequestDTO pmAutoPdResultRequestDTO, Long organizationId);
    
    /**
     * 
     * @param requestId
     * @param tenantId
     * @return
     */
    List<PmAutoPdVersionDTO> selectExecVersion(Long requestId , Long tenantId);

    /**
     * 删除
     * @param requestIds
     * @return 
     */
    int deleteByRequestId(List<Long> requestIds);
    
    /**
     * 查询汇总后的待发布数据（钢种+产线+断面维度汇总）
     * @param requestId
     * @param version
     * @param tenantId
     * @return
     */
    List<PmAutoPdPublishedDetailDTO> selectSummaryDetailList(Long requestId , Long version , Long tenantId);
    
    /**
     * 标记发布成功
     * @param tenantId
     * @param resultIdList
     * @return
     */
    int markPublishedSuccess(Long tenantId , List<Long> resultIdList);
    
    /**
     * 标记保存成功
     * @param tenantId
     * @param resultIdList
     * @return
     */
    int markSaveSuccess(Long tenantId , List<Long> resultIdList);
    
    int markRemovePublishedSave(Long tenantId, List<Long> resultIdList);
    
    int initContLock(List<String> virtualSlabNoList , Long requestId , Long version , Long tenantId);
    
    List<PmAutoPdCheckDTO> checkStockNum(List <String> virtualSlabNoList, Long requestId, Long version, Long tenantId);
    
    List<PmAutoPdContractSummaryDTO> selectPmAutoPdContractSummary(List <String> virtualSlabNoList, Long requestId, Long version, Long tenantId);
}
