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.PmSdivSpecLimitBt;
import com.xisc.pm.domain.repository.PmSdivSpecLimitBtRepository;
import com.xisc.pm.infra.mapper.PmSdivSpecLimitBtMapper;

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

/**
 * 剖分组板设备规格限制表(PmSdivSpecLimitBt)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 08:34:17
 */
@Component
public class PmSdivSpecLimitBtRepositoryImpl extends BaseRepositoryImpl<PmSdivSpecLimitBt> implements PmSdivSpecLimitBtRepository {
    @Resource
    private PmSdivSpecLimitBtMapper pmSdivSpecLimitBtMapper;

    @Override
    public List<PmSdivSpecLimitBt> selectList(PmSdivSpecLimitBt pmSdivSpecLimitBt) {
        return pmSdivSpecLimitBtMapper.selectList(pmSdivSpecLimitBt);
    }

    @Override
    public PmSdivSpecLimitBt selectByPrimary(Long psslbId) {
        PmSdivSpecLimitBt pmSdivSpecLimitBt = new PmSdivSpecLimitBt();
        pmSdivSpecLimitBt.setPsslbId(psslbId);
        List<PmSdivSpecLimitBt> pmSdivSpecLimitBts = pmSdivSpecLimitBtMapper.selectList(pmSdivSpecLimitBt);
        if (CollectionUtils.isEmpty(pmSdivSpecLimitBts)) {
            return null;
        }
        return pmSdivSpecLimitBts.get(0);
    }
}
