RequestMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.web.work.mapper.RequestMapper">
  6. <select id="selectList" resultType="com.ruoyi.web.work.domain.Request">
  7. select * from tb_obr_request
  8. <where>
  9. <if test="orcId != null "> and orc_id = #{orcId}</if>
  10. <if test="medTechProCode != null and medTechProCode != ''"> and med_tech_pro_code = #{medTechProCode}</if>
  11. <if test="medTechProName != null and medTechProName != ''"> and med_tech_pro_name like concat('%', #{medTechProName}, '%')</if>
  12. <if test="reportClass != null and reportClass != ''"> and report_class = #{reportClass}</if>
  13. <if test="reportCompleteTime != null "> and report_complete_time = #{reportCompleteTime}</if>
  14. <if test="signs != null and signs != ''"> and signs = #{signs}</if>
  15. <if test="sampleReceivedDate != null "> and sample_received_date = #{sampleReceivedDate}</if>
  16. <if test="checkpoint != null and checkpoint != ''"> and checkpoint = #{checkpoint}</if>
  17. <if test="executeDepartmentCode != null and executeDepartmentCode != ''"> and execute_department_code = #{executeDepartmentCode}</if>
  18. <if test="executeDepartmentName != null and executeDepartmentName != ''"> and execute_department_name like concat('%', #{executeDepartmentName}, '%')</if>
  19. <if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
  20. <if test="reviewDoctorCode != null and reviewDoctorCode != ''"> and review_doctor_code = #{reviewDoctorCode}</if>
  21. <if test="reviewDoctorName != null and reviewDoctorName != ''"> and review_doctor_name like concat('%', #{reviewDoctorName}, '%')</if>
  22. <if test="reportDate != null "> and report_date = #{reportDate}</if>
  23. <if test="reportNo != null and reportNo != ''"> and report_no = #{reportNo}</if>
  24. </where>
  25. </select>
  26. <select id="getRequestByCard" resultType="com.ruoyi.web.work.domain.Request">
  27. select * from tb_obr_request where card_id=#{card}
  28. </select>
  29. <select id="getAllRequestByPatId" resultType="com.ruoyi.web.work.domain.Request">
  30. SELECT * from tb_obr_request
  31. where tb_obr_request.orc_id in
  32. (SELECT tb_orc_report.id from tb_orc_report where tb_orc_report.pat_id=#{patId})
  33. </select>
  34. <!--小程序检测报告列表-->
  35. <select id="getRequestListByPatId" resultType="com.ruoyi.web.work.domain.Request">
  36. SELECT
  37. *
  38. FROM
  39. tb_obr_request obr
  40. LEFT JOIN tb_orc_report orc ON obr.orc_id = orc.id
  41. LEFT JOIN tb_visit vi ON orc.pat_id = vi.pat_id
  42. WHERE
  43. orc.pat_id = #{patId}
  44. <if test="startTime != null and endTime != null">
  45. AND vi.admission_time BETWEEN #{startTime} AND #{endTime}
  46. </if>
  47. </select>
  48. <select id="selectOrcReportByOrcId" resultType="com.ruoyi.web.work.domain.Request">
  49. SELECT * from tb_obr_request
  50. where orc_id = #{orcId}
  51. </select>
  52. </mapper>