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.PmSubCheckLow;
import com.xisc.pm.domain.repository.PmSubCheckLowRepository;
import com.xisc.pm.infra.mapper.PmSubCheckLowMapper;

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

/**
 * 低倍检测结果表(PmSubCheckLow)资源库
 *
 * @author BKGY
 * @since 2025-03-26 16:27:37
 */
@Component
public class PmSubCheckLowRepositoryImpl extends BaseRepositoryImpl<PmSubCheckLow> implements PmSubCheckLowRepository {
    @Resource
    private PmSubCheckLowMapper pmSubCheckLowMapper;

    @Override
    public List<PmSubCheckLow> selectList(PmSubCheckLow pmSubCheckLow) {
        return pmSubCheckLowMapper.selectList(pmSubCheckLow);
    }

    @Override
    public PmSubCheckLow selectByPrimary(Long id) {
        PmSubCheckLow pmSubCheckLow = new PmSubCheckLow();
        pmSubCheckLow.setId(id);
        List<PmSubCheckLow> pmSubCheckLows = pmSubCheckLowMapper.selectList(pmSubCheckLow);
        if (CollectionUtils.isEmpty(pmSubCheckLows)) {
            return null;
        }
        return pmSubCheckLows.get(0);
    }

    @Override
    public PmSubCheckLow selectByPonoAndOrderNo(PmSubCheckLow pmSubCheckLow) {
        return pmSubCheckLowMapper.selectByPonoAndOrderNo(pmSubCheckLow);
    }

}

