package thyyxxk.webserver.dao.his.mz;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.mz.MzEmrPatientData;
import thyyxxk.webserver.entity.mz.MzEmrPatientVo;

/**
 * @Description:
 * @Author:lihong
 * @Date: 2023/10/18
 */
@Mapper
public interface MzEmrDao extends BaseMapper<MzEmrPatientData> {
    @Select(" select top 1 rtrim(name) name , case when sex = 1 then '男' when sex = 2 then '女' else '未知' end sex   ,age,birth_day,social_no from mz_patient_mi   where patient_id =#{patientId}")
    MzEmrPatientVo selectMzEmrPatientVo(MzEmrPatientVo param);
    @Select(" select top 1 rtrim(inpatient_no) inpatient_no from a_patient_mi where mz_no=  #{patientId} ")
    String selectPatNo(String patientId);
}
