|
@@ -56,37 +56,37 @@
|
|
|
</if>
|
|
|
AND
|
|
|
(gmt_create IN (
|
|
|
- SELECT
|
|
|
- max(gmt_create)
|
|
|
- FROM
|
|
|
- med_appeal_info
|
|
|
- WHERE
|
|
|
- cases_entry_id IS NOT NULL
|
|
|
- AND hospital_id = #{getComplaintRecordVO.hospitalId}
|
|
|
- AND claimant_id = #{getComplaintRecordVO.complaintId}
|
|
|
- AND work_flow_node_id != 2
|
|
|
- GROUP BY
|
|
|
- hospital_id,
|
|
|
- behospital_code,
|
|
|
- cases_entry_id
|
|
|
- )
|
|
|
- OR
|
|
|
- gmt_create IN (
|
|
|
- SELECT
|
|
|
- max(gmt_create)
|
|
|
- FROM
|
|
|
- med_appeal_info
|
|
|
- WHERE
|
|
|
- cases_entry_id IS NULL
|
|
|
- AND hospital_id = #{getComplaintRecordVO.hospitalId}
|
|
|
- AND appeal_operation_type = 2
|
|
|
- AND claimant_id = #{getComplaintRecordVO.complaintId}
|
|
|
- AND work_flow_node_id != 2
|
|
|
- GROUP BY
|
|
|
- hospital_id,
|
|
|
- behospital_code,
|
|
|
- appeal_explain
|
|
|
- ))
|
|
|
+ SELECT
|
|
|
+ max(gmt_create)
|
|
|
+ FROM
|
|
|
+ med_appeal_info
|
|
|
+ WHERE
|
|
|
+ cases_entry_id IS NOT NULL
|
|
|
+ AND hospital_id = #{getComplaintRecordVO.hospitalId}
|
|
|
+ AND claimant_id = #{getComplaintRecordVO.complaintId}
|
|
|
+ AND work_flow_node_id != 2
|
|
|
+ GROUP BY
|
|
|
+ hospital_id,
|
|
|
+ behospital_code,
|
|
|
+ cases_entry_id
|
|
|
+ )
|
|
|
+ OR
|
|
|
+ gmt_create IN (
|
|
|
+ SELECT
|
|
|
+ max(gmt_create)
|
|
|
+ FROM
|
|
|
+ med_appeal_info
|
|
|
+ WHERE
|
|
|
+ cases_entry_id IS NULL
|
|
|
+ AND hospital_id = #{getComplaintRecordVO.hospitalId}
|
|
|
+ AND appeal_operation_type = 2
|
|
|
+ AND claimant_id = #{getComplaintRecordVO.complaintId}
|
|
|
+ AND work_flow_node_id != 2
|
|
|
+ GROUP BY
|
|
|
+ hospital_id,
|
|
|
+ behospital_code,
|
|
|
+ appeal_explain
|
|
|
+ ))
|
|
|
) a
|
|
|
LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
|
|
|
WHERE
|
|
@@ -144,35 +144,69 @@
|
|
|
b.beh_dept_name,
|
|
|
a.appeal_operation_type
|
|
|
FROM
|
|
|
- med_appeal_info a
|
|
|
- LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ `med_appeal_info`
|
|
|
WHERE
|
|
|
- a.is_deleted = 'N'
|
|
|
- AND a.hospital_id = #{getAppealReviewVO.hospitalId}
|
|
|
- AND a.hospital_id = b.hospital_id
|
|
|
- AND a.check_id = #{getAppealReviewVO.appealId}
|
|
|
- <if test="getAppealReviewVO.isPlacefile != null and getAppealReviewVO.isPlacefile != '' ">
|
|
|
- <![CDATA[ AND b.is_placefile = #{getAppealReviewVO.isPlacefile}]]>
|
|
|
- </if>
|
|
|
+ (
|
|
|
+ gmt_create IN (
|
|
|
+ SELECT
|
|
|
+ max(gmt_create)
|
|
|
+ FROM
|
|
|
+ med_appeal_info
|
|
|
+ WHERE
|
|
|
+ cases_entry_id IS NOT NULL
|
|
|
+ AND work_flow_node_id != 2
|
|
|
+ GROUP BY
|
|
|
+ hospital_id,
|
|
|
+ behospital_code,
|
|
|
+ cases_entry_id,
|
|
|
+ check_id
|
|
|
+ )
|
|
|
+ OR gmt_create IN (
|
|
|
+ SELECT
|
|
|
+ gmt_create
|
|
|
+ FROM
|
|
|
+ med_appeal_info
|
|
|
+ WHERE
|
|
|
+ cases_entry_id IS NULL
|
|
|
+ AND work_flow_node_id != 2
|
|
|
+ GROUP BY
|
|
|
+ appeal_explain,
|
|
|
+ check_id
|
|
|
+ )
|
|
|
+ )
|
|
|
+ AND hospital_id = #{getAppealReviewVO.hospitalId}
|
|
|
+ AND check_id = #{getAppealReviewVO.appealId}
|
|
|
<if test="getAppealReviewVO.complaintDateStart != null ">
|
|
|
- <![CDATA[ AND a.gmt_create >= #{getAppealReviewVO.complaintDateStart}]]>
|
|
|
+ <![CDATA[ AND gmt_create >= #{getAppealReviewVO.complaintDateStart}]]>
|
|
|
</if>
|
|
|
<if test="getAppealReviewVO.complaintDateEnd != null ">
|
|
|
- <![CDATA[ AND a.gmt_create <= #{getAppealReviewVO.complaintDateEnd}]]>
|
|
|
- </if>
|
|
|
- <if test="getAppealReviewVO.deptName != null and getAppealReviewVO.deptName != '' ">
|
|
|
- <![CDATA[ AND b.beh_dept_name = #{getAppealReviewVO.deptName}]]>
|
|
|
+ <![CDATA[ AND gmt_create <= #{getAppealReviewVO.complaintDateEnd}]]>
|
|
|
</if>
|
|
|
<if test="getAppealReviewVO.modeName != null and getAppealReviewVO.modeName != '' ">
|
|
|
- <![CDATA[ AND a.mode_name = #{getAppealReviewVO.modeName}]]>
|
|
|
+ <![CDATA[ AND mode_name = #{getAppealReviewVO.modeName}]]>
|
|
|
</if>
|
|
|
<if test="getAppealReviewVO.operationType != null and getAppealReviewVO.operationType != '' ">
|
|
|
- <![CDATA[ AND a.appeal_operation_type = #{getAppealReviewVO.operationType}]]>
|
|
|
+ <![CDATA[ AND appeal_operation_type = #{getAppealReviewVO.operationType}]]>
|
|
|
+ </if>
|
|
|
+ ) a
|
|
|
+ LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.hospital_id = b.hospital_id
|
|
|
+ <if test="getAppealReviewVO.isPlacefile != null and getAppealReviewVO.isPlacefile != '' ">
|
|
|
+ <![CDATA[ AND b.is_placefile = #{getAppealReviewVO.isPlacefile}]]>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="getAppealReviewVO.deptName != null and getAppealReviewVO.deptName != '' ">
|
|
|
+ <![CDATA[ AND b.beh_dept_name = #{getAppealReviewVO.deptName}]]>
|
|
|
</if>
|
|
|
) a
|
|
|
LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
|
|
|
WHERE
|
|
|
- c.is_deleted = 'N'
|
|
|
+ 1=1
|
|
|
<if test="getAppealReviewVO.state != null and getAppealReviewVO.state != '' ">
|
|
|
<![CDATA[ AND c.example_status = #{getAppealReviewVO.state}]]>
|
|
|
</if>
|