package com.microservices.dms.resourceLibrary.mapper;

import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
@Slave
public interface ProjectResourceLibraryMapper {

    List<ProjectListVo> selectProjectListCondition(ProjectListVo projectListVo);

    List<UserActionDataVo> selectCodeCommitCondition(UserActionDataVo userActionDataVo);

    List<UserActionDataVo> selectForkCondition(UserActionDataVo userActionDataVo);

    List<UserActionDataVo> selectIssueCondition(UserActionDataVo userActionDataVo);

    List<UserActionDataVo> selectPRCondition(UserActionDataVo userActionDataVo);

    List<UserActionDataVo> selectPraisesCondition(UserActionDataVo userActionDataVo);

    List<UserActionDataVo> selectSearchCondition(UserActionDataVo userActionDataVo);

    public ProjectResourceLibrary selectProjectResourceLibraryById(Long id);

    public List<ProjectResourceLibrary> selectProjectResourceLibraryList(ProjectResourceLibrary projectResourceLibrary);

    public int insertProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary);

    public int updateProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary);

    public int deleteProjectResourceLibraryById(Long id);

    public int deleteProjectResourceLibraryByIds(Long[] ids);

    long getTotalProjectCount();

    long getPublicProjectCount();

    long getTotalReleaseCount();

    long getTotalConversionCount();

    List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);

    String getProjectDomainNameByKey(@Param("projectDomain")  String projectDomain );

    List<TokenListVo> selectProjectInfos();

    Long sumProjectIssueToken(@Param("id") Long id);
}
