AppealExamineInfoMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.lantone.report.mapper.AppealExamineInfoMapper">
  4. <select id="getComplaintRecord" resultType="com.lantone.report.dto.GetComplaintRecordDTO">
  5. SELECT
  6. a.*, b.linkman AS claimant_name,
  7. c.linkman AS check_name
  8. FROM
  9. (
  10. SELECT
  11. a.*, c.example_status,
  12. c.gmt_create AS check_gmt_create
  13. FROM
  14. (
  15. SELECT
  16. a.id,
  17. a.behospital_code,
  18. a.hospital_id,
  19. a.qcresult_detail_id,
  20. a.cases_entry_id,
  21. a.qcresult_detail_msg,
  22. a.cases_name,
  23. a.defect_content,
  24. a.claimant_id,
  25. a.check_id,
  26. a.gmt_create AS claimant_gmt_create,
  27. b.`name`,
  28. b.beh_dept_name,
  29. a.appeal_operation_type,
  30. a.qcresult_detai_value qcresultDetaiValue,
  31. a.cases_score,
  32. a.is_reject,
  33. a.cases_id
  34. FROM
  35. `med_appeal_info` a
  36. LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
  37. WHERE
  38. a.hospital_id = b.hospital_id
  39. AND a.is_deleted = 'N'
  40. AND a.hospital_id = #{getComplaintRecordVO.hospitalId}
  41. AND a.claimant_id = #{getComplaintRecordVO.complaintId}
  42. <if test="getComplaintRecordVO.complaintDateStart != null ">
  43. <![CDATA[ AND a.gmt_create >= #{getComplaintRecordVO.complaintDateStart}]]>
  44. </if>
  45. <if test="getComplaintRecordVO.complaintDateEnd != null ">
  46. <![CDATA[ AND a.gmt_create <= #{getComplaintRecordVO.complaintDateEnd}]]>
  47. </if>
  48. <if test="getComplaintRecordVO.casesName != null and getComplaintRecordVO.casesName != '' ">
  49. <![CDATA[ AND a.cases_name = #{getComplaintRecordVO.casesName}]]>
  50. </if>
  51. <if test="getComplaintRecordVO.operationType != null and getComplaintRecordVO.operationType != '' ">
  52. <![CDATA[ AND a.appeal_operation_type = #{getComplaintRecordVO.operationType}]]>
  53. </if>
  54. <if test="getComplaintRecordVO.isPlacefile != null and getComplaintRecordVO.isPlacefile != '' ">
  55. <![CDATA[ AND b.is_placefile = #{getComplaintRecordVO.isPlacefile}]]>
  56. </if>
  57. <if test="getComplaintRecordVO.deptName != null and getComplaintRecordVO.deptName != '' ">
  58. <![CDATA[ AND b.beh_dept_name = #{getComplaintRecordVO.deptName}]]>
  59. </if>
  60. ) a
  61. LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
  62. WHERE
  63. c.is_deleted = 'N'
  64. <if test="getComplaintRecordVO.state != null and getComplaintRecordVO.state != '' ">
  65. <![CDATA[ AND c.example_status = #{getComplaintRecordVO.state}]]>
  66. </if>
  67. ) a
  68. LEFT JOIN sys_user b ON a.claimant_id = b.id
  69. LEFT JOIN sys_user c ON a.check_id = c.id
  70. WHERE b.is_deleted='N'
  71. AND c.is_deleted='N'
  72. <if test="getComplaintRecordVO.name != null and getComplaintRecordVO.name != '' ">
  73. <![CDATA[ AND c.linkman like concat('%',#{getComplaintRecordVO.name},'%')]]>
  74. </if>
  75. </select>
  76. <select id="getAppealReview" resultType="com.lantone.report.dto.GetAppealReviewDTO">
  77. SELECT
  78. a.*, b.linkman AS claimant_name,
  79. c.linkman AS check_name
  80. FROM
  81. (
  82. SELECT
  83. a.*, c.example_status,
  84. c.gmt_create AS check_gmt_create
  85. FROM
  86. (
  87. SELECT
  88. a.id,
  89. a.behospital_code,
  90. a.hospital_id,
  91. a.qcresult_detail_id,
  92. a.cases_entry_id,
  93. a.qcresult_detail_msg,
  94. a.cases_name,
  95. a.defect_content,
  96. a.claimant_id,
  97. a.check_id,
  98. a.gmt_create AS claimant_gmt_create,
  99. b.`name`,
  100. b.beh_dept_name,
  101. a.appeal_operation_type
  102. FROM
  103. med_appeal_info a
  104. LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
  105. WHERE
  106. a.is_deleted = 'N'
  107. AND a.hospital_id = #{getAppealReviewVO.hospitalId}
  108. AND a.hospital_id = b.hospital_id
  109. AND a.check_id = #{getAppealReviewVO.appealId}
  110. <if test="getAppealReviewVO.isPlacefile != null and getAppealReviewVO.isPlacefile != '' ">
  111. <![CDATA[ AND b.is_placefile = #{getAppealReviewVO.isPlacefile}]]>
  112. </if>
  113. <if test="getAppealReviewVO.complaintDateStart != null ">
  114. <![CDATA[ AND a.gmt_create >= #{getAppealReviewVO.complaintDateStart}]]>
  115. </if>
  116. <if test="getAppealReviewVO.complaintDateEnd != null ">
  117. <![CDATA[ AND a.gmt_create <= #{getAppealReviewVO.complaintDateEnd}]]>
  118. </if>
  119. <if test="getAppealReviewVO.deptName != null and getAppealReviewVO.deptName != '' ">
  120. <![CDATA[ AND b.beh_dept_name = #{getAppealReviewVO.deptName}]]>
  121. </if>
  122. <if test="getAppealReviewVO.casesName != null and getAppealReviewVO.casesName != '' ">
  123. <![CDATA[ AND a.cases_name = #{getAppealReviewVO.casesName}]]>
  124. </if>
  125. <if test="getAppealReviewVO.operationType != null and getAppealReviewVO.operationType != '' ">
  126. <![CDATA[ AND a.appeal_operation_type = #{getAppealReviewVO.operationType}]]>
  127. </if>
  128. ) a
  129. LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
  130. WHERE
  131. c.is_deleted = 'N'
  132. <if test="getAppealReviewVO.state != null and getAppealReviewVO.state != '' ">
  133. <![CDATA[ AND c.example_status = #{getAppealReviewVO.state}]]>
  134. </if>
  135. ) a
  136. LEFT JOIN sys_user b ON a.claimant_id = b.id
  137. LEFT JOIN sys_user c ON a.check_id = c.id
  138. WHERE b.is_deleted='N'
  139. AND c.is_deleted='N'
  140. <if test="getAppealReviewVO.name != null and getAppealReviewVO.name != '' ">
  141. <![CDATA[ AND b.linkman like concat('%',#{getAppealReviewVO.name},'%')]]>
  142. </if>
  143. </select>
  144. <select id="approved" resultType="java.lang.Boolean">
  145. </select>
  146. </mapper>