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.PmHtolStatic;
import com.xisc.pm.domain.repository.PmHtolStaticRepository;
import com.xisc.pm.infra.mapper.PmHtolStaticMapper;

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

/**
 * 以优充次静态表(PmHtolStatic)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 10:07:37
 */
@Component
public class PmHtolStaticRepositoryImpl extends BaseRepositoryImpl<PmHtolStatic> implements PmHtolStaticRepository {
    @Resource
    private PmHtolStaticMapper pmHtolStaticMapper;

    @Override
    public List<PmHtolStatic> selectList(PmHtolStatic pmHtolStatic) {
        return pmHtolStaticMapper.selectList(pmHtolStatic);
    }

    @Override
    public PmHtolStatic selectByPrimary(Long pmHtolStaticId) {
        PmHtolStatic pmHtolStatic = new PmHtolStatic();
        pmHtolStatic.setPmHtolStaticId(pmHtolStaticId);
        List<PmHtolStatic> pmHtolStatics = pmHtolStaticMapper.selectList(pmHtolStatic);
        if (CollectionUtils.isEmpty(pmHtolStatics)) {
            return null;
        }
        return pmHtolStatics.get(0);
    }
}
