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

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.saas.db.TenantEntityService;
import net.northking.cctp.scriptcase.db.dao.BusComponentTreeDao;
import net.northking.cctp.scriptcase.db.entity.BusComponentTree;
import net.northking.cctp.scriptcase.db.entity.MdBusComponentInfo;
import net.northking.cctp.scriptcase.db.service.BusComponentTreeService;
import net.northking.cctp.scriptcase.dto.component.BusComponentTreeDetailDto;
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-09-21 17:09:45  <br>
 * @author:  maven-cctp-plugin  <br>
 * @since:  1.0 <br>
 */
@Service
@ConditionalOnMissingBean(name = "BusComponentTreeServiceImpl")
public class BusComponentTreeServiceImpl extends TenantEntityService<BusComponentTree> implements BusComponentTreeService
{
private static final Logger logger = LoggerFactory.getLogger(BusComponentTreeServiceImpl.class);

  private final BusComponentTreeDao busComponentTreeDao;

  public BusComponentTreeServiceImpl(BusComponentTreeDao busComponentTreeDao) {this.busComponentTreeDao = busComponentTreeDao;}

  public BasicDao<BusComponentTree> getDao() {return busComponentTreeDao;}

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

  @Override
  public int updateChildNamePath(BusComponentTree updateChild, String namePathNew) {
    this.beforeUpdate(updateChild);
    return busComponentTreeDao.updateChildNamePath(updateChild,namePathNew);
  }

  @Override
  public List<String> getComTreePath(MdBusComponentInfo comQuery,List<Integer> types) {
    initTenantId(comQuery);
    return busComponentTreeDao.getComTreePath(comQuery,types);
  }

  @Override
  public List<String> getComTreePathByMd(MdBusComponentInfo comQuery, List<Integer> types) {
    initTenantId(comQuery);
    return busComponentTreeDao.getComTreePathByMd(comQuery,types);
  }

  @Override
  public List<BusComponentTree> findComTreeListLike(MdBusComponentInfo comQuery, List<Object> list) {
    initTenantId(comQuery);
    return busComponentTreeDao.findComTreeListLike(comQuery,list);
  }

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

  @Override
  public List<BusComponentTreeDetailDto> findChildTreeList(BusComponentTree entity) {
    initTenantId(entity);
    return busComponentTreeDao.findChildTreeList(entity);
  }

  @Override
  public List<BusComponentTreeDetailDto> findChildTreeListMore(BusComponentTree queryAll, List<String> projectList) {
    initTenantId(queryAll);
    return busComponentTreeDao.findChildTreeListMore(queryAll,projectList);
  }

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







}

