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.PmSdivSpecLimitBtTra;
import com.xisc.pm.domain.repository.PmSdivSpecLimitBtTraRepository;
import com.xisc.pm.infra.mapper.PmSdivSpecLimitBtTraMapper;

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

/**
 * 剖分组板设备规格限制表履历表(PmSdivSpecLimitBtTra)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 08:34:36
 */
@Component
public class PmSdivSpecLimitBtTraRepositoryImpl extends BaseRepositoryImpl<PmSdivSpecLimitBtTra> implements PmSdivSpecLimitBtTraRepository {
    @Resource
    private PmSdivSpecLimitBtTraMapper pmSdivSpecLimitBtTraMapper;

    @Override
    public List<PmSdivSpecLimitBtTra> selectList(PmSdivSpecLimitBtTra pmSdivSpecLimitBtTra) {
        return pmSdivSpecLimitBtTraMapper.selectList(pmSdivSpecLimitBtTra);
    }

    @Override
    public PmSdivSpecLimitBtTra selectByPrimary(Long traId) {
        PmSdivSpecLimitBtTra pmSdivSpecLimitBtTra = new PmSdivSpecLimitBtTra();
        pmSdivSpecLimitBtTra.setTraId(traId);
        List<PmSdivSpecLimitBtTra> pmSdivSpecLimitBtTras = pmSdivSpecLimitBtTraMapper.selectList(pmSdivSpecLimitBtTra);
        if (CollectionUtils.isEmpty(pmSdivSpecLimitBtTras)) {
            return null;
        }
        return pmSdivSpecLimitBtTras.get(0);
    }
}
