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

import com.xisc.pm.domain.repository.PmQdToLineupResultHeattreatRepository;
import com.xisc.pm.domain.vo.QdToLineupResultHeattreatVO;
import com.xisc.pm.infra.mapper.PmPdSlabInfoMapper;
import com.xisc.pm.infra.mapper.QdToLineupResultHeattreatMapper;
import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;

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

/**
 * 合同处理热处理工艺标准(QdToLineupResultHeattreat)资源库
 *
 * @author 蒋雨航 yuhang.jiang02@hand-china.com
 * @since 2024-08-16 08:36:52
 */
@Component
public class PmQdToLineupResultHeattreatRepositoryImpl extends BaseRepositoryImpl<QdToLineupResultHeattreatVO>
        implements PmQdToLineupResultHeattreatRepository {
    @Resource
    private QdToLineupResultHeattreatMapper qdToLineupResultHeattreatMapper;

    @Override
    public List<QdToLineupResultHeattreatVO> selectList(QdToLineupResultHeattreatVO qdToLineupResultHeattreatVO) {
        return qdToLineupResultHeattreatMapper.selectList(qdToLineupResultHeattreatVO);
    }

    @Override
    public QdToLineupResultHeattreatVO selectByPrimary(Long lrhId) {
        QdToLineupResultHeattreatVO qdToLineupResultHeattreatVO = new QdToLineupResultHeattreatVO();
        qdToLineupResultHeattreatVO.setLrhId(lrhId);
        List<QdToLineupResultHeattreatVO> qdToLineupResultHeattreatVOS = qdToLineupResultHeattreatMapper
                .selectList(qdToLineupResultHeattreatVO);
        if (CollectionUtils.isEmpty(qdToLineupResultHeattreatVOS)) {
            return null;
        }
        return qdToLineupResultHeattreatVOS.get(0);
    }

    @Override
    public List<QdToLineupResultHeattreatVO> selectByOrderListAndMscLineNo(List<String> orderNoList,
            String mscLineNo) {
        List<QdToLineupResultHeattreatVO> qdToLineupResultHeattreatVOList = qdToLineupResultHeattreatMapper.selectReultHeatTreat(orderNoList, mscLineNo);
        return qdToLineupResultHeattreatVOList;
    }

}
