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


import com.sw.mes.core.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.sw.mes.yb.turnstore.entity.MaterialWarehousingBinding;
import com.sw.mes.yb.turnstore.dao.MaterialWarehousingBindingDao;
import com.sw.mes.yb.turnstore.service.MaterialWarehousingBindingService;

import java.util.List;


/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Service
@Transactional
public class MaterialWarehousingBindingServiceImpl extends BaseServiceImpl<MaterialWarehousingBinding> implements MaterialWarehousingBindingService {
    MaterialWarehousingBindingDao dao;
	@Autowired
    public void setDao(MaterialWarehousingBindingDao dao) {
        super.setBaseDao(dao);
        this.dao=dao;
    }

    @Override
    public MaterialWarehousingBinding findByMaterialBatch(String materialBatch) {
        List<MaterialWarehousingBinding> info = dao.findByMaterialBatchOrderByIdDesc(materialBatch);
        if(info != null && info.size() > 0){
            return info.get(0);
        }
        return null;
    }
}
