package com.sw.mes.yb.production.service.impl;


import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.yb.production.dao.ProductionFurnaceMaterialSplitDao;
import com.sw.mes.yb.production.entity.ProductionFurnaceMaterialSplit;
import com.sw.mes.yb.production.service.ProductionFurnaceMaterialSplitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ProductionFurnaceMaterialSplitServiceImpl extends BaseServiceImpl<ProductionFurnaceMaterialSplit> implements ProductionFurnaceMaterialSplitService {
    ProductionFurnaceMaterialSplitDao dao;
	@Autowired
    public void setDao(ProductionFurnaceMaterialSplitDao dao) {
        super.setBaseDao(dao);
        this.dao=dao;
    }

    @Override
    public void deleteByTaskIdAndAgainNum(Long taskId, Integer againNum) {
        dao.deleteByTaskIdAndAgainNum(taskId, againNum);
    }

    @Override
    public void deleteByTaskIdAndRawType(Long taskId, Integer rowType) {
        dao.deleteByTaskIdAndRawType(taskId, rowType);
    }

    @Override
    public List<ProductionFurnaceMaterialSplit> findByBucketIndex(Long taskId, Integer againNum, Integer bucketIndex) {
        return dao.findByTaskIdAndAgainNumAndBucketIndex(taskId, againNum, bucketIndex);
    }

    @Override
    public List<ProductionFurnaceMaterialSplit> findByLotNoAndAgainNum(String lotNo, Integer againNum) {
        return dao.findByLotNoAndAgainNum(lotNo, againNum);
    }

    @Override
    public List<ProductionFurnaceMaterialSplit> findByRawTypeAndTaskIdAndBucketIndex(Integer rawType, Long taskId, Integer bucketIndex) {
        return dao.findByRawTypeAndTaskIdAndBucketIndex(rawType, taskId, bucketIndex);
    }
}
