12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package thyyxxk.wxservice_server.dao;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Param;
- import org.apache.ibatis.annotations.Select;
- import thyyxxk.wxservice_server.entity.inspections.HshjPatient;
- import java.util.List;
- /**
- * @author dj
- */
- @Mapper
- public interface InspectionsDao {
- @Select("select rtrim(max(tj_no)) from mz_patient_mi with(nolock) where patient_id=#{patientId}")
- String selectTjNo(@Param("patientId") String patientId);
- // TODO: 2021-04-30 以后这个地方要换成葫芦娃的接口
- /**
- * 通过门诊号获取住院号
- * */
- @Select("select rtrim(a.inpatient_no) from a_patient_mi a,mz_patient_mi b " +
- "where upper(a.social_no)=upper(b.social_no) and b.patient_id=#{patientId} " +
- "and a.inpatient_no not like 'S%' and a.inpatient_no not like 'JT%' " +
- "and a.inpatient_no not like '%$%'")
- List<String> selectInpatientNo(@Param("patientId") String patientId);
- @Select("select distinct rtrim(tj_no) from mz_patient_mi with(nolock) where social_no=#{socialNo}")
- List<String> selectTjNos(@Param("socialNo") String socialNo);
- @Select("select distinct rtrim(patient_id) from mz_patient_mi with(nolock) where social_no=#{socialNo}")
- List<String> selectMzNos(@Param("socialNo") String socialNo);
- @Select("select distinct rtrim(inpatient_no) from a_patient_mi with(nolock) where social_no=#{socialNo}")
- List<String> selectZyNos(@Param("socialNo") String socialNo);
- @Select("select rtrim(name) from mz_patient_mi with(nolock) where patient_id=#{patId}")
- String selectPatName(@Param("patId") String patId);
- @Select("select rtrim(name) as name,rtrim(sex) as gender, age=datediff(year,birth_day,getdate()) " +
- "from mz_patient_mi where patient_id=#{patId}")
- HshjPatient selectPatientBriefInfo(@Param("patId") String patId);
- @Select("select top 1 pat_id from t_tencent_electronic_health_card where id_number=#{socialNo}")
- String selectPatIdBySocialNo(@Param("socialNo") String socialNo);
- @Select("select count(1) from t_wechat_patient_bind where patient_id=#{patId} and open_id=#{openId} and del_flag=0")
- int selectPatIdAndOpenIdMatchCount(@Param("patId") String patId, @Param("openId") String openId);
- }
|