package com.xisc.pm.infra.repository.impl;

import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;
import com.xisc.pm.domain.entity.PmPdTmpYieldBt;
import com.xisc.pm.domain.repository.PmPdTmpYieldBtRepository;
import com.xisc.pm.infra.mapper.PmPdTmpYieldBtMapper;

import javax.annotation.Resource;
import java.util.List;

/**
 * 组板临时收得率基准表(PmPdTmpYieldBt)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-24 11:02:22
 */
@Component
public class PmPdTmpYieldBtRepositoryImpl extends BaseRepositoryImpl<PmPdTmpYieldBt> implements PmPdTmpYieldBtRepository {
    @Resource
    private PmPdTmpYieldBtMapper pmPdTmpYieldBtMapper;

    @Override
    public List<PmPdTmpYieldBt> selectList(PmPdTmpYieldBt pmPdTmpYieldBt) {
        return pmPdTmpYieldBtMapper.selectList(pmPdTmpYieldBt);
    }

    @Override
    public PmPdTmpYieldBt selectByPrimary(Long pptybId) {
        PmPdTmpYieldBt pmPdTmpYieldBt = new PmPdTmpYieldBt();
        pmPdTmpYieldBt.setPptybId(pptybId);
        List<PmPdTmpYieldBt> pmPdTmpYieldBts = pmPdTmpYieldBtMapper.selectList(pmPdTmpYieldBt);
        if (CollectionUtils.isEmpty(pmPdTmpYieldBts)) {
            return null;
        }
        return pmPdTmpYieldBts.get(0);
    }
}
