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

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.db.PaginationService;
import net.northking.cctp.common.security.authentication.NKSecurityContext;
import net.northking.cctp.dw.db.dao.CpProjectDetailDao;
import net.northking.cctp.dw.db.entity.CpProjectDetail;
import net.northking.cctp.dw.db.entity.MidProjectInfo;
import net.northking.cctp.dw.db.service.CpProjectDetailService;
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:  2021-12-31 10:53:11  <br>
 * @author:  maven-cctp-plugin  <br>
 * @since:  1.0 <br>
 */
@Service
@ConditionalOnMissingBean(name = "CpProjectDetailServiceImpl")
public class CpProjectDetailServiceImpl extends PaginationService<CpProjectDetail> implements CpProjectDetailService
{
private static final Logger logger = LoggerFactory.getLogger(CpProjectDetailServiceImpl.class);

  private final CpProjectDetailDao cpProjectDetailDao;

  public CpProjectDetailServiceImpl(CpProjectDetailDao cpProjectDetailDao) {this.cpProjectDetailDao = cpProjectDetailDao;}

  public BasicDao<CpProjectDetail> getDao() {return cpProjectDetailDao;}

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

  @Override
  protected void beforeInsert(CpProjectDetail cpProjectDetail) {
    cpProjectDetail.setTenantId(NKSecurityContext.getTenantId());
  }

  @Override
  protected void beforeUpdate(CpProjectDetail cpProjectDetail) {
    cpProjectDetail.setTenantId(NKSecurityContext.getTenantId());
  }

  @Override
  public List<String> findTenantIds() {
    return cpProjectDetailDao.findTenantIds();
  }

  @Override
  public List<CpProjectDetail> findByProjectIds(List<MidProjectInfo> dataList) {
    return cpProjectDetailDao.findByProjectIds(dataList);
  }

// ----      The End by Generator     ----//




}

