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.PmRetainSt;
import com.xisc.pm.domain.repository.PmRetainStRepository;
import com.xisc.pm.infra.mapper.PmRetainStMapper;

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

/**
 * 钢种信息配置表(PmRetainSt)资源库
 *
 * @author BKGY
 * @since 2024-12-24 09:11:15
 */
@Component
public class PmRetainStRepositoryImpl extends BaseRepositoryImpl<PmRetainSt> implements PmRetainStRepository {
    @Resource
    private PmRetainStMapper pmRetainStMapper;

    @Override
    public List<PmRetainSt> selectList(PmRetainSt pmRetainSt) {
        return pmRetainStMapper.selectList(pmRetainSt);
    }

    @Override
    public PmRetainSt selectByPrimary(Long id) {
        PmRetainSt pmRetainSt = new PmRetainSt();
        pmRetainSt.setId(id);
        List<PmRetainSt> pmRetainSts = pmRetainStMapper.selectList(pmRetainSt);
        if (CollectionUtils.isEmpty(pmRetainSts)) {
            return null;
        }
        return pmRetainSts.get(0);
    }

}

