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.MaterialTrayBinding;
import com.sw.mes.yb.turnstore.dao.MaterialTrayBindingDao;
import com.sw.mes.yb.turnstore.service.MaterialTrayBindingService;

import java.util.List;


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

    @Override
    public MaterialTrayBinding findByTrayCode(String trayCode) {
        List<MaterialTrayBinding> byTrayCode = dao.findByTrayCode(trayCode);
        if(byTrayCode != null && byTrayCode.size() > 0){
            return byTrayCode.get(0);
        }
        return null;
    }
}
