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.PmPonoWtStaticGd;
import com.xisc.pm.domain.repository.PmPonoWtStaticGdRepository;
import com.xisc.pm.infra.mapper.PmPonoWtStaticGdMapper;

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

/**
 * 炉重静态表_钢锭(PmPonoWtStaticGd)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 09:41:25
 */
@Component
public class PmPonoWtStaticGdRepositoryImpl extends BaseRepositoryImpl<PmPonoWtStaticGd> implements PmPonoWtStaticGdRepository {
    @Resource
    private PmPonoWtStaticGdMapper pmPonoWtStaticGdMapper;

    @Override
    public List<PmPonoWtStaticGd> selectList(PmPonoWtStaticGd pmPonoWtStaticGd) {
        return pmPonoWtStaticGdMapper.selectList(pmPonoWtStaticGd);
    }

    @Override
    public PmPonoWtStaticGd selectByPrimary(Long pmPonoWtStaticGdId) {
        PmPonoWtStaticGd pmPonoWtStaticGd = new PmPonoWtStaticGd();
        pmPonoWtStaticGd.setPmPonoWtStaticGdId(pmPonoWtStaticGdId);
        List<PmPonoWtStaticGd> pmPonoWtStaticGds = pmPonoWtStaticGdMapper.selectList(pmPonoWtStaticGd);
        if (CollectionUtils.isEmpty(pmPonoWtStaticGds)) {
            return null;
        }
        return pmPonoWtStaticGds.get(0);
    }
}
