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

import net.northking.cctp.scriptcase.db.dao.LibraryBusComTreeDao;
import net.northking.cctp.scriptcase.db.entity.LibraryBusComInfo;
import net.northking.cctp.scriptcase.db.service.LibraryBusComTreeService;
import net.northking.cctp.scriptcase.db.entity.LibraryBusComTree;

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.saas.db.TenantEntityService;

import net.northking.cctp.scriptcase.dto.comLib.LibraryBusComTreeDetailDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 业务组件库目录树
 *
 * <p>文件内容由代码生成器产生，请不要手动修改！ <br>
 * createdate:  2022-12-06 10:53:48  <br>
 * @author:  maven-cctp-plugin  <br>
 * @since:  1.0 <br>
 */
@Service
@ConditionalOnMissingBean(name = "LibraryBusComTreeServiceImpl")
public class LibraryBusComTreeServiceImpl extends TenantEntityService<LibraryBusComTree> implements LibraryBusComTreeService
{
private static final Logger logger = LoggerFactory.getLogger(LibraryBusComTreeServiceImpl.class);

  private final LibraryBusComTreeDao libraryBusComTreeDao;

  public LibraryBusComTreeServiceImpl(LibraryBusComTreeDao libraryBusComTreeDao) {this.libraryBusComTreeDao = libraryBusComTreeDao;}

  public BasicDao<LibraryBusComTree> getDao() {return libraryBusComTreeDao;}

  public LibraryBusComTree createEntity() { return new LibraryBusComTree();}

  @Override
  public int updateChildNamePath(LibraryBusComTree updateChild, String namePathNew) {
    initTenantId(updateChild);
    return libraryBusComTreeDao.updateChildNamePath(updateChild,namePathNew);
  }

  @Override
  public List<LibraryBusComTreeDetailDto> findChildTreeList(LibraryBusComTree entity) {
    initTenantId(entity);
    return libraryBusComTreeDao.findChildTreeList(entity);
  }

  @Override
  public void updateChildIdPath(LibraryBusComTree childUp, String idPath) {
    initTenantId(childUp);
    libraryBusComTreeDao.updateChildIdPath(childUp,idPath);
  }

  @Override
  public List<String> getChildTreeIds(String treeId) {
    LibraryBusComTree tree = new LibraryBusComTree();
    tree.setId(treeId);
    initTenantId(tree);
    return libraryBusComTreeDao.getChildTreeIds(tree);
  }

  @Override
  public List<String> getComTreePathByLib(LibraryBusComInfo comQuery, List<Integer> types) {
    initTenantId(comQuery);
    return libraryBusComTreeDao.getComTreePathByLib(comQuery,types);
  }

  @Override
  public List<LibraryBusComTree> findComTreeListLike(LibraryBusComInfo comQueryBus, List<Object> keys) {
    initTenantId(comQueryBus);
    return libraryBusComTreeDao.findComTreeListLike(comQueryBus,keys);
  }

}

