package com.diagbot.facade;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.diagbot.entity.Medical;
import com.diagbot.service.impl.MedicalServiceImpl;
import com.diagbot.vo.MedicalVo;
import com.diagbot.vo.TermVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description: 术语临床信息查询业务层
 * @author: Weixuan Huang
 * @time: 2019/1/16 16:07
 */
@Component
public class MedicalFacade extends MedicalServiceImpl {

    /**
     * 获取医学术语知识
     *
     * @param medicalVo
     * @result List<Medical>
     */
    public List<Medical> getMedicalInfo(MedicalVo medicalVo) {
        QueryWrapper<Medical> wrapper = new QueryWrapper<>();
        if (medicalVo.getName() != null && medicalVo.getName().trim().length()>0) {
            wrapper.eq("name", medicalVo.getName());
        }

        if (medicalVo.getConcept_id() > 0) {
            wrapper.eq("concept_id", medicalVo.getConcept_id());
        }
        List<Medical> medical = this.list(wrapper);
        return medical;
    }
}
