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.PmPonoWtStatic;
import com.xisc.pm.domain.repository.PmPonoWtStaticRepository;
import com.xisc.pm.infra.mapper.PmPonoWtStaticMapper;

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

/**
 * 炉重静态表(PmPonoWtStatic)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 09:12:13
 */
@Component
public class PmPonoWtStaticRepositoryImpl extends BaseRepositoryImpl<PmPonoWtStatic> implements PmPonoWtStaticRepository {
    @Resource
    private PmPonoWtStaticMapper pmPonoWtStaticMapper;

    @Override
    public List<PmPonoWtStatic> selectList(PmPonoWtStatic pmPonoWtStatic) {
        return pmPonoWtStaticMapper.selectList(pmPonoWtStatic);
    }

    @Override
    public PmPonoWtStatic selectByPrimary(Long pmPonoWtStaticId) {
        PmPonoWtStatic pmPonoWtStatic = new PmPonoWtStatic();
        pmPonoWtStatic.setPmPonoWtStaticId(pmPonoWtStaticId);
        List<PmPonoWtStatic> pmPonoWtStatics = pmPonoWtStaticMapper.selectList(pmPonoWtStatic);
        if (CollectionUtils.isEmpty(pmPonoWtStatics)) {
            return null;
        }
        return pmPonoWtStatics.get(0);
    }
}
