package com.xisc.pm.infra.repository.impl;

import com.xisc.pm.api.dto.export.PmSgDetermineDTO;
import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;
import com.xisc.pm.domain.entity.PmSgDetermine;
import com.xisc.pm.domain.repository.PmSgDetermineRepository;
import com.xisc.pm.infra.mapper.PmSgDetermineMapper;

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

/**
 * 钢种改判表(PmSgDetermine)资源库
 *
 * @author BKGY
 * @since 2025-01-17 14:25:15
 */
@Component
public class PmSgDetermineRepositoryImpl extends BaseRepositoryImpl<PmSgDetermine> implements PmSgDetermineRepository {
    @Resource
    private PmSgDetermineMapper pmSgDetermineMapper;

    @Override
    public List<PmSgDetermine> selectList(PmSgDetermine pmSgDetermine) {
        return pmSgDetermineMapper.selectList(pmSgDetermine);
    }

    @Override
    public PmSgDetermine selectByPrimary(Long id) {
        PmSgDetermine pmSgDetermine = new PmSgDetermine();
        pmSgDetermine.setId(id);
        List<PmSgDetermine> pmSgDetermines = pmSgDetermineMapper.selectList(pmSgDetermine);
        if (CollectionUtils.isEmpty(pmSgDetermines)) {
            return null;
        }
        return pmSgDetermines.get(0);
    }

    @Override
    public List<String> checkList(List<String> uniqueIncomingCombinationList) {
        return pmSgDetermineMapper.checkList(uniqueIncomingCombinationList);
    }

    @Override
    public List<PmSgDetermineDTO> exportList(PmSgDetermine pmSgDetermine) {
        return pmSgDetermineMapper.exportList(pmSgDetermine);
    }

}

