package com.hzya.frame.u8c.bdcorp.service.impl;

import com.hzya.frame.u8c.bdcorp.entity.BdCorpEntity;
import com.hzya.frame.u8c.bdcorp.dao.IBdCorpDao;
import com.hzya.frame.u8c.bdcorp.service.IBdCorpService;
import org.springframework.stereotype.Service; 
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;

import java.util.List;

/**
 * (BdCorp)表服务实现类
 *
 * @author makejava
 * @since 2023-09-06 14:47:18
 */
@Service("serviceCorpServiceImpl")
public class BdCorpServiceImpl extends BaseService<BdCorpEntity, String> implements IBdCorpService {
     
    private IBdCorpDao bdCorpDao;
    
    @Autowired
	public void setBdCorpDao(IBdCorpDao dao) {
		this.bdCorpDao = dao;
		this.dao = dao;
	}

	@Override
	public BdCorpEntity getPoPkByOrg(BdCorpEntity poCorp) {
		List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getPoPkByOrg(poCorp);
		if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
			return bdCorpEntityList.get(0);
		}
		return null;
	}
	@Override
	public BdCorpEntity getStockPkByOrg(BdCorpEntity poCorp) {
		List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getStockPkByOrg(poCorp);
		if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
			return bdCorpEntityList.get(0);
		}
		return null;
	}
	@Override
	public BdCorpEntity getSoPkByOrg(BdCorpEntity poCorp) {
		List<BdCorpEntity> bdCorpEntityList = bdCorpDao.getSoPkByOrg(poCorp);
		if(bdCorpEntityList != null && bdCorpEntityList.size() > 0){
			return bdCorpEntityList.get(0);
		}
		return null;
	}
}
