PatientCriticalValuesDao.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package thyyxxk.webserver.dao.his.zhuyuanyisheng;
  2. import org.apache.ibatis.annotations.*;
  3. import thyyxxk.webserver.entity.criticalValue.CriticalValue;
  4. import thyyxxk.webserver.entity.criticalValue.SimpleEmployee;
  5. import thyyxxk.webserver.entity.dictionary.CodeName;
  6. import java.util.List;
  7. import java.util.Map;
  8. public interface PatientCriticalValuesDao {
  9. @Insert("insert into t_critical_message (pat_no,msg_id,msg_type,source_code,source_name," +
  10. "target_dept_code,target_dept_name,content,create_time,patient_type,inspection_type) " +
  11. "values (#{patNo},#{msgId},#{msgType},#{sourceCode},#{sourceName},#{targetDeptCode}," +
  12. "#{targetDeptName},#{content},#{createTime},#{patientType},#{inspectionType})")
  13. @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
  14. void insertCriticalValue(CriticalValue criticalValue);
  15. @Select("select isnull(zk_ward,small_dept) zkWard,refer_physician,consult_physician,dept_director " +
  16. "from zy_actpatient WITH(NOLOCK) where inpatient_no=#{inpatientNo}")
  17. Map<String,String> selectZkWardByInpatientNo(String inpatientNo);
  18. @Select("select rtrim(code) as code, rtrim(code_rs) as codeRs from a_employee_mi " +
  19. "where dept_code=#{dept} and isnull(del_flag,'0')!='1'")
  20. List<SimpleEmployee> selectEmployeesByDept(String dept);
  21. @Select("<script>" +
  22. "select rtrim(code) as code,rtrim(code_rs) as codeRs from a_employee_mi " +
  23. "where code in " +
  24. "<foreach collection='codeList' item='code' index='index' open='(' close=')' separator=','>" +
  25. "#{code}" +
  26. "</foreach>" +
  27. "</script>")
  28. List<SimpleEmployee> selectEmployeesByCodeList(List<String> codeList);
  29. @Select("select rtrim(dept) as dept from zd_dept_all where small_dept=#{dept}")
  30. List<String> selectWardListBySmallDept(String dept);
  31. @Update("update t_critical_message set state='BEEN_SENT',send_time=getdate() where id=#{id}")
  32. void updateSentState(int id);
  33. @Select("select code,name from zd_unit_code where code=" +
  34. "(select isnull(ward,admiss_ward) from zy_actpatient where inpatient_no=#{patNo})")
  35. CodeName selectTargetDept(String patNo);
  36. @Select("select code,name from zd_unit_code where code=#{code}")
  37. CodeName selectTargetDeptByCode(String code);
  38. @Select("select top 1 code,name from zd_unit_code where name=#{name}")
  39. CodeName selectTargetDeptByName(String name);
  40. }