/*
* Copyright (c) 京北方信息技术股份有限公司 Corporation 2022 . All rights reserved.
*
*/
package net.northking.cctp.scriptcase.db.dao;

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.vo.ApiScriptOptionVO;
import net.northking.cctp.common.http.QueryByPage;
import net.northking.cctp.scriptcase.db.entity.AtuScriptInfo;
import net.northking.cctp.scriptcase.db.mapper.AtuScriptInfoMapper;
import net.northking.cctp.scriptcase.dto.atuScript.atuScriptGroup.PublishScriptQueryDto;
import net.northking.cctp.scriptcase.dto.atuScript.atuScriptInfo.AtuScriptInfoDetailDto;
import net.northking.cctp.scriptcase.dto.atuScript.atuScriptInfo.AtuScriptInfoQueryDto;
import net.northking.cctp.scriptcase.dto.atuScript.atuScriptInfo.PrincipalUpdateDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * Mybatis数据库持久层（业务层）：脚本信息表
 *
 * <p>文件内容由代码生成器产生，请不要手动修改！ <br>
 * createdate:  2022-10-18 17:29:31  <br>
 * @author:  maven-cctp-plugin  <br>
 * @since:  1.0 <br>
 */
@Repository
public interface AtuScriptInfoDao extends AtuScriptInfoMapper
{

  /**
   *根据脚本名称统计脚本数量
   * @param scriptName
   * @param projectId
   * @return
   */
    Integer countScriptByScriptName(@Param("scriptName") String scriptName,@Param("projectId") String projectId);

  /**
   * 条件查询脚本列表
   * @param query
   * @return
   */
    List<AtuScriptInfoDetailDto> queryScriptList(QueryByPage<AtuScriptInfoQueryDto> query);

  /**
   * 删除脚本列表
   * @param scriptInfo
   * @param scriptIds
   * @return
   */
    Integer deleteScriptList(@Param("script") AtuScriptInfo scriptInfo, @Param("list") List<String> scriptIds);

  /**
   * 查询复制时同名的脚本
   * @param projectId
   * @param scriptName
   * @return
   */
  List<AtuScriptInfo> findScriptCopyNum(@Param("projectId") String projectId, @Param("scriptName") String scriptName);

  /**
   * 根据id列表查询脚本
   * @param scriptIds
   * @return
   */
  List<AtuScriptInfo> queryScriptByIds(@Param("list") List<String> scriptIds);

  List<AtuScriptInfo> queryAppByScript(@Param("scriptIds") List<String> scriptIds);

  AtuScriptInfo queryScriptInfoByCase(String caseId);

  List<AtuScriptInfoDetailDto> getPublishScriptList(PublishScriptQueryDto query);

  /**
   * 查询脚本详情
   * @param scriptIdSet 脚本id集合
   * @return 结果集
   */
    List<AtuScriptInfoDetailDto> queryScriptDetailList(@Param("scriptIdSet") Set<String> scriptIdSet);

    Integer updatePrincipal(PrincipalUpdateDto dto);

    List<String> queryScriptPlatforms(@Param("scriptIdSet") Set<String> scriptIdSet);

    List<String> selectManagerByProject(@Param("projectId") String projectId);

    List<String> selectCreatorByProject(@Param("projectId") String projectId);

    List<String> selectUpdaterByProject(@Param("projectId") String projectId);

  List<ApiScriptOptionVO> queryScriptVOList(@Param("scriptIdList")List<String> scriptList);

  List<ApiScriptOptionVO> queryScriptVOByCodeAndSystemId(@Param("scriptCode") String scriptCode, @Param("systemId") String systemId);
}
