package com.yihu.jw.hospital.mapping.service;

import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Trick on 2019/6/10.
 */
@Service
public class DoctorMappingService {

    @Autowired
    private DoctorMappingDao doctorMappingDao;

    public DoctorMappingDO findMappingCode(String doctor,String orgCode){
        List<DoctorMappingDO> list = doctorMappingDao.findByDoctorAndOrgCode(doctor,orgCode);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }

    public DoctorMappingDO findByOrgCodeAndMappingCode(String orgCode,String mappingCode){
        List<DoctorMappingDO> list = doctorMappingDao.findByOrgCodeAndMappingCode(orgCode,mappingCode);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
}
