|
@@ -36,25 +36,61 @@
|
|
a.is_reject,
|
|
a.is_reject,
|
|
a.mode_id
|
|
a.mode_id
|
|
FROM
|
|
FROM
|
|
- `med_appeal_info` a
|
|
|
|
- LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
|
|
|
|
|
|
+ (SELECT
|
|
|
|
+ *
|
|
|
|
+ FROM
|
|
|
|
+ med_appeal_info
|
|
WHERE
|
|
WHERE
|
|
- a.hospital_id = b.hospital_id
|
|
|
|
- AND a.is_deleted = 'N'
|
|
|
|
- AND a.hospital_id = #{getComplaintRecordVO.hospitalId}
|
|
|
|
- AND a.claimant_id = #{getComplaintRecordVO.complaintId}
|
|
|
|
|
|
+ 1=1
|
|
<if test="getComplaintRecordVO.complaintDateStart != null ">
|
|
<if test="getComplaintRecordVO.complaintDateStart != null ">
|
|
- <![CDATA[ AND a.gmt_create >= #{getComplaintRecordVO.complaintDateStart}]]>
|
|
|
|
|
|
+ <![CDATA[ AND gmt_create >= #{getComplaintRecordVO.complaintDateStart}]]>
|
|
</if>
|
|
</if>
|
|
<if test="getComplaintRecordVO.complaintDateEnd != null ">
|
|
<if test="getComplaintRecordVO.complaintDateEnd != null ">
|
|
- <![CDATA[ AND a.gmt_create <= #{getComplaintRecordVO.complaintDateEnd}]]>
|
|
|
|
|
|
+ <![CDATA[ AND gmt_create <= #{getComplaintRecordVO.complaintDateEnd}]]>
|
|
</if>
|
|
</if>
|
|
<if test="getComplaintRecordVO.modeName != null and getComplaintRecordVO.modeName != '' ">
|
|
<if test="getComplaintRecordVO.modeName != null and getComplaintRecordVO.modeName != '' ">
|
|
- <![CDATA[ AND a.mode_name = #{getComplaintRecordVO.modeName}]]>
|
|
|
|
|
|
+ <![CDATA[ AND mode_name = #{getComplaintRecordVO.modeName}]]>
|
|
</if>
|
|
</if>
|
|
<if test="getComplaintRecordVO.operationType != null and getComplaintRecordVO.operationType != '' ">
|
|
<if test="getComplaintRecordVO.operationType != null and getComplaintRecordVO.operationType != '' ">
|
|
- <![CDATA[ AND a.appeal_operation_type = #{getComplaintRecordVO.operationType}]]>
|
|
|
|
- </if>
|
|
|
|
|
|
+ <![CDATA[ AND appeal_operation_type = #{getComplaintRecordVO.operationType}]]>
|
|
|
|
+ </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
|
|
|
|
+ ))
|
|
|
|
+ ) a
|
|
|
|
+ LEFT JOIN med_behospital_info b ON a.behospital_code = b.behospital_code
|
|
|
|
+ WHERE
|
|
|
|
+ a.hospital_id = b.hospital_id
|
|
<if test="getComplaintRecordVO.isPlacefile != null and getComplaintRecordVO.isPlacefile != '' ">
|
|
<if test="getComplaintRecordVO.isPlacefile != null and getComplaintRecordVO.isPlacefile != '' ">
|
|
<![CDATA[ AND b.is_placefile = #{getComplaintRecordVO.isPlacefile}]]>
|
|
<![CDATA[ AND b.is_placefile = #{getComplaintRecordVO.isPlacefile}]]>
|
|
</if>
|
|
</if>
|
|
@@ -67,7 +103,7 @@
|
|
) a
|
|
) a
|
|
LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
|
|
LEFT JOIN med_appeal_examine_info c ON a.id = c.appeal_info_id
|
|
WHERE
|
|
WHERE
|
|
- c.is_deleted = 'N'
|
|
|
|
|
|
+ 1=1
|
|
<if test="getComplaintRecordVO.state != null and getComplaintRecordVO.state != '' ">
|
|
<if test="getComplaintRecordVO.state != null and getComplaintRecordVO.state != '' ">
|
|
<![CDATA[ AND c.example_status = #{getComplaintRecordVO.state}]]>
|
|
<![CDATA[ AND c.example_status = #{getComplaintRecordVO.state}]]>
|
|
</if>
|
|
</if>
|