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.PmRecordPonoProc;
import com.xisc.pm.domain.repository.PmRecordPonoProcRepository;
import com.xisc.pm.infra.mapper.PmRecordPonoProcMapper;

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

/**
 * 组炉过程记录表(PmRecordPonoProc)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-09-18 17:07:45
 */
@Component
public class PmRecordPonoProcRepositoryImpl extends BaseRepositoryImpl<PmRecordPonoProc> implements PmRecordPonoProcRepository {
    @Resource
    private PmRecordPonoProcMapper pmRecordPonoProcMapper;

    @Override
    public List<PmRecordPonoProc> selectList(PmRecordPonoProc pmRecordPonoProc) {
        return pmRecordPonoProcMapper.selectList(pmRecordPonoProc);
    }

    @Override
    public PmRecordPonoProc selectByPrimary(Long id) {
        PmRecordPonoProc pmRecordPonoProc = new PmRecordPonoProc();
        pmRecordPonoProc.setId(id);
        List<PmRecordPonoProc> pmRecordPonoProcs = pmRecordPonoProcMapper.selectList(pmRecordPonoProc);
        if (CollectionUtils.isEmpty(pmRecordPonoProcs)) {
            return null;
        }
        return pmRecordPonoProcs.get(0);
    }
}
