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.PmHotDestTra;
import com.xisc.pm.domain.repository.PmHotDestTraRepository;
import com.xisc.pm.infra.mapper.PmHotDestTraMapper;

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

/**
 * 修改炼钢炉次计划热处理去向履历表(PmTpssmHotLog)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-19 15:14:00
 */
@Component
public class PmHotDestTraRepositoryImpl extends BaseRepositoryImpl<PmHotDestTra> implements PmHotDestTraRepository {
    @Resource
    private PmHotDestTraMapper pmHotDestTraMapper;

    @Override
    public List<PmHotDestTra> selectList(PmHotDestTra pmHotDestTra) {
        return pmHotDestTraMapper.selectList(pmHotDestTra);
    }

    @Override
    public PmHotDestTra selectByPrimary(Long id) {
        PmHotDestTra pmHotDestTra = new PmHotDestTra();
        pmHotDestTra.setId(id);
        List<PmHotDestTra> pmTpssmHotLogs = pmHotDestTraMapper.selectList(pmHotDestTra);
        if (CollectionUtils.isEmpty(pmTpssmHotLogs)) {
            return null;
        }
        return pmTpssmHotLogs.get(0);
    }
}
