package com.hs.api.service.Impl;

import com.hs.api.mapper.SerDiseaseDocRsMapper;
import com.hs.api.model.SerDiseaseDocRs;
import com.hs.api.service.SerDiseaseDocService;
import com.hs.common.utils.StringUtil;
import org.springframework.stereotype.Service;

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

@Service
public class SerDiseaseDocServiceImpl implements SerDiseaseDocService {

    @Resource
    private SerDiseaseDocRsMapper serDiseaseDocRsMapper;

    @Override
    public List<SerDiseaseDocRs> getDiseaseDoc(String docCode,String mdcCode,String deptCode,String date) throws InterruptedException {
        docCode = StringUtil.isNullOrEmpty(docCode) ? null : docCode;
        mdcCode = StringUtil.isNullOrEmpty(mdcCode) ? "" : mdcCode;
        deptCode = StringUtil.isNullOrEmpty(deptCode) ? null : deptCode;
        date = StringUtil.isNullOrEmpty(date) ? null : date;
        String[] inField = mdcCode.split(",");
//        return serDiseaseDocRsMapper.selectByCode(docCode,mdcCode,deptCode,date);
        return serDiseaseDocRsMapper.selectByRelation(docCode,inField,deptCode,date);
    }
}
