package com.xisc.pm.domain.repository;

import org.hzero.mybatis.base.BaseRepository;
import org.springframework.web.bind.annotation.PathVariable;

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

import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.annotation.SortDefault;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import io.choerodon.mybatis.pagehelper.domain.Sort;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 请求信息表资源库
 *
 * @author jun.zeng 2024-11-25 14:51:07
 */
public interface PmRequestInfoRepository extends BaseRepository<PmRequestInfo> {

    /**
     * 检查执行中的自动组板请求
     * @return
     */
    boolean checkAutoPdExecStatus(Long tenantId);
    
    /**
     * 标记执行成功
     * @param pmRequestInfo
     * @param tenantId
     * @return
     */
    int markExecFinshed(PmRequestInfo pmRequestInfo , Long tenantId);
    
    /**
     * 标记执行失败
     * @param requestId
     * @param tenantId
     * @return
     */
    int markExecFailed(PmRequestInfo pmRequestInfo , Long tenantId);
    
    /**
     * 标记状态-发布中
     * @param pmRequestInfo
     * @param tenantId
     * @return
     */
    int markPublishing(PmRequestInfo pmRequestInfo, Long tenantId) ;
    
    /**
     * 标记发布成功
     * @param requestId
     * @param tenantId
     * @return
     */
    int markPublished(PmRequestInfo pmRequestInfo , Long tenantId);
    
    /**
     * 分页查询
     * @param organizationId
     * @param pmRequestInfo
     * @param pageRequest
     * @return
     */
    Page<PmRequestInfo> selectList(Long organizationId, PmRequestInfo pmRequestInfo,  PageRequest pageRequest);
}
