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.PmWmWwBt;
import com.xisc.pm.domain.repository.PmWmWwBtRepository;
import com.xisc.pm.infra.mapper.PmWmWwBtMapper;

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

/**
 * 厚板产线_命令余材长度基准表(PmWmWwBt)资源库
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-15 15:18:30
 */
@Component
public class PmWmWwBtRepositoryImpl extends BaseRepositoryImpl<PmWmWwBt> implements PmWmWwBtRepository {
    @Resource
    private PmWmWwBtMapper pmWmWwBtMapper;

    @Override
    public List<PmWmWwBt> selectList(PmWmWwBt pmWmWwBt) {
        return pmWmWwBtMapper.selectList(pmWmWwBt);
    }

    @Override
    public PmWmWwBt selectByPrimary(Long id) {
        PmWmWwBt pmWmWwBt = new PmWmWwBt();
        pmWmWwBt.setId(id);
        List<PmWmWwBt> pmWmWwBts = pmWmWwBtMapper.selectList(pmWmWwBt);
        if (CollectionUtils.isEmpty(pmWmWwBts)) {
            return null;
        }
        return pmWmWwBts.get(0);
    }
}
